I'm learning SPARQL and need some advices about a query.
Exemple of the ontology :
<owl:Class rdf:about="http://snomed.info/id/187903000">
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<rdf:Description rdf:about="http://snomed.info/id/187900002"/>
<owl:Restriction>
<owl:onProperty rdf:resource="http://snomed.info/id/609096000"/>
<owl:someValuesFrom>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<owl:Restriction>
<owl:onProperty rdf:resource="http://snomed.info/id/116676008"/>
<owl:someValuesFrom rdf:resource="http://snomed.info/id/367651003"/>
</owl:Restriction>
<owl:Restriction>
<owl:onProperty rdf:resource="http://snomed.info/id/363698007"/>
<owl:someValuesFrom rdf:resource="http://snomed.info/id/13881006"/>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:someValuesFrom>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:equivalentClass>
<rdfs:subClassOf rdf:resource="http://snomed.info/id/126546006"/>
<rdfs:subClassOf rdf:resource="http://snomed.info/id/363501002"/>
<rdfs:subClassOf rdf:resource="http://snomed.info/id/448558006"/>
<field:Description.term.en-us.preferred xml:lang="en">Malignant neoplasm of malar bone</field:Description.term.en-us.preferred>
<rdfs:label xml:lang="en">Malignant neoplasm of malar bone (disorder)</rdfs:label>
</owl:Class>
I'm trying to retrieve the URI present in owl:someValuesFrom depending of which URI present in owl:onProperty.
I tried this query :
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?fsn ?rs WHERE {
?subject rdfs:label ?fsn ;
<http://snomed.info/id/116676008> ?rs .
}
following the advice of this post Sparql query on restriction list (Equivalent To) in protégé. But the 2 answers given in this post didn't work.
Have you got any ideas of what's wrong with my query ? Thank you for your help !
For people which may have the same question, the answer of AKSW is really helpfull and worked !
So I use the Turtle format to represent my ontology :
With this format the way to query appear simplier. So if I want to retrieve the value of the property http://snomed.info/id/363698007 I need to use the following query :
This query will give you the following result :