[Pellet-users] A query on SPARQL Evaluation in Pellet

Petr Křemen kremen at labe.felk.cvut.cz
Fri Mar 23 14:12:13 UTC 2007


 Dear all,

 I have the following question about evaluating SPARQL in Pellet.

 =================================================================
 Data
 =================================================================
 <?xml version="1.0"?>
 <!DOCTYPE rdf:RDF [
      <!ENTITY owl  "http://www.w3.org/2002/07/owl#" >
      <!ENTITY xsd  "http://www.w3.org/2001/XMLSchema#" >
    ]>

 <rdf:RDF
   xmlns     = "http://www.example.org/e1#"
   xmlns:owl = "http://www.w3.org/2002/07/owl#"
   xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:rdfs= "http://www.w3.org/2000/01/rdf-schema#"
   xmlns:xsd = "http://www.w3.org/2001/XMLSchema#">

   <owl:Ontology rdf:about="">
     <rdfs:comment>SPARQL example ontology</rdfs:comment>
     <rdfs:label>SPARQL example</rdfs:label>
   </owl:Ontology>

   <owl:Class rdf:ID="X">
     <rdfs:subClassOf>
       <owl:Restriction>
         <owl:onProperty rdf:resource="#p"/>
         <owl:someValuesFrom rdf:resource="&owl;Thing"/>
       </owl:Restriction>
     </rdfs:subClassOf>
   </owl:Class>

   <X rdf:ID="a">
       <p rdf:resource="#d" />
       <p rdf:parseType="Resource">
         <owl:Thing/>
       </p>
   </X>
 </rdf:RDF>

 =================================================================
  Query :
 =================================================================
 PREFIX my:  <http://www.example.org/e1#>
 PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 PREFIX owl: <http://www.w3.org/2002/07/owl#>
 SELECT ?x ?y
 WHERE {?x my:p ?y}

 =================================================================
 Result ( demo on Pellet web page ):
 =================================================================
 x 	y
 my:a 	eb3e2fb:-7fff
 my:a 	my:d
 I would expect to have one more result with another blank node as ?y
 binding for 'p' of 'my:a'. Another possibility is that the engine will
 merge the information and outputs just 'my:a my:d' result (as the blank
 nodes do not add any information).

 When I tried to run the query on the same RDF graph without the triples
 specifying the p-successors of 'my:a' I expected to obtain a result
 inferred from the OWL semantics from the definition of the class X, but
 the result was empty. This looks as if the reasoner performes the RDFS
 inference, not the OWL one.

 Could You help me ? Do I understand it well ?

 Thanks in advance for Your answer

 Petr Kremen



More information about the Pellet-users mailing list