use of org.apache.jena.sparql.path.P_FixedLength in project jena by apache.
the class PathEngineSPARQL method doFixedLengthPath.
@Override
protected void doFixedLengthPath(Path pathStep, Node node, long fixedLength, Collection<Node> output) {
// Not SPARQL
if (fixedLength == 0) {
output.add(node);
return;
}
// P_Mod(path, count, count)
// One step.
Iterator<Node> iter = eval(pathStep, node);
// Build a path for all remaining steps.
long count2 = dec(fixedLength);
P_FixedLength nextPath = new P_FixedLength(pathStep, count2);
// Accumulate across everything from first step.
for (; iter.hasNext(); ) {
Node n2 = iter.next();
Iterator<Node> iter2 = eval(nextPath, n2);
fill(iter2, output);
}
}
use of org.apache.jena.sparql.path.P_FixedLength in project jena by apache.
the class PathEngineN method doFixedLengthPath.
@Override
protected void doFixedLengthPath(Path pathStep, Node node, long fixedLength, Collection<Node> output) {
if (fixedLength == 0) {
output.add(node);
return;
}
// P_Mod(path, count, count)
// One step.
Iterator<Node> iter = eval(pathStep, node);
// Build a path for all remaining steps.
long count2 = dec(fixedLength);
P_FixedLength nextPath = new P_FixedLength(pathStep, count2);
// Accumulate across everything from first step.
for (; iter.hasNext(); ) {
Node n2 = iter.next();
Iterator<Node> iter2 = eval(nextPath, n2);
fill(iter2, output);
}
}
Aggregations