I am using OWL API 3.4.3 and Hermit 1.3.8.1 (reasoner) on standard Pizza ontology.
I try to extract Direct superclasses of a class.
The tutorial provided here does not consider the extraction of Direct superclasses. For example, Food has two superclasses namely,
- owl:Thing and
- DomainConcept.
A simple code snippet is shown to extract the above mentioned Direct superclasses (i.e. DomainConcept).
public Set<OWLClass> getDirectSuperClasses(String classExpressionString, boolean direct) {
if (classExpressionString.trim().length() == 0) {
return Collections.emptySet();
}
OWLClassExpression classExpression = parser
.parseClassExpression(classExpressionString);
//NodeSet<OWLClass> subClasses = reasoner.getSubClasses(classExpression, direct);
NodeSet<OWLClass> directSuperClasses = **reasoner.get_________?????**
return directSuperClasses.getFlattened();
}
I am not able to find any relevant method which can be called using reasoner object.
Any tricks to get the desired output directly?
Thanks in advance :)