[Pellet-Users] Help:SPARQL query!!
Chiara Bernabei
bernabei at infinito.it
Wed Oct 11 10:06:13 EDT 2006
My query at this moment return the istances of a specific class(?y) and of its sub-classes, but I have to find also the istances of its direct super-classes(not TFLEItem), for example y="Banquet _Catering" I have to find the istance "Restaurant_Catering_31"of "Restaurant_Catering" class. The problem is that the reasoner give me all the super_classes if I write
"?o rdf:type ?s. ?y rdfs:subClassOf ?s" .How can I do??.When y="Hotel_Meeting_Facilities" I haven't any problem because with" ?o rdf:type ?y" I find all the istances.
My query is:
PREFIX CapOffer:<http://www.lia.deis.unibo.it/research/MIDAS/Ontologies/TFLEOntology.owl#>
PREFIX profile:<http://www.lia.deis.unibo.it/research/MIDAS/Ontologies/MIDAS_Profile.owl#>
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl:<http://www.w3.org/2002/07/owl#>
SELECT *
FROM NAMED <http://www.lia.deis.unibo.it/research/MIDAS/Ontologies/ZefiroRequest.owl>
FROM NAMED <http://www.lia.deis.unibo.it/research/MIDAS/Ontologies/ZefiroOffer2.owl>
WHERE {
GRAPH <http://www.lia.deis.unibo.it/research/MIDAS/Ontologies/ZefiroRequest.owl> {
?res a owl:Restriction ;
owl:onProperty profile:has_cap_item ;
owl:someValuesFrom ?y .
}.
GRAPH <http://www.lia.deis.unibo.it/research/MIDAS/Ontologies/ZefiroOffer2.owl> {
?x rdf:type CapOffer:TFLECapability .
?x profile:has_cap_item ?o .
?o rdf:type ?y .
OPTIONAL {
?s rdfs:subClassOf CapOffer:TFLEItem .
?y rdfs:subClassOf ?s .
?o rdf:type ?s .}
}.
}
Thank in advance
Bernabei Chiara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mindswap.org/pipermail/pellet-users/attachments/20061011/2b692cae/attachment.html
More information about the Pellet-Users
mailing list