[Pellet-users] problems with sparql rdf query and transitive property
João Paulo Sousa
jpaulo at ipb.pt
Wed Feb 13 23:50:52 UTC 2008
Hi,
Tanks to Evren and to Wolfgang previous previous help.
Now i have this problem. When is run the above query it returns the
fowling results:
-----------------
| contains |
=================
| dspac:bar |
| dspac:theater |
-----------------
I can we see on the ontology, berlin only contains theater and the
theater contains the bar. Why it return two results? The transitive
property is a owl feature! Why this is happening?
How i can exclude the transitive property?
Chears,
João.
PREFIX dspac: <http://icas.ipb.pt/secom/data/spatial.owl#>
SELECT ?contains
WHERE {
dspac:Berlin dspac:contains ?contains .
}
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>
<rdf:RDF xmlns="http://icas.ipb.pt/secom/data/spatial.owl#"
xml:base="http://icas.ipb.pt/secom/data/spatial.owl"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<owl:Ontology rdf:about=""/>
<Room rdf:ID="bar">
<isPartOf rdf:resource="#theater"/>
</Room>
<City rdf:ID="Berlin">
<contains rdf:resource="#theater"/>
</City>
<Person rdf:ID="bill">
<hasLocation rdf:resource="#theater"/>
</Person>
<owl:Class rdf:ID="Building">
<rdfs:subClassOf rdf:resource="#Spac"/>
</owl:Class>
<owl:Class rdf:ID="City">
<rdfs:subClassOf rdf:resource="#Spac"/>
</owl:Class>
<owl:ObjectProperty rdf:ID="contains">
<rdf:type rdf:resource="&owl;TransitiveProperty"/>
<rdfs:domain rdf:resource="#Spac"/>
<rdfs:range rdf:resource="#Spac"/>
<owl:inverseOf rdf:resource="#isPartOf"/>
</owl:ObjectProperty>
<owl:ObjectProperty rdf:ID="hasLocation">
<rdfs:domain rdf:resource="#Person"/>
<rdfs:range rdf:resource="#Spac"/>
</owl:ObjectProperty>
<owl:ObjectProperty rdf:ID="isPartOf">
<rdfs:domain rdf:resource="#Spac"/>
<rdfs:range rdf:resource="#Spac"/>
<owl:inverseOf rdf:resource="#contains"/>
</owl:ObjectProperty>
<owl:Class rdf:ID="Person"/>
<owl:Class rdf:ID="Room">
<rdfs:subClassOf rdf:resource="#Spac"/>
</owl:Class>
<owl:Class rdf:ID="Spac"/>
<Person rdf:ID="steve">
<hasLocation rdf:resource="#bar"/>
</Person>
<Building rdf:ID="theater">
<isPartOf rdf:resource="#Berlin"/>
<contains rdf:resource="#bar"/>
</Building>
</rdf:RDF>
More information about the Pellet-users
mailing list