public static Path pathSeq(Path path1, Path path2) { return new P_Seq(path1, path2) ; }
public static Path toPropertyPath(SimplePath path) { org.apache.jena.sparql.path.Path result = null; List<P_Path0> steps = path.getSteps(); for(int i = 0; i < steps.size(); ++i) { P_Path0 contrib = steps.get(i); //org.apache.jena.sparql.path.Path contrib = step;//toJena(step); result = result == null ? contrib : new P_Seq(result, contrib); } return result; }
public static Path toSparqlPath(List<P_Path0> steps) { return ExprUtils.<Path>opifyBalanced(steps, (a, b) -> new P_Seq(a, b)); //return ExprUtils.opifyBalanced(steps, P_Seq::new); }
@Override public Path transform(P_Seq path, Path left, Path right) { Path result = path.getLeft() == left && path.getRight() == right ? path : new P_Seq(left, right) ; return result; } }
@Override public Path make(ItemList list) { BuilderLib.checkLength(3, 3, list, "path seq: wanted 2 arguments") ; Path left = build(list, 1) ; Path right = build(list, 2) ; return new P_Seq(left, right) ; } };
@Override public void visit(P_Seq path) { Path newLeft = apply(path.getLeft()); Path newRight = apply(path.getRight()); result = path.getLeft() == newLeft && path.getRight() == newRight ? path : new P_Seq(newLeft, newRight) ; } }
@Override public void visit(P_Seq pathSeq) { pathSeq.getRight().visit(this); pathSeq.getLeft().visit(this); push(new P_Seq(pop(), pop())); }
@Override public void visit(P_Seq pathSeq) { pathSeq.getRight().visit(this); pathSeq.getLeft().visit(this); push(new P_Seq(pop(), pop())); }