I used Protege to make an ontology. It consists of two base classes. Each of them has three subsclasses. Subclasses are classes with specific object and data properties. When I make an instance I make it as class individual but with such data properties so that instance also belongs to some subclass. When I run Hermit in Protege, it is well done. It says that my instance belongs to class and subclass. But in Jfact in Java and Owlapi, when I try to print all instances from subclasses, my instance belongs only to superclass, not to subclass. Is it about JFact or something else?
for (OWLClass c : ont.getClassesInSignature()) {
if (c.getIRI().getFragment().equals("Baby")) {
NodeSet<OWLClass> subClasses = reasoner.getSubClasses(c, false);
for (OWLClass subClass : subClasses.getFlattened()) {
System.out.println(subClass.getIRI().getFragment());
NodeSet<OWLNamedIndividual> instances = reasoner.getInstances(subClass, false);
for (OWLNamedIndividual i : instances.getFlattened()) {
System.out.println(i.getIRI().getFragment());
s += i.getIRI().getFragment() + " ";
}
}
}
}