Different query results between protegé and stardog

6 views
Skip to first unread message

ch...@grieger.biz

unread,
Oct 12, 2015, 4:37:43 AM10/12/15
to Stardog

I am trying to query the subClassOf triple of a class, which will give me details on the structure of said class. (I need this data to perform code generation) To make sure the error is not specific to my ontology, I created a very small example to demonstrate the problem. You can find the ontology attached as a turtle file.


When trying to run the following query against a stardog-4.0-RC1 database,


PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX : <http://www.semanticweb.org/cg/ontologies/2015/9/untitled-ontology-12#>
 
SELECT *
WHERE {
?class rdf:type owl:Class;
rdfs:subClassOf [ rdf:type owl:Class ;
owl:intersectionOf [ rdf:rest*/rdf:first ?otherClass ] ] .
FILTER (
 ?class = :SubClass
)
}
group by ?class ?otherClass

I get the following BindingSet as a result:

class: http://www.semanticweb.org/cg/ontologies/2015/9/untitled-ontology-12#SubClass otherClass: null 

I also see the following warning from pellet:

10:24:44.142 [localEventLoopGroup-5-3] WARN  c.c.pellet.rdf.DefaultRDFAxiomReader - Invalid list structure: List ?2 does not have a first property. 
 

Running the same query inside of Protegé, returns the (desired) result.



I would be very thankful for any ideas / hints!


Regards,


Chris


sample.turtle.owl

Evren Sirin

unread,
Oct 12, 2015, 9:46:59 AM10/12/15
to Stardog
You query is not valid under the definition of SPARQL entailment regimes that requires the BGP to be a valid OWL expression [1]. You need to run your query without reasoning and then you'll get expected results:

stardog-4.0-RC1$ bin/stardog query sampleDB sample.sparql
+-------------------------------------------------------------------------------+--------------------------------------------------------------------------------+
|                                     class                                     |                                   otherClass                                   |
+-------------------------------------------------------------------------------+--------------------------------------------------------------------------------+
| http://www.semanticweb.org/cg/ontologies/2015/9/untitled-ontology-12#SubClass | _:bnode_55520a4c_87a7_49e2_896c_fb9f49a9b938_9                                 |
| http://www.semanticweb.org/cg/ontologies/2015/9/untitled-ontology-12#SubClass | _:bnode_55520a4c_87a7_49e2_896c_fb9f49a9b938_11                                |
+-------------------------------------------------------------------------------+--------------------------------------------------------------------------------+

Also, note that, OWL class expressions in SPARQL queries are only supported when reasoning.type=DL but won't work for other reasoning types.

Best,
Evren


--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Reply all
Reply to author
Forward
0 new messages