/** * Check whether any solution for the {@link StatementPattern} could be derived from * reflexive property inference, and if so, replace the pattern with a union of itself and the * reflexive solution. */ @Override protected void meetSP(StatementPattern node) throws Exception { // Only applies when the predicate is defined and reflexive final Var predVar = node.getPredicateVar(); if (predVar.getValue() != null && inferenceEngine.isReflexiveProperty((URI) predVar.getValue())) { final StatementPattern originalSP = node.clone(); // The reflexive solution is a ZeroLengthPath between subject and // object: they can be matched to one another, whether constants or // variables. final Var subjVar = node.getSubjectVar(); final Var objVar = node.getObjectVar(); final ZeroLengthPath reflexiveSolution = new ZeroLengthPath(subjVar, objVar); node.replaceWith(new InferUnion(originalSP, reflexiveSolution)); } } }
return new ZeroLengthPath(scope, subjVar, endVar, contextVar); return new ZeroLengthPath(scope, subjVar, endVar, contextVar);
ZeroLengthPath zlp = new ZeroLengthPath(scope, startVar, endVar, contextVar); currentIter = this.evaluationStrategyImpl.evaluate(zlp, bindings); currentLength++;