next up previous contents
Next: Oriented Path Up: Body Previous: Source   Contents

Variable for property

It is possible to denote a property by a variable in a query.

Example : retrieve a transitive property ?p relating ?x, ?y and ?z.

?x ?p ?y
?y ?p ?z
?p rdf:type owl:TransitiveProperty

Quizz :

?p ?p ?x

Answer :

rdfs:domain rdfs:domain rdf:Property
rdfs:range  rdfs:range  rdfs:Class
rdf:type    rdf:type    rdf:Property

It is possible to specify a property name in addition to a variable :

?x c:property::?p ?y

Warning : two triples with the same variable property match triples that are related by the same property. If two target triples are related by properties where one is a subproperty of the other, the query fails.



Olivier Corby 2005-07-01