You are creating the reasoner manually rather than through its factory. This might leave it not listening for updates on the ontology, so the call to reasoner.flush()
might not work.
Try using Reasoner.ReasonerFactory
to create instances and see if this fixes your issue.
Another possibility is that the IRIs in your code do not match those in the ontology. Make sure they do by printing out your IRIs and those in ontology.getSignature()
.
Edit: the second possibility is confirmed. I copied your ontology fragment and your code in a test. The class IRIs in your ontology are:
<http://www.semanticweb.org/sabse/ontologies/2013/11/untitled-ontology-17#Person>
<http://www.semanticweb.org/sabse/ontologies/2013/11/untitled-ontology-17#PersonWithPosition1>
The Person class in your code has IRI:
<#Person>
The mismatch is caused by the prefix manager having "#"
as default namespace. That is not the default namespace of your ontology.