Hi Shreyes,
I see 2 options for you:
Option 1: You can keep the "plots" table as it is, and import
its content as instances in your ontology, using DataMaster.
In this case, there will be only one class corresponding to the one
table in the database, and each column will become an OWL datatype
property.
Each row in the plots table will become an instance of the Plot
class and you can write SWRL queries of the form
Plot(?p) ∧
area(?p, ?area) ∧ swrlb:lessThanOrEqual(?area, 27) →
Tax(tax_slab1)
Option 2: You can try to normalize your database, by creating
separate tables to represent land use (and possibly also the owner)
and you would import the content of your database as instances of
multiple classes, using DataMaster.
Suppose you restructure your database as follows:
plots (plot_id <PK> , hasOwner <FK> , area ,
hasLanduse <FK>)
owner (owner_id <PK>, owner_name)
landuse (landuse_id <PK>, landuse)
and you create all the primary keys (PKs) and foreign keys (FKs)
that reference the PKs.
In this case, you will have 3 imported classes (or 2 if you decide
that there is no point in extracting the owner in a separate table),
one for each table.
"plot_id", "area", "owner_name" and "landuse" will become datatype
properties, while "owner_id" and "landuse_id" will become object
properties referencing instances from the Owner and Landuse classes.
You will be able to write SWRL queries of the form:
Plot(?p) ∧ hasLanduse(?p,
?lu) ∧ Landuse(?lu) ∧ landuse(?lu, ?landuse_descr) ∧ swrlb:equal(?landuse_descr, "private") ∧ area(?p,
?area) ∧ swrlb:lessThanOrEqual(?area, 27) → Tax(tax_slab1)
Please note:
1. In both solution I did not created a separate table for the area
(i.e. I did not want to instantiate the area) because I think that
area should be really represented as a number, since each plot can
have different value for its area, and it does not make sense to
instantiate every possible number that represent an area.
2. In both solution you will need to use the following DataMaster
options:
Import tables as: classes
Import table content: TRUE
I hope this helps you started,
Csongor
On 3/7/2011 1:54 PM, shreyes shiv wrote:
I am using the Datamaster tab in Protege
3.4.4.
I have created an ontology where the classes
are plot_id,
owner_name, area and landuse.
I have defined restrictions and relationships
between them.
I have a database in mysql which has a table
called as plots
and it has 4 attributes.(plot_id, owner_name, area, landuse)
I created sub tables out of the plots table
which consists
of plot_id as the primary key in all the sub tables i.e. the
tables are
(plot_id,owner_name) ; (plot_id,area) ; (plot_id, landuse) so
that i have a
table for each of the classes i have created and they are
related since they
have plot_id in comman.
Now i want to import the tuples of the
database as instance
of the classes. i.e. for class plot_id i want the tuples of the
plots table to
be the instances, for class owner_name i want the tuples of the
table which
consists of the attributes (plot_id,owner_name), and so on.
Can you please tell me which option to choose
from your
datamaster tab.
Is this a proper thing that i am doing ?
After doing this i have to write swrl rules
and then to
retrieve i have write sqwrl queries.
Please help me.
Thank you
--
shreyes shiv
email: [hidden email]
phone: 9557975780
IIRS(Indian Institute of Remote Sensing)
No. 4, Kalidas Road, Dehradun-248001, Uttarakhand, India
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl
Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owlInstructions for unsubscribing:
http://protege.stanford.edu/doc/faq.html#01a.03