Hello everybody,
In context of my model I encountered a problem using propertychains in combination with incremental reasoning. My ontology contains the following property chain:
SubObjectPropertyOf(ObjectPropertyChain(:R_ProperInterval time:hasEnd ObjectInverseOf(timeEvents:equals) ObjectInverseOf(time:hasEnd) :R_ProperInterval) :hasSameEnd)
This basically states that two proper intervals (from the W3C time ontolgy [1], class membership is indicated using the object property R_ProperInterval) sharing the same end (using the equals property from [2] to compare dateTime values) get connected by the object property hasSameEnd.
When loading the model for the first time using the OWL-API and pellet, the axioms for the property hasSameEnd are inferred correctly when realizing the knowledgebase. However, during this reasoning process the individuals affected by this property chain within the abox of the pellet knowledge base get types like this:
Now when the allValues types of the individuals are checked at a later stage during the same runtime, they lead to errors as their role is of ATermList and not of type ATermAppl:
Exception in thread "main" java.lang.ClassCastException: aterm.pure.ATermListImpl cannot be cast to aterm.ATermAppl
at com.clarkparsia.pellet.expressivity.DLExpressivityChecker$Visitor.visitAll(DLExpressivityChecker.java:202)
at org.mindswap.pellet.output.ATermBaseVisitor.visit(ATermBaseVisitor.java:79)
at com.clarkparsia.pellet.expressivity.DLExpressivityChecker.processIndividuals(DLExpressivityChecker.java:86)
at com.clarkparsia.pellet.expressivity.DLExpressivityChecker.compute(DLExpressivityChecker.java:58)
at com.clarkparsia.pellet.expressivity.ExpressivityChecker.prepare(ExpressivityChecker.java:56)
at org.mindswap.pellet.KnowledgeBase.prepare(KnowledgeBase.java:1820)
at org.mindswap.pellet.KnowledgeBase.consistency(KnowledgeBase.java:1969)
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)
at org.mindswap.pellet.KnowledgeBase.getTypes(KnowledgeBase.java:3336)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.getTypes(PelletReasoner.java:820)
This error can also be experienced in the Protege 4.3 editor using either the incremental mode of pellet or the "synchronize reasoner" option after changing something in the model. The only way around this issue at the moment is to manually call PelletReasoner.refresh() each time when changing the ontology.
I was able to track down the cause for this issue to the "applyAllValuesPropertyChain" function (see the callstack below).
Individual.addType(ATermAppl, DependencySet, boolean) line: 226
Individual.addType(ATermAppl, DependencySet) line: 222
ContinuousRulesStrategy(CompletionStrategy).addType(Node, ATermAppl, DependencySet) line: 438
ContinuousRulesStrategy.addType(Node, ATermAppl, DependencySet) line: 95
AllValuesRule.applyAllValues(Individual, Role, Node, ATermAppl, DependencySet) line: 175
AllValuesRule.applyAllValuesPropertyChain(Individual, ATermList, ATermAppl, DependencySet) line: 154
AllValuesRule.applyAllValues(Individual, ATermAppl, DependencySet) line: 130
ContinuousRulesStrategy(CompletionStrategy).addType(Node, ATermAppl, DependencySet) line: 469
ContinuousRulesStrategy.addType(Node, ATermAppl, DependencySet) line: 95
RuleAtomAsserter.addEdge(ATermAppl, ATermAppl, ATermAppl) line: 102
RuleAtomAsserter.visit(IndividualPropertyAtom) line: 135
IndividualPropertyAtom.accept(RuleAtomVisitor) line: 37
RuleAtomAsserter.assertAtom(RuleAtom, VariableBinding, DependencySet, boolean, ABox, CompletionStrategy) line: 73
RuleBranch.tryBranch() line: 149
RuleBranch(Branch).tryNext() line: 117
ContinuousRulesStrategy.createDisjunctionsFromBinding(VariableBinding, Rule, DependencySet) line: 433
ContinuousRulesStrategy.applyRuleBindings() line: 224
ContinuousRulesStrategy.complete(Expressivity) line: 331
ABox.isConsistent(Collection<ATermAppl>, ATermAppl, boolean) line: 1423
ABox.isConsistent() line: 1260
KnowledgeBase.consistency() line: 1987
KnowledgeBase.isConsistent() line: 2061
KnowledgeBase.ensureConsistency() line: 2075
KnowledgeBase.classify() line: 2083
KnowledgeBase.realize() line: 2111
The type added to the individual is constructed calling
ATermUtils.makeAllValues( chain.getNext(), c );
As the ATermList representing the property chain has a length greater than 1, the first argument of the function application remains of type ATermList. However only arguments of type ATermAppl are valid in context of DLExpressivityChecker.java:202.
Is if this is a known issue? In the archives [3] I found a related report but unfortunately no feedback. It would be very valuable for me to take advantage of incremental reasoning in the application I am building on top of my model.As I am normally not modifying the internals of pellet, feedback on the correctness of my analysis and hints regarding options to fix this would be very helpful. Depending on the schedule for bugfixes and maintenance for pellet version 2.3 I consider a local fix, which maybe can be incorporated at a later stage. I guess the focus at C&P is currently on Stardog/Pellet3 (please correct me if I am wrong)?
Any feedback would be greatly appreciated. If further information is required, please ask for it. Thank you for your efforts.
Greetings,
Christian
[2] Σ. Μπατσάκης, “SOWL: a framework for handling spatio-temporal information in OWL,” 2011.