The Jena OWL Micro inference engine is not doing what I'm expecting when
faced with an objectProperty with an inverseOf statement. I explain a
simple test ontology and provide the owl and java to test it below.

I created an ontology with a Person class and childOf and parentOf object
properties. When I create two nodes and make one the parent of the other,
I'm expecting the inference engine to infer the appropriate child property,
but it doesn't.

inverseOf.owl
<?xml version="1.0"?>
<rdf:RDF xmlns="http://example.com/ont/roster/";
xml:base="http://example.com/ont/roster/";
xmlns:pr="http://example.com/ont/roster/";
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://example.com/ont/inverse/";>
<owl:versionIRI
rdf:resource="http://example.com/ont/inverse/0.0.1"; />
</owl:Ontology>

<owl:Class rdf:about="http://example.com/ont/inverse/Person"; />

<owl:ObjectProperty rdf:about="http://example.com/ont/inverse/parentOf";>
  <owl:inverseOf rdf:resource="http://example.com/ont/inverse/childOf"; />
  <rdfs:domain rdf:resource="http://example.com/ont/inverse/Person"; />
  <rdfs:range rdf:resource="http://example.com/ont/inverse/Person"; />
</owl:ObjectProperty>

<owl:ObjectProperty rdf:about="http://example.com/ont/inverse/childOf";>
  <rdfs:domain rdf:resource="http://example.com/ont/inverse/Person"; />
  <rdfs:range rdf:resource="http://example.com/ont/inverse/Person"; />
</owl:ObjectProperty>

<rdf:Description rdf:about="http://example.com/ont/inverse/Sally";>
  <rdf:type rdf:resource="http://example.com/ont/inverse/Person"/>
  <parentOf rdf:resource="http://example.com/ont/inverse/Bob"; />
</rdf:Description>

<rdf:Description rdf:about="http://example.com/ont/inverse/Bob";>
  <rdf:type rdf:resource="http://example.com/ont/inverse/Person"/>
</rdf:Description>

</rdf:RDF>

Here is the Jena code I use:

OntModel model =
   ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_MICRO_RULE_INF);
model.read("file:///inverseTest.owl");

printAllStatements(model);

The resulting model contains these nodes with Bob or Sally as the subject:

http://example.com/ont/inverse/Bob
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://example.com/ont/inverse/Person .
http://example.com/ont/inverse/Bob
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://www.w3.org/2000/01/rdf-schema#Resource .
http://example.com/ont/inverse/Bob
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://www.w3.org/2002/07/owl#Thing .
http://example.com/ont/inverse/Sally http://example.com/ont/roster/parentOf
http://example.com/ont/inverse/Bob .
http://example.com/ont/inverse/Sally
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://example.com/ont/inverse/Person .
http://example.com/ont/inverse/Sally
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://www.w3.org/2000/01/rdf-schema#Resource .
http://example.com/ont/inverse/Sally
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://www.w3.org/2002/07/owl#Thing .

Reply via email to