Assuming there are several class definitions in an ontology:
<owl:Class rdf:about="&ontX;A">
<rdfs:label>A</rdfs:label>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="&ontY;hasCapability"/>
<owl:someValuesFrom rdf:resource="&ontY;CapabilityB"/>
</owl:Restriction>
</rdfs:subClassOf>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="&ontY;hasCapability"/>
<owl:someValuesFrom rdf:resource="&ontY;CapabilityC"/>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>
How to retrieve all capabilities for a given class. In the the above example, for the given class A, CapabilityB and CapabilityC should be returned.
&ontY;CapabilityB and &ontY;CapabilityC are classes in another ontology. The ontologies cannot be changed.
OWL API and a reasoner may be used for the query.