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

NullPointerException in BlockingContext.moveBlockerUp #36

Open Locke opened 6 years ago

Locke commented 6 years ago

Hi,

I'm using openllet-owlapi version 2.6.4 and owlapi-api version 5.1.5.

I get this NullPointerException when I try to work with a specific ontology:

Exception in thread "main" java.lang.NullPointerException
    at openllet.core.tableau.blocking.BlockingContext.moveBlockerUp(BlockingContext.java:45)
    at openllet.core.tableau.blocking.Blocking.isDirectlyBlockedByDescendant(Blocking.java:156)
    at openllet.core.tableau.blocking.Blocking.isDirectlyBlockedInt(Blocking.java:129)
    at openllet.core.tableau.blocking.Blocking.isBlocked(Blocking.java:80)
    at openllet.core.tableau.completion.rule.AbstractTableauRule.apply(AbstractTableauRule.java:104)
    at openllet.core.rules.ContinuousRulesStrategy.complete(ContinuousRulesStrategy.java:251)
    at openllet.core.boxes.abox.ABoxImpl.lambda$isConsistent$12(ABoxImpl.java:1417)
    at openllet.core.utils.Timers.execute(Timers.java:118)
    at openllet.core.boxes.abox.ABoxImpl.isConsistent(ABoxImpl.java:1417)
    at openllet.core.boxes.abox.ABoxImpl.existType(ABoxImpl.java:905)
    at openllet.core.knowledge.InstancesBase.retrieve(InstancesBase.java:268)
    at openllet.core.KnowledgeBaseImplFullSync.retrieve(KnowledgeBaseImplFullSync.java:733)
    at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.realizeByConcept(CDOptimizedTaxonomyBuilder.java:1353)
    at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.realizeByConcept(CDOptimizedTaxonomyBuilder.java:1361)
    at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.realizeByConcept(CDOptimizedTaxonomyBuilder.java:1361)
    at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.realizeByConcept(CDOptimizedTaxonomyBuilder.java:1361)
    at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.realizeByConcepts(CDOptimizedTaxonomyBuilder.java:1322)
    at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.realize(CDOptimizedTaxonomyBuilder.java:1181)
    at openllet.core.KnowledgeBaseImpl.realize(KnowledgeBaseImpl.java:1950)
    at openllet.core.KnowledgeBaseImplFullSync.realize(KnowledgeBaseImplFullSync.java:391)
    at openllet.owlapi.PelletReasoner.precomputeInferences(PelletReasoner.java:1285)

As the ontology is not public yet I'd like to send it to you via mail (or some other channel. It's nothing secret, but I'm not comfortable sharing it openly without consent from all involved parties).

Initially I got the exception when I called reasoner.types(someIndividual), and I have now created a smaller version to investigate this error better: https://gist.github.com/Locke/c275b45823f014ba4a09400fe462c39d

The basic idea is that there is a basic ontology (created with Protégé) which is then imported by a second file that contains the individuals (created programmatically via owlapi from some other data source).

As I'm quite new to owl it might be that I made a terrible mistake, but in that case it should be detected and guided with a better exception.

Galigator commented 6 years ago

If you do not want to share a complete ontology you can try this program : https://github.com/Galigator/openllet/blob/integration/tools-pellint/searchMinimalBug.sh Given a big ontology that make the reasoner fail, It try to compute a minimal ontology that make the reasoner also fail (And it does a lot of renaming). It never terminate, so you have to Ctrl+C when a smaller ontology is found.

Locke commented 6 years ago

Thanks, that nailed it down a lot!

I've uploaded the result here: https://gist.github.com/Locke/c275b45823f014ba4a09400fe462c39d#file-minimalontologyfile-owl

Locke commented 6 years ago

I created an enriched ontology (that's no longer minimal) for a better understanding: https://gist.github.com/Locke/c275b45823f014ba4a09400fe462c39d#file-enrichedontologyfile-owl

Interestingly, when I add the range TransitionCondition to hasTransitionCondition the NPE doesn't occur.

Some background of the ontology: Having both Action and State is an ongoing discussion on our side, also whether the Transition belongs to an Action or a State. As a compromise we currently have the SWRL rule (and also one not shown here for the other direction) to just have both. I don't think this should be problematic in owl though. I also can't see right now how the OverloadStrategy comes into play here.

Galigator commented 6 years ago

Last commit should solve the problem in the 2.6.5-SNAPSHOT.

I need more time to investigate this case because the WSDL rule il complex to debug.

Locke commented 6 years ago

Great, that solved the NullPointerException also in my original ontology / application :)

I don't understand what you want to investigate further, so I leave this issue open for you to close.