Mulitple atoms like p(?x,?x), p(?y,?y) in swrl rules raise IndexOutOfBoundsException in BetaNode

33 views
Skip to first unread message

Christian-D

unread,
Apr 11, 2014, 12:50:27 PM4/11/14
to pellet...@googlegroups.com
Hello everyone,

I encountered an issue when using "rolification" (use of an object property to indicate the class membership of an individual) and swrl-rules in combination. Maybe someone here has an idea regarding the cause and possibilities to circumvent this issue? 

When using multiple atoms with only one variable each in context of an DL-safe rule, the call PelletReasoner.getKB.realize() fails with the following exception:

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.rangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at com.clarkparsia.pellet.rules.rete.BetaNode.join(BetaNode.java:123)
at com.clarkparsia.pellet.rules.rete.Interpreter.processBetaNodes(Interpreter.java:109)
at com.clarkparsia.pellet.rules.rete.Interpreter.run(Interpreter.java:236)
at com.clarkparsia.pellet.rules.ContinuousRulesStrategy.applyRete(ContinuousRulesStrategy.java:179)
at com.clarkparsia.pellet.rules.ContinuousRulesStrategy.complete(ContinuousRulesStrategy.java:322)
at org.mindswap.pellet.ABox.isConsistent(ABox.java:1423)
at org.mindswap.pellet.ABox.isConsistent(ABox.java:1260)
at org.mindswap.pellet.KnowledgeBase.consistency(KnowledgeBase.java:1987)
at org.mindswap.pellet.KnowledgeBase.isConsistent(KnowledgeBase.java:2061)
at org.mindswap.pellet.KnowledgeBase.ensureConsistency(KnowledgeBase.java:2075)
at org.mindswap.pellet.KnowledgeBase.classify(KnowledgeBase.java:2083)
at org.mindswap.pellet.KnowledgeBase.realize(KnowledgeBase.java:2111)

I use the rolification of a class in order to increase the performance of the reasoning process. The following model (functional syntax) may be used to reproduce the error:



DLSafeRule(Body(ObjectPropertyAtom(http://www.semanticweb.org/ontologies/2014/3/untitled-ontology-215#R_Instant Variable(urn:swrl#x) Variable(urn:swrl#x)) ObjectPropertyAtom(http://www.semanticweb.org/ontologies/2014/3/untitled-ontology-215#R_Instant Variable(urn:swrl#z) Variable(urn:swrl#z)) DataPropertyAtom(http://www.w3.org/2006/time#inXSDDateTime Variable(urn:swrl#x) Variable(urn:swrl#y)) DataPropertyAtom(http://www.w3.org/2006/time#inXSDDateTime Variable(urn:swrl#z) Variable(urn:swrl#w)) BuiltInAtom(http://www.w3.org/2003/11/swrlb#lessThan Variable(urn:swrl#y) Variable(urn:swrl#w)))Head(ObjectPropertyAtom(http://www.w3.org/2006/time#before Variable(urn:swrl#x) Variable(urn:swrl#z))))
)

There seems to be an related issue which was fixed several years ago, see [1]. This however only seems to work for one atom like p(?x, ?x) in context of an swrl rule.

I also filed an issue at github (see [2]) not being aware of this list. Thank you for your efforts.

Greetings,
Christian


Evren Sirin

unread,
Apr 15, 2014, 8:50:16 AM4/15/14
to Christian-D, pellet...@googlegroups.com
Thanks a lot for the detailed report. I'll be making some changes to
the rule engine soon and I'll look at this issue in more detail.

Best,
Evren
> --
> You received this message because you are subscribed to the Google Groups
> "Pellet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pellet-users...@googlegroups.com.
> To post to this group, send email to pellet...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pellet-users/c1b0b467-d95f-404d-ba22-1235b371aaf5%40googlegroups.com.

Christian-D

unread,
Apr 15, 2014, 9:21:12 AM4/15/14
to pellet...@googlegroups.com, Christian-D
Hello Evren,

Thank you. I noticed that in getVarPermutation() of BetaNode the duplicate variables of the field joinVars are removed while the vars field keeps the duplicates. This at least leads to a mismatch regarding the arrays length in case of the rules I mentioned. When I did a first try to remove the duplicate entries in vars at a central place (TermTuple.getVars()) in my local version of the pellet library, I was able to successfully compute the inferences. However the performance was actually slower by factor 2 than using the class membership in context of the rule (meaning switching back to Instant(?x) instead of R_Instant(?x, ?x)). As I am not very familiar with your codebase and cannot entirely estimate the side effects I suppose my "fix" is not the right way to address this problem. I am looking forward to your findings.

Greetings
Christian
Reply all
Reply to author
Forward
0 new messages