I have developed an Arabic ontology about chest diseases using Protege 5.2.0, the ontology has a class Disease
and a class Symptom
. The object property between the previous two classes is has_symptom
which the domain of it is Disease
and the range is Symptom
. Now I have a sub class of a class Disease
which is Tuberculosis
.
Now can I query the ontology to get the object property between the class Tuberculosis
and the class Symptom
see the following query:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX my: <http://www.semanticweb.org/ali/ontologies/2017/2/CDDOnto#>
SELECT ?property
WHERE {
?property rdfs:domain my:Tuberculosis ;
rdfs:range my:Symptom .
}
Should I get the same property which is between the class Disease
which is a super class of Tuberculosis
and the class Symptom
or not?
In other words is the object property inherited by the sub classes of its domain and range.
I appreciate any help you provide.
Asked
Active
Viewed 672 times
3

Ali Alnader
- 193
- 1
- 14
1 Answers
1
No, introducing the my:Tuberculosis rdfs:subClassOf my:Disease
axiom to your dataset does not imply that my:has_symptom rdfs:domain my:Tuberculosis
.
You could possibly query for the property by looking for properties where my:Tuberculosis
is a sub-class of the domain of the property. The following query should retrieve properties whose domain is a super-class of my:Tuberculosis
.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX my: <http://www.semanticweb.org/ali/ontologies/2017/2/CDDOnto#>
SELECT ?property
WHERE {
?property rdfs:domain/(rdfs:subClassOf^)* my:Tuberculosis ;
rdfs:range my:Symptom .
}
Depending on how you have defined your ontology (ie: are you using owl axioms?), you may be better off using an owl reasoner. For example, if your class hierarchy includes any union or intersection axioms, that above query would not be 'smart' enough to follow them.

Rob Hall
- 2,693
- 16
- 22