public void visit(P_FixedLength pFixedLength) { // P_Mod(path, count, count) // One step. Iterator<Node> iter = eval(graph, node, pFixedLength.getSubPath(), forwardMode) ; long count2 = dec(pFixedLength.getCount()) ; P_FixedLength nextPath = new P_FixedLength(pFixedLength.getSubPath(), count2) ; for ( ; iter.hasNext() ; ) { Node n2 = iter.next() ; Iterator<Node> iter2 = eval(graph, n2, nextPath, forwardMode) ; fill(iter2) ; } }
@Override public void visit(P_FixedLength pFixedLength) { engine.doFixedLengthPath(pFixedLength.getSubPath(), node, pFixedLength.getCount(), output) ; }
public static Path pathFixedLength(Path path, long count) { return new P_FixedLength(path, count) ; } public static Path pathDistinct(Path path) { return new P_Distinct(path) ; }
@Override public int hashCode() { return hashFixedLength ^ (int)count ^ getSubPath().hashCode() ; }
@Override public void visit(P_FixedLength pFixedLength) { Op op = null ; Var v1 = null ; for ( int i = 0 ; i < pFixedLength.getCount() ; i++ ) { Var v2 = varAlloc.allocVar() ; Node s = (v1 == null) ? subject : v1 ; Node o = (i == pFixedLength.getCount()-1) ? object : v2 ; Op op1 = transformPath(null, s, pFixedLength.getSubPath() , o) ; op = join(op, op1) ; v1 = v2 ; } result = op ; }
public static Path pathFixedLength(Path path, long count) { return new P_FixedLength(path, count) ; }
@Override public int hashCode() { return hashFixedLength ^ (int)count ^ getSubPath().hashCode() ; }
public void visit(P_FixedLength path) { out.print("(") ; out.print(Tags.tagPathFixedLength) ; out.print(" ") ; out.print(modInt(path.getCount())) ; writeOneLiner(path.getSubPath()) ; out.print(")") ; }
public void visit(P_FixedLength pFixedLength) { if ( pFixedLength.getCount() == 0 ) { output.add(node) ; return ; } // P_Mod(path, count, count) // One step. Iterator<Node> iter = eval(graph, node, pFixedLength.getSubPath(), forwardMode) ; long count2 = dec(pFixedLength.getCount()) ; P_FixedLength nextPath = new P_FixedLength(pFixedLength.getSubPath(), count2) ; for ( ; iter.hasNext() ; ) { Node n2 = iter.next() ; Iterator<Node> iter2 = eval(graph, n2, nextPath, forwardMode) ; fill(iter2) ; } }
@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(graph, pathStep, node) ; // Build a path for all remaining steps. long count2 = dec(fixedLength) ; P_FixedLength nextPath = new P_FixedLength(pathStep, count2) ; // For each element in the first step, do remaining step // Accumulate across everything from first step. for ( ; iter.hasNext() ; ) { Node n2 = iter.next() ; Iterator<Node> iter2 = eval(graph, nextPath, n2) ; fill(iter2, output) ; } }
@Override public boolean equalTo(Path path2, NodeIsomorphismMap isoMap) { if ( ! ( path2 instanceof P_FixedLength ) ) return false ; P_FixedLength other = (P_FixedLength)path2 ; return other.count == count && getSubPath().equalTo(other.getSubPath(), isoMap) ; }
@Override public void visit(P_FixedLength path) { out.print("(") ; out.print(Tags.tagPathFixedLength) ; out.print(" ") ; out.print(modInt(path.getCount())) ; writeOneLiner(path.getSubPath()) ; out.print(")") ; }
@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(graph, pathStep, node) ; // Build a path for all remaining steps. long count2 = dec(fixedLength) ; P_FixedLength nextPath = new P_FixedLength(pathStep, count2) ; // For each element in the first step, do remaining step // Accumulate across everything from first step. for ( ; iter.hasNext() ; ) { Node n2 = iter.next() ; Iterator<Node> iter2 = eval(graph, nextPath, n2) ; fill(iter2, output) ; } }
@Override public boolean equalTo(Path path2, NodeIsomorphismMap isoMap) { if ( ! ( path2 instanceof P_FixedLength ) ) return false ; P_FixedLength other = (P_FixedLength)path2 ; return other.count == count && getSubPath().equalTo(other.getSubPath(), isoMap) ; }
public void visit(P_FixedLength pFixedLength) { if ( needParens ) out.print("(") ; if ( alwaysInnerParens ) out.print("(") ; pFixedLength.getSubPath().visit(this) ; if ( alwaysInnerParens ) out.print(")") ; out.print("{") ; out.print(Long.toString(pFixedLength.getCount())) ; out.print("}") ; if ( needParens ) out.print(")") ; }
public Path make(ItemList list) { BuilderLib.checkLength(3, 3, list, "path fixed repeat: wanted 2 arguments") ; long count = modInt(list.get(1)) ; Path path = build(list, 2) ; return new P_FixedLength(path, count) ; } } ;
@Override public void visit(P_FixedLength pFixedLength) { if ( needParens ) out.print("(") ; if ( alwaysInnerParens ) out.print("(") ; pFixedLength.getSubPath().visit(this) ; if ( alwaysInnerParens ) out.print(")") ; out.print("{") ; out.print(Long.toString(pFixedLength.getCount())) ; out.print("}") ; if ( needParens ) out.print(")") ; }
@Override public Path make(ItemList list) { BuilderLib.checkLength(3, 3, list, "path fixed repeat: wanted 2 arguments") ; long count = modInt(list.get(1)) ; Path path = build(list, 2) ; return new P_FixedLength(path, count) ; } } ;
long N = pFixed.getCount() ; if ( N > 0 ) reduce(x, varAlloc, stepStart, pFixed.getSubPath(), v) ; stepStart = v ; reduce(x, varAlloc, stepStart, pFixed.getSubPath(), endNode) ; return ;
long N = pFixed.getCount() ; if ( N > 0 ) reduce(x, varAlloc, stepStart, pFixed.getSubPath(), v) ; stepStart = v ; reduce(x, varAlloc, stepStart, pFixed.getSubPath(), endNode) ; return ;