This appears to have been a misunderstanding of what the deductions model contains. A dump of the full model includes the expected inferred transitive relations.
What does the deductions model contain, relative to the input ontology and the inferred sentences? On 9/24/2017 9:35 AM, Steve Vestal wrote: > I have a few questions about reasoning in Jena. Thanks in advance for > any answers or suggestions. > > As background, here is a simple test case to infer transitive > relations between individuals. Protege/Pellet will load this model > and infer that A transProp C. > > <?xml version="1.0"?> > <rdf:RDF xmlns="http://www.test.com/test#" > xml:base="http://www.test.com/test" > xmlns:t="http://www.test.com/test#" > xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > xmlns:owl="http://www.w3.org/2002/07/owl#" > 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.test.com/test"/> > <owl:ObjectProperty rdf:about="http://www.test.com/test#simpleProp"> > <rdfs:subPropertyOf > rdf:resource="http://www.test.com/test#transProp"/> > </owl:ObjectProperty> > <owl:ObjectProperty rdf:about="http://www.test.com/test#transProp"> > <rdf:type > rdf:resource="http://www.w3.org/2002/07/owl#TransitiveProperty"/> > </owl:ObjectProperty> > <owl:NamedIndividual rdf:about="http://www.test.com/test#A"> > <simpleProp rdf:resource="http://www.test.com/test#B"/> > </owl:NamedIndividual> > <owl:NamedIndividual rdf:about="http://www.test.com/test#B"> > <simpleProp rdf:resource="http://www.test.com/test#C"/> > </owl:NamedIndividual> > <owl:NamedIndividual rdf:about="http://www.test.com/test#C"/> > </rdf:RDF> > > Here is a fragment of the code I'm using with Jena 3.1.0. > > // Preceded by code to set up mySystemInput to read the above. > OntModel mySystem = ModelFactory.createOntologyModel( > OntModelSpec.OWL_MEM_RULE_INF ); > mySystem.read(mySystemInput, null); > Model deductionsModel = mySystem.getDeductionsModel(); > StmtIterator deducedStatements = deductionsModel.listStatements(); > // Followed by code to dump all the statements. > > The deductionsModel I get does not include the transProp sentences that > are inferred by Protege/Pellet. > > Question: The online page on reasoning suggests that the OWL reasoners > that come with Jena might not do all the inferencing that is expected > by the OWL standard. On the other hand, an exchange on users@jena a > few years ago suggested that inferring transitive properties > would/should be done. Is the above reasoner expected to make the > inference that Protege/Pellet makes? > > Question: I also tried using the OWL_MEM_TRANS_INF reasonser. In that case, > getDeductionsModel returns null. Is that expected? TODO functionality? > Is there a work-around? > > Question: Should my next step be to integrate Pellet and use that as > the reasoner? >
