Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException in rete.JoinCondition.test #39

Closed
Locke opened this issue Jul 3, 2018 · 1 comment
Closed

NullPointerException in rete.JoinCondition.test #39

Locke opened this issue Jul 3, 2018 · 1 comment
Labels
bug Developper confirm there is a bug in the product.

Comments

@Locke
Copy link
Contributor

Locke commented Jul 3, 2018

Given the code in https://github.com/Locke/pruned_node and the ontology npe.owl from that project I get a NullPointerException with this stacktrace:

java.lang.NullPointerException
        at openllet.core.rules.rete.JoinCondition.test(JoinCondition.java:29)
        at openllet.core.rules.rete.BetaMemoryNode.testConditions(BetaMemoryNode.java:83)
        at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:73)
        at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
        at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
        at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
        at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
        at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
        at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
        at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
        at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
        at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
        at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
        at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
        at openllet.core.rules.rete.BetaTopNode.activate(BetaTopNode.java:33)
        at openllet.core.rules.rete.AlphaNode.lambda$activate$1(AlphaNode.java:49)
        at java.util.ArrayList.forEach(ArrayList.java:1257)
        at openllet.core.rules.rete.AlphaNode.activate(AlphaNode.java:49)
        at openllet.core.rules.rete.AlphaTypeNode.activate(AlphaTypeNode.java:60)
        at openllet.core.rules.rete.AlphaNetwork.activateType(AlphaNetwork.java:150)
        at openllet.core.rules.rete.AlphaNetwork.activateIndividual(AlphaNetwork.java:133)
        at java.util.Iterator.forEachRemaining(Iterator.java:116)
        at openllet.core.rules.rete.AlphaNetwork.activateAll(AlphaNetwork.java:119)
        at openllet.core.rules.rete.Interpreter.run(Interpreter.java:60)
        at openllet.core.rules.ContinuousRulesStrategy.applyRete(ContinuousRulesStrategy.java:145)
        at openllet.core.rules.ContinuousRulesStrategy.complete(ContinuousRulesStrategy.java:224)
        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.isConsistent(ABoxImpl.java:1269)
        at openllet.core.KnowledgeBaseImpl.consistency(KnowledgeBaseImpl.java:1802)
        at openllet.core.KnowledgeBaseImpl.isConsistent(KnowledgeBaseImpl.java:1877)
        at openllet.core.KnowledgeBaseImplFullSync.isConsistent(KnowledgeBaseImplFullSync.java:403)
        at openllet.owlapi.PelletReasoner.isConsistent(PelletReasoner.java:1032)
        at de.athalis.owl.PrunedNode.printProcesses(PrunedNode.java:77)
        at de.athalis.owl.PrunedNode.main(PrunedNode.java:31)

Simply changing the corresponding line from return _wmeProvider.getNode(wme, token).getTerm().equals(_tokenProvider.getNode(wme, token).getTerm()); to return java.util.Objects.equals(_wmeProvider.getNode(wme, token).getTerm(), _tokenProvider.getNode(wme, token).getTerm()); seems like an easy fix. I applied that change locally and didn't discover any drawbacks yet.

However I can't tell whether that is just fixing a symptom that is causing my other issues (in particular #38 as that happens in the same region). It might be that it is unexpected to have an anonymous literal with no value at this place?..

Note that this is independent of whether I set OpenlletOptions.TRACK_BRANCH_EFFECTS = true; or not.

@Galigator Galigator added the bug Developper confirm there is a bug in the product. label Jul 3, 2018
@Locke Locke mentioned this issue May 5, 2021
@Locke
Copy link
Contributor Author

Locke commented May 5, 2021

Resolved with #60

@Locke Locke closed this as completed May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Developper confirm there is a bug in the product.
Projects
None yet
Development

No branches or pull requests

2 participants