Im using owlready2 for ontology engineering and reasoning. When I run the integrated Pellet reasoner it does not infer individuals belonging to superclasses of their assigned class. The minimum reproducible example ontology looks like this:
Testclass subClassOf owl:Thing
Testchild subClassOf Testclass
Testchild(Testindividual)
Or, in full:
<?xml version="1.0"?>
<rdf:RDF xmlns="http://www.semanticweb.org/cwrk/ontologies/2024/11/untitled-ontology-10/"
xml:base="http://www.semanticweb.org/cwrk/ontologies/2024/11/untitled-ontology-10/"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<owl:Ontology rdf:about="http://www.semanticweb.org/cwrk/ontologies/2024/11/untitled-ontology-10"/>
<!-- http://www.semanticweb.org/cwrk/ontologies/2024/11/untitled-ontology-10#Testchild -->
<owl:Class rdf:about="http://www.semanticweb.org/cwrk/ontologies/2024/11/untitled-ontology-10#Testchild">
<rdfs:subClassOf rdf:resource="http://www.semanticweb.org/cwrk/ontologies/2024/11/untitled-ontology-10#Testclass"/>
</owl:Class>
<!-- http://www.semanticweb.org/cwrk/ontologies/2024/11/untitled-ontology-10#Testclass -->
<owl:Class rdf:about="http://www.semanticweb.org/cwrk/ontologies/2024/11/untitled-ontology-10#Testclass"/>
<!-- http://www.semanticweb.org/cwrk/ontologies/2024/11/untitled-ontology-10#Testindividual -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/cwrk/ontologies/2024/11/untitled-ontology-10#Testindividual">
<rdf:type rdf:resource="http://www.semanticweb.org/cwrk/ontologies/2024/11/untitled-ontology-10#Testchild"/>
</owl:NamedIndividual>
</rdf:RDF>
I would expect a reasoner to find that Testclass(Testindividual) holds. Indeed, if I run this example via the Pellet reasoner integrated in Protege this is what I get. However when I use the Pellet reasoner integrated in owlready2 there are no instances of Testclass! Here is the minimal code to reproduce it:
import owlready2 as owl
onto = owl.get_ontology("data/testonto.rdf").load()
with onto:
owl.sync_reasoner_pellet()
print(onto.get_instances_of(onto.Testclass)) # returns []
print(onto.get_instances_of(onto.Testchild)) # returns [Testindividual]
Is this intended behaviour? What am I missing?