0

I am using ontobee to execute a query to get all siblings of "essential Hypertension" in human Disease Ontology "DOID", The query returns 5 triples.

prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
prefix owl: <http://www.w3.org/2002/07/owl#> 
SELECT ?xChild Str(?xChildLa)
from <http://purl.obolibrary.org/obo/merged/DOID>
WHERE { 
         <http://purl.obolibrary.org/obo/DOID_10825> rdfs:subClassOf ?x.
         ?xChild  rdfs:subClassOf|(owl:equivalentClass)* ?x ;
                 rdfs:label ?xChildLa.

}

but the page of "essential Hypertension" shows in Class Hierarchy that there is one more sibling not returned by query.

what is wrong with the above query? why "renal hypertension" not returned?

Eng. Samer T
  • 6,465
  • 6
  • 36
  • 43

1 Answers1

1

If you click on the description of renal hypertension, you will see that is

renal hypertension EquivalentTo hypertension and (located in some kidney)

which means it's using an OWL class equivalence axiom (owl:equivalentClass). This is syntactic sugar for the rdfs:subClassOf relation in both directions, and indeed your SPARQL query doesn't handle this axiom neither syntactically nor semantically.

Not sure whether they use an OWL reasoner to get all subclasses for visualization.

Doing it via SPARQL can be found in the great answer from Joshua Taylor.

Community
  • 1
  • 1
UninformedUser
  • 8,397
  • 1
  • 14
  • 23
  • This is still not clear to my, why "renal hypertension" not in query results even when using equivalentClass as property in where clause. – Eng. Samer T May 07 '17 at 12:05
  • It becomes clear when you look at the RDF mapping of OWL class expression and OWL axioms: https://www.w3.org/TR/owl2-mapping-to-rdf/. It's much more verbose. The superclass is an intersection which is encoded via RDF lists: `_:x rdf:type owl:Class . _:x owl:intersectionOf T(SEQ CE1 ... CEn) .` where each `CE_i` itself can be an OWL class expression. That's why I said it's much more complicated with SPARQL – UninformedUser May 07 '17 at 13:10
  • Something like `rdfs:subClassOf|(owl:equivalentClass / owl:intersectionOf / rdf:rest*/rdf:first)` could work, but it's untested since I don't have sample data to run it locally. – UninformedUser May 07 '17 at 13:13