sqwrl

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

sqwrl

shreyes
Dear all,

I have a table called as 'bigarea' which has two attributes area and plot_id.

I have an ontology that consists of two classes 'Plot' and 'Tax'. Tax has five sub classes known as - tax_slab_1 to tax_slab_5.

The hierarchy is

-Plots
        -db:bigarea
-Tax

The table 'bigarea' is imported into the ontology under the 'Plot' class. A subclass 'db:bigarea' is created under the 'Plot' class. 
The attributes of the table are imported as datatype property under the class 'db:bigarea'.

The tax_slabs are organized as following
tax_slab_1 - area more than 0 and less than 27
tax_slab_2 - area more than 27 and less than 46.
tax_slab_3 - area more than 46 and less than 91.
tax_slab_4 - area more than 91 and less than 136.
tax_slab_5 - area more than 136.

My objective is to assign plots to the respective tax slabs according to the area.
I would like to know 
1. How can i assign plots to the respective tax slabs by using the object property, or, are there any other methods for doing this ?
2. can I use the sqwrl to retrieve the plots.

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
Reply | Threaded
Open this post in threaded view
|

Re: sqwrl

Martin O'Connor

SWRL and SQWRL can be used fairly directly here, e.g.,

http://protege.cim3.net/cgi-bin/wiki.pl?SQWRL#nidA1E

Martin

On 6/2/2011 9:16 PM, shreyes shiv wrote:

> Dear all,
>
> I have a table called as 'bigarea' which has two attributes area and plot_id.
>
> I have an ontology that consists of two classes 'Plot' and 'Tax'. Tax has five sub classes known as - tax_slab_1 to
> tax_slab_5.
>
> The hierarchy is
>
> -Plots
>         -db:bigarea
> -Tax
>
> The table 'bigarea' is imported into the ontology under the 'Plot' class. A subclass 'db:bigarea' is created under the
> 'Plot' class.
> The attributes of the table are imported as datatype property under the class 'db:bigarea'.
>
> The tax_slabs are organized as following
> tax_slab_1 - area more than 0 and less than 27
> tax_slab_2 - area more than 27 and less than 46.
> tax_slab_3 - area more than 46 and less than 91.
> tax_slab_4 - area more than 91 and less than 136.
> tax_slab_5 - area more than 136.
>
> My objective is to assign plots to the respective tax slabs according to the area.
> I would like to know
> 1. How can i assign plots to the respective tax slabs by using the object property, or, are there any other methods
> for doing this ?
> 2. can I use the sqwrl to retrieve the plots.
>
> thank you
> --
> shreyes shiv
> email: [hidden email] <mailto:[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-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
Reply | Threaded
Open this post in threaded view
|

Re: sqwrl

Thomas Russ
In reply to this post by shreyes

On Jun 2, 2011, at 9:16 PM, shreyes shiv wrote:

> Dear all,
>
> I have a table called as 'bigarea' which has two attributes area and plot_id.
>
> I have an ontology that consists of two classes 'Plot' and 'Tax'. Tax has five sub classes known as - tax_slab_1 to tax_slab_5.
>
> The hierarchy is
>
> -Plots
>         -db:bigarea
> -Tax
>
> The table 'bigarea' is imported into the ontology under the 'Plot' class. A subclass 'db:bigarea' is created under the 'Plot' class.
> The attributes of the table are imported as datatype property under the class 'db:bigarea'.
>
> The tax_slabs are organized as following
> tax_slab_1 - area more than 0 and less than 27
> tax_slab_2 - area more than 27 and less than 46.
> tax_slab_3 - area more than 46 and less than 91.
> tax_slab_4 - area more than 91 and less than 136.
> tax_slab_5 - area more than 136.
>
> My objective is to assign plots to the respective tax slabs according to the area.
> I would like to know
> 1. How can i assign plots to the respective tax slabs by using the object property, or, are there any other methods for doing this ?

You can arrange to have the assignment handled through standard OWL class definitions and classification, although you will need to make some minor changes in your structure.

So, for example, you could introduce an ObjectProperty like "taxForPlot" and use this to link a Tax individual to each plot.  You could then define the tax slab subclasses based on the characteristics of the plot to which the tax individual is attached:

Tax
   tax_slab_1 == Tax and taxForPlot some (Plot and area some int[>= 0, < 27])
   tax_slab_1 == Tax and taxForPlot some (Plot and area some int[>= 27, < 46])
   etc.

(An alternate organization would be to make the tax_slab part of the hierarchy be underneath the Plot class.  Then you could dispense with the need to create a separate individual for each plot.  Instead, you might then call things Plot-Tax-Class-1, Plot-Tax-Class-2, etc. and make the definition be directly on the plot individual.  This is the approach that I would likely take.

Plot
  Plot-Tax-Class-1 == Plot and area some int[>= 0, < 27]
  Plot-Tax-Class-2 == Plot and area some int[>= 27, < 46]
  etc.


> 2. can I use the sqwrl to retrieve the plots.

You should then be able to use SQWRL to retrieve the plots, although I don't know if anything special needs to be done first in order to have SQWRL see the results of the classifier's inferences.

You could presumably also use DL-QUERY to get the results, since all you are trying to get are the members of a class.

Or you could get that directly from the reasoner API if you were writing your own Java code.

>
> 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-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
Reply | Threaded
Open this post in threaded view
|

Re: sqwrl

shreyes
>You can arrange to have the assignment handled through standard OWL class definitions and classification, >although you will need to make some minor changes in your structure.

>So, for example, you could introduce an ObjectProperty like "taxForPlot" and use this to link a Tax individual >to each plot.

I did create the Object Property "taxForPlot". Should i specify the range and domain? If yes, then what ?

>  You could then define the tax slab subclasses based on the characteristics of the plot to which the tax individual is attached:

The hierarchy of the classes is shown below

-Plot
     -db:bigarea
-Tax
     -Tax_slab_1
     -Tax_slab_2
     -Tax_slab_3
     -Tax_slab_4
     -Tax_slab_5

The instances that were imported into the ontology are instances of the db:bigarea class which is a subclass of Plot class.

>Tax
>  tax_slab_1 == Tax and taxForPlot some (Plot and area some int[>= 0, < 27])

where should i write the above expression?

>  tax_slab_2 == Tax and taxForPlot some (Plot and area some int[>= 27, < 46])

>  etc.

I have to use the object property to retrieve the plots. So i have to write the swrl rules according to it.
Can you please direct me how to write the rules.
Reply | Threaded
Open this post in threaded view
|

Re: sqwrl

Thomas Russ

On Jun 3, 2011, at 9:08 PM, shreyes wrote:

>> You can arrange to have the assignment handled through standard OWL class
> definitions and classification, >although you will need to make some minor
> changes in your structure.
>
>> So, for example, you could introduce an ObjectProperty like "taxForPlot"
> and use this to link a Tax individual >to each plot.
>
> I did create the Object Property "taxForPlot". Should i specify the range
> and domain? If yes, then what ?
>
>> You could then define the tax slab subclasses based on the
>> characteristics of the plot to which the tax individual is attached:
>
> The hierarchy of the classes is shown below
>
> -Plot
>     -db:bigarea
> -Tax
>     -Tax_slab_1
>     -Tax_slab_2
>     -Tax_slab_3
>     -Tax_slab_4
>     -Tax_slab_5
>
> The instances that were imported into the ontology are instances of the
> db:bigarea class which is a subclass of Plot class.
>
>> Tax
>> tax_slab_1 == Tax and taxForPlot some (Plot and area some int[>= 0, <
>> 27])
>
> where should i write the above expression?

As a necessary and sufficient condition of the class tax_slab_1.

>
>> tax_slab_2 == Tax and taxForPlot some (Plot and area some int[>= 27, <
>> 46])
>
>> etc.
>
> I have to use the object property to retrieve the plots. So i have to write
> the swrl rules according to it.
> Can you please direct me how to write the rules.

I'm not sure why you would need SWRL rules, since the above encodes the definition just using OWL constructs.

For each plot you would create an individual of type Tax and connect it to the plot individual using the taxForPlot property.  Then allow the classifier to run and classify the Tax individuals into their appropriate subtypes of tax_slab_N.

Then all you need do is look at the reasoner's inferred output for individuals of the class, or for the type of the tax individual.

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: sqwrl

shreyes
Dear Dr. Russ

I agree that I need not use SWRL to retrieve the necessary items.

The hierarchy of the classes is shown below

-Plot
    -db:bigarea
-Tax
    -Tax_slab_1
    -Tax_slab_2
    -Tax_slab_3
    -Tax_slab_4
    -Tax_slab_5

The datatype properties that are created after the table is imported into the ontologies are:
1. db:area
2. db:plot_id

There are 4996 instances for the class db:bigarea.

According to the expression that was told by you, i wrote the following expression in the necessary and sufficient condition.

Tax and taxforPlot some (Plot and db:area some int[>=0, <27]

But Protege 3.4.4 showed an error in the expression:

WARNING: Exception caught by default exception handler -- edu.stanford.smi.prote
gex.owl.model.classparser.manchester.TokenMgrError: Lexical error at line 1, col
umn 52.  Encountered: ">" (62), after : ""

please help me with this.
Reply | Threaded
Open this post in threaded view
|

Re: sqwrl

Thomas Russ

On Jun 6, 2011, at 7:32 PM, shreyes wrote:

> Dear Dr. Russ
>
> I agree that I need not use SWRL to retrieve the necessary items.
>
> The hierarchy of the classes is shown below
>
> -Plot
>    -db:bigarea
> -Tax
>    -Tax_slab_1
>    -Tax_slab_2
>    -Tax_slab_3
>    -Tax_slab_4
>    -Tax_slab_5
>
> The datatype properties that are created after the table is imported  
> into
> the ontologies are:
> 1. db:area
> 2. db:plot_id
>
> There are 4996 instances for the class db:bigarea.
>
> According to the expression that was told by you, i wrote the  
> following
> expression in the necessary and sufficient condition.
>
> Tax and taxforPlot some (Plot and db:area some int[>=0, <27]
>
> But Protege 3.4.4 showed an error in the expression:
>
> WARNING: Exception caught by default exception handler --
> edu.stanford.smi.prote
> gex.owl.model.classparser.manchester.TokenMgrError: Lexical error at  
> line 1,
> col
> umn 52.  Encountered: ">" (62), after : ""
>
> please help me with this.

I'm sorry.  I didn't realize that you were using Protege 3.

Having data type ranges is an OWL 2.0 feature, and OWL 2.0 isn't fully  
supported by Protege 3.

You could write this using Protege 4, but that is a completely  
different interface, and Protege 4 doesn't have the same support for  
SWRL/SQWRL yet.

So I'm not sure exactly what to advise here.

If you need or want to continue using Protege 3, then you probably do  
have to use SWRL to make this inference.

If instead you can or want to change to using Protege 4, you could use  
these OWL 2 features and the DL-QUERY tab to find individuals that  
match.

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: sqwrl

shreyes
Dear Dr. Russ,

I opened the ontology created in Protege 3.4.4 in Protege 4.0.
I wrote the expression for tax_slab_1.

How do i write the query to extract the individuals under tax_slab_1 with the help of DL query.
please help i am not familiar with protege 4.0.
Reply | Threaded
Open this post in threaded view
|

Re: sqwrl

shreyes
In reply to this post by Thomas Russ
I used Protege 4.0 as per your suggestion and wrote the expression

tax_slab_1== tax and taxforplot some (plot and area some float[>= 0.0, < 27.0])

and so on.

now the reasoner gives an null exception error.

what should be the domain and range for the taxforplot object property?