Galigator / openllet

Openllet is an OWL 2 reasoner in Java, build on top of Pellet.
https://www.w3.org/TR/owl2-primer/
Other
96 stars 26 forks source link

invalid explanations with owlapi #61

Open RukNdf opened 3 years ago

RukNdf commented 3 years ago

I'm using Openllet 2.6.5 with owlapi 5.1.16 to generate explanations for assertions and it works for the most part, but there's often invalid rules within the explanations. Asking the program to explain why "prop a b" is true might lead to an explanation that includes the contradicting rule "... -> not-prop a b", but is otherwise correct. Using Protege with the pellet reasoner leads to correct explanations without those contradicting rules, so it most likely isn't a problem with the ontology itself.

The openllet reasoner is initialized via

//OwlOntoLayer onto
final OpenlletReasoner reasoner = OpenlletReasonerFactory.getInstance().createReasoner(this.onto.getOntology());
expGen = new PelletExplanation(reasoner);

and the explanation obtained with

OWLDataFactory dataFactory = this.ontology.getOWLOntologyManager().getOWLDataFactory();
OWLObjectPropertyAssertionAxiom propertyAssertion = dataFactory.getOWLObjectPropertyAssertionAxiom((OWLObjectPropertyExpression)objectProperty, (OWLIndividual)domain, (OWLIndividual)range);
System.out.println(expGen.getEntailmentExplanation((OWLAxiom)propertyAssertion));

The code seems to be correct when compared with the examples, all other variables output the expected value when you print them, and aside from the inconsistent rule the explanation is correct, which makes me believe it's not a problem with the code either.

I can't share the ontology I'm currently using, but if you think there might be a problem with it I can try recreating the problem with another ontology.

Galigator commented 3 years ago

Is the 'prop' reflexive ?

RukNdf commented 3 years ago

No, none of the proprieties have any characteristics.

RukNdf commented 2 years ago

Turns out the ontology I'm using was already public in another repository, here's the file.