Pellet reasoner and SPARQL query

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

Pellet reasoner and SPARQL query

Tole Dipali

Hello,

 

In my ontology, one of the Individual , I made Same as another individual of the same class.

 

What I want to do is  1999.17 is equivalent to “ 1048.4 and 167.9 together”. As I am not able to create this rule , I tried to make it equivalent to one single individual i.e. 1048.4 to verify the query output.

 

 

 

After starting the Pellet reasoner , I can see the Object property  getting assigned to 1999.17 and also its shown  SameAs 1048.4

 

 

 

 

But  when I try to query the data using filter criteria as “HydraulicOilTemperature” fault code , I cannot see the event id 22 and 34 in my  output which are related to 1999.17 but now equivalent to 1048.4

 

 

 

Am I missing any step or does this mean “Same Individual As “ cannot be used for this purpose ?

 

Thanks,

Dipali

 

 


_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Pellet reasoner and SPARQL query

Csongor Nyulas
Administrator
The default "SPARQL Query" plugin works with the asserted axioms. There is another plugin called "Snap SPARQL Query" (Window -> Views -. Query views -> Snap SPARQL View), which work with the inferred knowledge base. You can get events 22 and 34 returned with the Snap SPARQL plugin. In order to see results in Snap SPARQL Query view, you will need to select and run a reasoner. Make sure the reasoner runs successfully (i.e. it does not throw exceptions). For example when trying to run Pellet on the version of the ontology you sent us earlier I get an inconsistent ontology message because of some incorrect dateTime value. Hermit also throws some exception because of SWRL built-ins. You need to fix your ontologies or use a different reasoner. Fact++ 1.6.5 worked fine for me.
When I ran this query in Snap SPARQL I get all the results:

PREFIX eg: <http://www.semanticweb.org/dt73315/ontologies/2017/1/untitled-ontology-86#>
SELECT ?evid ?code ?pin ?date ?cat ?code2
    WHERE { ?evid  eg:hasFaultCode ?code;
                eg:belongsTo ?pin .
        ?code eg:hasFaultCategory eg:HydraulicOilTemperature.

        ?code eg:hasFaultCategory ?cat.
    }

BTW, if you fix your date values to proper xsd:dateTime values, then Pellet will work with your original query.

Csongor


On 03/13/2017 07:34 AM, Tole Dipali wrote:

Hello,

 

In my ontology, one of the Individual , I made Same as another individual of the same class.

 

What I want to do is  1999.17 is equivalent to “ 1048.4 and 167.9 together”. As I am not able to create this rule , I tried to make it equivalent to one single individual i.e. 1048.4 to verify the query output.

 

 

 

After starting the Pellet reasoner , I can see the Object property  getting assigned to 1999.17 and also its shown  SameAs 1048.4

 

 

 

 

But  when I try to query the data using filter criteria as “HydraulicOilTemperature” fault code , I cannot see the event id 22 and 34 in my  output which are related to 1999.17 but now equivalent to 1048.4

 

 

 

Am I missing any step or does this mean “Same Individual As “ cannot be used for this purpose ?

 

Thanks,

Dipali

 

 



_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev


_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Pellet reasoner and SPARQL query

Tole Dipali

Hello Csongor,

 

Thanks for your help.

 

Yes, I did updated the date values as per response from Josef and it worked fine.

 

Thanks,

Dipali

 

From: protege-dev [mailto:[hidden email]] On Behalf Of Csongor Nyulas
Sent: Tuesday, March 14, 2017 1:01 AM
To: Developer support for WebProtege and Protege Desktop <[hidden email]>
Subject: Re: [protege-dev] Pellet reasoner and SPARQL query

 

The default "SPARQL Query" plugin works with the asserted axioms. There is another plugin called "Snap SPARQL Query" (Window -> Views -. Query views -> Snap SPARQL View), which work with the inferred knowledge base. You can get events 22 and 34 returned with the Snap SPARQL plugin. In order to see results in Snap SPARQL Query view, you will need to select and run a reasoner. Make sure the reasoner runs successfully (i.e. it does not throw exceptions). For example when trying to run Pellet on the version of the ontology you sent us earlier I get an inconsistent ontology message because of some incorrect dateTime value. Hermit also throws some exception because of SWRL built-ins. You need to fix your ontologies or use a different reasoner. Fact++ 1.6.5 worked fine for me.
When I ran this query in Snap SPARQL I get all the results:

PREFIX eg: <http://www.semanticweb.org/dt73315/ontologies/2017/1/untitled-ontology-86#>
SELECT ?evid ?code ?pin ?date ?cat ?code2
    WHERE { ?evid  eg:hasFaultCode ?code;
                eg:belongsTo ?pin .
        ?code eg:hasFaultCategory eg:HydraulicOilTemperature.
        ?code eg:hasFaultCategory ?cat.
    }

BTW, if you fix your date values to proper xsd:dateTime values, then Pellet will work with your original query.

Csongor

On 03/13/2017 07:34 AM, Tole Dipali wrote:

Hello,

 

In my ontology, one of the Individual , I made Same as another individual of the same class.

 

What I want to do is  1999.17 is equivalent to “ 1048.4 and 167.9 together”. As I am not able to create this rule , I tried to make it equivalent to one single individual i.e. 1048.4 to verify the query output.

 

 

 

After starting the Pellet reasoner , I can see the Object property  getting assigned to 1999.17 and also its shown  SameAs 1048.4

 

 

 

 

But  when I try to query the data using filter criteria as “HydraulicOilTemperature” fault code , I cannot see the event id 22 and 34 in my  output which are related to 1999.17 but now equivalent to 1048.4

 

 

 

Am I missing any step or does this mean “Same Individual As “ cannot be used for this purpose ?

 

Thanks,

Dipali

 

 




_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev

 


_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Pellet reasoner and SPARQL query

Lorenz Buehmann
Just a question, what is the reason for modeling numbers as individuals?

Hello Csongor,

 

Thanks for your help.

 

Yes, I did updated the date values as per response from Josef and it worked fine.

 

Thanks,

Dipali

 

From: protege-dev [[hidden email]] On Behalf Of Csongor Nyulas
Sent: Tuesday, March 14, 2017 1:01 AM
To: Developer support for WebProtege and Protege Desktop [hidden email]
Subject: Re: [protege-dev] Pellet reasoner and SPARQL query

 

The default "SPARQL Query" plugin works with the asserted axioms. There is another plugin called "Snap SPARQL Query" (Window -> Views -. Query views -> Snap SPARQL View), which work with the inferred knowledge base. You can get events 22 and 34 returned with the Snap SPARQL plugin. In order to see results in Snap SPARQL Query view, you will need to select and run a reasoner. Make sure the reasoner runs successfully (i.e. it does not throw exceptions). For example when trying to run Pellet on the version of the ontology you sent us earlier I get an inconsistent ontology message because of some incorrect dateTime value. Hermit also throws some exception because of SWRL built-ins. You need to fix your ontologies or use a different reasoner. Fact++ 1.6.5 worked fine for me.
When I ran this query in Snap SPARQL I get all the results:

PREFIX eg: <http://www.semanticweb.org/dt73315/ontologies/2017/1/untitled-ontology-86#>
SELECT ?evid ?code ?pin ?date ?cat ?code2
    WHERE { ?evid  eg:hasFaultCode ?code;
                eg:belongsTo ?pin .
        ?code eg:hasFaultCategory eg:HydraulicOilTemperature.
        ?code eg:hasFaultCategory ?cat.
    }

BTW, if you fix your date values to proper xsd:dateTime values, then Pellet will work with your original query.

Csongor

On 03/13/2017 07:34 AM, Tole Dipali wrote:

Hello,

 

In my ontology, one of the Individual , I made Same as another individual of the same class.

 

What I want to do is  1999.17 is equivalent to “ 1048.4 and 167.9 together”. As I am not able to create this rule , I tried to make it equivalent to one single individual i.e. 1048.4 to verify the query output.

 

 

 

After starting the Pellet reasoner , I can see the Object property  getting assigned to 1999.17 and also its shown  SameAs 1048.4

 

 

 

 

But  when I try to query the data using filter criteria as “HydraulicOilTemperature” fault code , I cannot see the event id 22 and 34 in my  output which are related to 1999.17 but now equivalent to 1048.4

 

 

 

Am I missing any step or does this mean “Same Individual As “ cannot be used for this purpose ?

 

Thanks,

Dipali

 

 




_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev

 



_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Pellet reasoner and SPARQL query

Tole Dipali

Most of my data consist of numbers that’s the reason you can see individual as numbers.

 

Thanks,

Dipali

 

From: protege-dev [mailto:[hidden email]] On Behalf Of Lorenz B.
Sent: Tuesday, March 14, 2017 12:40 PM
To: [hidden email]
Subject: Re: [protege-dev] Pellet reasoner and SPARQL query

 

Just a question, what is the reason for modeling numbers as individuals?



Hello Csongor,

 

Thanks for your help.

 

Yes, I did updated the date values as per response from Josef and it worked fine.

 

Thanks,

Dipali

 

From: protege-dev [[hidden email]] On Behalf Of Csongor Nyulas
Sent: Tuesday, March 14, 2017 1:01 AM
To: Developer support for WebProtege and Protege Desktop [hidden email]
Subject: Re: [protege-dev] Pellet reasoner and SPARQL query

 

The default "SPARQL Query" plugin works with the asserted axioms. There is another plugin called "Snap SPARQL Query" (Window -> Views -. Query views -> Snap SPARQL View), which work with the inferred knowledge base. You can get events 22 and 34 returned with the Snap SPARQL plugin. In order to see results in Snap SPARQL Query view, you will need to select and run a reasoner. Make sure the reasoner runs successfully (i.e. it does not throw exceptions). For example when trying to run Pellet on the version of the ontology you sent us earlier I get an inconsistent ontology message because of some incorrect dateTime value. Hermit also throws some exception because of SWRL built-ins. You need to fix your ontologies or use a different reasoner. Fact++ 1.6.5 worked fine for me.
When I ran this query in Snap SPARQL I get all the results:

PREFIX eg: <http://www.semanticweb.org/dt73315/ontologies/2017/1/untitled-ontology-86#>
SELECT ?evid ?code ?pin ?date ?cat ?code2
    WHERE { ?evid  eg:hasFaultCode ?code;
                eg:belongsTo ?pin .
        ?code eg:hasFaultCategory eg:HydraulicOilTemperature.
        ?code eg:hasFaultCategory ?cat.
    }

BTW, if you fix your date values to proper xsd:dateTime values, then Pellet will work with your original query.

Csongor


On 03/13/2017 07:34 AM, Tole Dipali wrote:

Hello,

 

In my ontology, one of the Individual , I made Same as another individual of the same class.

 

What I want to do is  1999.17 is equivalent to “ 1048.4 and 167.9 together”. As I am not able to create this rule , I tried to make it equivalent to one single individual i.e. 1048.4 to verify the query output.

 

 

 

After starting the Pellet reasoner , I can see the Object property  getting assigned to 1999.17 and also its shown  SameAs 1048.4

 

 

 

 

But  when I try to query the data using filter criteria as “HydraulicOilTemperature” fault code , I cannot see the event id 22 and 34 in my  output which are related to 1999.17 but now equivalent to 1048.4

 

 

 

Am I missing any step or does this mean “Same Individual As “ cannot be used for this purpose ?

 

Thanks,

Dipali

 

 





_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev

 




_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Pellet reasoner and SPARQL query

Csongor Nyulas
Administrator
That is not a good reason by itself.
Numbers, if they represent measurements are better to be represented as dataproperty values. That will not change the fact that they would still be data.
I had the same initial reaction as Lorenz. You don't want to create individuals for all the different numbers that you have to deal with. But then I realized that the numbers in Dipali's ontology (at least the ones I looked at) are not really just some arbitrary numbers, per se. In some cases they are error codes, such as "1999.7". They do have a type, e.g. "DTC". It is not the decimal number 1999.7, but the error code which is presented to the human by the number 1999.7. It could very well be named "ErrorCode_1999.7" in the ontology, to better represent what it really is. The same can be said about the Events. The fact that the instances are named with simple numbers (31, 16, 22, etc), it does not make them just a number. They are individuals of type "Event". They could be named "Event_22", to better reflect that fact, and to avoid possible misinterpretation. In fact using the variable "?evid" in the SPARQL query is also misleading, because these are not the numerical IDs of the events, per se, but rather they represent the event instance, which has an IRI. A numerical id (like a key identifying an event in a database) could be attached as a xsd:decimal data property value to the instance itself, if so desired.
A counter example, where you would want to use data property values and not instances would be, for example, if one would have data about the oil temperature at the time when the fault code appeared, that should be encoded as a data property value (e.g. Event_22 hasOilTempMeasurement "130"^xsd:decimal), and not as individual.

Csongor


On 03/16/2017 07:31 AM, Tole Dipali wrote:

Most of my data consist of numbers that’s the reason you can see individual as numbers.

 

Thanks,

Dipali

 

From: protege-dev [[hidden email]] On Behalf Of Lorenz B.
Sent: Tuesday, March 14, 2017 12:40 PM
To: [hidden email]
Subject: Re: [protege-dev] Pellet reasoner and SPARQL query

 

Just a question, what is the reason for modeling numbers as individuals?



Hello Csongor,

 

Thanks for your help.

 

Yes, I did updated the date values as per response from Josef and it worked fine.

 

Thanks,

Dipali

 

From: protege-dev [[hidden email]] On Behalf Of Csongor Nyulas
Sent: Tuesday, March 14, 2017 1:01 AM
To: Developer support for WebProtege and Protege Desktop [hidden email]
Subject: Re: [protege-dev] Pellet reasoner and SPARQL query

 

The default "SPARQL Query" plugin works with the asserted axioms. There is another plugin called "Snap SPARQL Query" (Window -> Views -. Query views -> Snap SPARQL View), which work with the inferred knowledge base. You can get events 22 and 34 returned with the Snap SPARQL plugin. In order to see results in Snap SPARQL Query view, you will need to select and run a reasoner. Make sure the reasoner runs successfully (i.e. it does not throw exceptions). For example when trying to run Pellet on the version of the ontology you sent us earlier I get an inconsistent ontology message because of some incorrect dateTime value. Hermit also throws some exception because of SWRL built-ins. You need to fix your ontologies or use a different reasoner. Fact++ 1.6.5 worked fine for me.
When I ran this query in Snap SPARQL I get all the results:

PREFIX eg: <http://www.semanticweb.org/dt73315/ontologies/2017/1/untitled-ontology-86#>
SELECT ?evid ?code ?pin ?date ?cat ?code2
    WHERE { ?evid  eg:hasFaultCode ?code;
                eg:belongsTo ?pin .
        ?code eg:hasFaultCategory eg:HydraulicOilTemperature.
        ?code eg:hasFaultCategory ?cat.
    }

BTW, if you fix your date values to proper xsd:dateTime values, then Pellet will work with your original query.

Csongor


On 03/13/2017 07:34 AM, Tole Dipali wrote:

Hello,

 

In my ontology, one of the Individual , I made Same as another individual of the same class.

 

What I want to do is  1999.17 is equivalent to “ 1048.4 and 167.9 together”. As I am not able to create this rule , I tried to make it equivalent to one single individual i.e. 1048.4 to verify the query output.

 

 

 

After starting the Pellet reasoner , I can see the Object property  getting assigned to 1999.17 and also its shown  SameAs 1048.4

 

 

 

 

But  when I try to query the data using filter criteria as “HydraulicOilTemperature” fault code , I cannot see the event id 22 and 34 in my  output which are related to 1999.17 but now equivalent to 1048.4

 

 

 

Am I missing any step or does this mean “Same Individual As “ cannot be used for this purpose ?

 

Thanks,

Dipali

 

 





_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev

 




_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center


_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev


_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev