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

IndexOutOfBoundsException in BetaNode.java for rules with multiple atoms like p(?x,?x), p(?y, ?y) #4

Open
Christian-D opened this issue Apr 8, 2014 · 1 comment

Comments

@Christian-D
Copy link

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)

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

Prefix(owl:=http://www.w3.org/2002/07/owl#)
Prefix(rdf:=http://www.w3.org/1999/02/22-rdf-syntax-ns#)
Prefix(xml:=http://www.w3.org/XML/1998/namespace)
Prefix(xsd:=http://www.w3.org/2001/XMLSchema#)
Prefix(rdfs:=http://www.w3.org/2000/01/rdf-schema#)

Ontology(http://www.semanticweb.org/ontologies/2014/3/untitled-ontology-215
Import(http://www.w3.org/2006/time)

EquivalentClasses(http://www.w3.org/2006/time#Instant ObjectHasSelf(http://www.semanticweb.org/ontologies/2014/3/untitled-ontology-215#R_Instant))
Declaration(ObjectProperty(http://www.semanticweb.org/ontologies/2014/3/untitled-ontology-215#R_Instant))
Declaration(NamedIndividual(http://www.semanticweb.org/ontologies/2014/3/untitled-ontology-215#Instant1))
ClassAssertion(http://www.w3.org/2006/time#Instant http://www.semanticweb.org/ontologies/2014/3/untitled-ontology-215#Instant1)
DataPropertyAssertion(http://www.w3.org/2006/time#inXSDDateTime http://www.semanticweb.org/ontologies/2014/3/untitled-ontology-215#Instant1 "2000-01-01T00:00:00"^^xsd:dateTime)
Declaration(NamedIndividual(http://www.semanticweb.org/ontologies/2014/3/untitled-ontology-215#Instant2))
ClassAssertion(http://www.w3.org/2006/time#Instant http://www.semanticweb.org/ontologies/2014/3/untitled-ontology-215#Instant2)
DataPropertyAssertion(http://www.w3.org/2006/time#inXSDDateTime http://www.semanticweb.org/ontologies/2014/3/untitled-ontology-215#Instant2 "2003-01-01T00:00:00"^^xsd:dateTime)
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))))
)

@Christian-D
Copy link
Author

I found this related ticket: https://clark-parsia.trac.cvsdude.com/pellet-devel/ticket/382 . The fix (I suppose it is the if-condition at lines 118-119 of the BetaNode class ?) works for one expression like p(?x, ?x), but two or more will fail. Maybe these lines may need to be revised when considering a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant