/** * @inheritDoc */ @Override public void meet(Union theOp) throws Exception { binaryOpMeet(theOp, theOp.getLeftArg(), theOp.getRightArg()); }
@Override public void meet(Union union) { super.meet(union); TupleExpr leftArg = union.getLeftArg(); TupleExpr rightArg = union.getRightArg(); if (leftArg instanceof Join && rightArg instanceof Join) { Join leftJoinArg = (Join)leftArg; Join rightJoin = (Join)rightArg; if (leftJoinArg.getLeftArg().equals(rightJoin.getLeftArg())) { // factor out the left-most join argument Join newJoin = new Join(); union.replaceWith(newJoin); newJoin.setLeftArg(leftJoinArg.getLeftArg()); newJoin.setRightArg(union); union.setLeftArg(leftJoinArg.getRightArg()); union.setRightArg(rightJoin.getRightArg()); union.visit(this); } } } }
@Override public void meet(Union union) { super.meet(union); TupleExpr leftArg = union.getLeftArg(); TupleExpr rightArg = union.getRightArg(); if (leftArg instanceof EmptySet) { union.replaceWith(rightArg); } else if (rightArg instanceof EmptySet) { union.replaceWith(leftArg); } else if (leftArg instanceof SingletonSet && rightArg instanceof SingletonSet) { union.replaceWith(leftArg); } }
@Override public void meet(final Union node) throws QueryRulesetException { node.visitChildren(this); if (node instanceof InferUnion) { node.getLeftArg().visit(propertyVisitor); node.getRightArg().visit(propertyVisitor);
Union union = new Union(); Union currentUnion = union; for (int i = 0; i < altCount - 1; i++) { pathAltNode.jjtGetChild(i).jjtAccept(this, data); TupleExpr arg = graphPattern.buildTupleExpr(); currentUnion.setLeftArg(arg); if (i == altCount - 2) { // second-to-last item graphPattern = new GraphPattern(parentGP); pathAltNode.jjtGetChild(i + 1).jjtAccept(this, data); arg = graphPattern.buildTupleExpr(); currentUnion.setRightArg(arg); Union newUnion = new Union(); currentUnion.setRightArg(newUnion); currentUnion = newUnion;
Join leftJoin = new Join(union.getLeftArg(), rightArg.clone()); Join rightJoin = new Join(union.getRightArg(), rightArg.clone()); Union newUnion = new Union(leftJoin, rightJoin); join.replaceWith(newUnion); newUnion.visit(this); Join leftJoin = new Join(leftArg.clone(), union.getLeftArg()); Join rightJoin = new Join(leftArg.clone(), union.getRightArg()); Union newUnion = new Union(leftJoin, rightJoin); join.replaceWith(newUnion); newUnion.visit(this);
Union union = new Union(); Union currentUnion = union; currentUnion.setLeftArg(path); if (length == upperBound - 1) { path = createPath(scope, subjVar, te, endVar, contextVar, length + 1); currentUnion.setRightArg(path); Union nextUnion = new Union(); currentUnion.setRightArg(nextUnion); currentUnion = nextUnion; for (String name : union.getAssuredBindingNames()) { ProjectionElem pe = new ProjectionElem(name); pelist.addElement(pe);
@Override public Object visit(ASTPathExprUnion node, Object data) throws VisitorException { Iterator<ASTPathExpr> args = node.getPathExprList().iterator(); // Create new sub-graph pattern for optional path expressions TupleExpr unionExpr = parseGraphPattern(args.next()).buildTupleExpr(); while (args.hasNext()) { TupleExpr argExpr = parseGraphPattern(args.next()).buildTupleExpr(); unionExpr = new Union(unionExpr, argExpr); } graphPattern.addRequiredTE(unionExpr); return null; }
Var subjVar = sp.getSubjectVar(); Union union = new InferUnion(); union.setLeftArg(sp); union.setRightArg(new StatementPattern(objVar, predVar, subjVar, cntxtVar)); node.replaceWith(union);
@Override protected Iteration<BindingSet, QueryEvaluationException> createIteration() throws QueryEvaluationException { return evaluate(union.getRightArg(), bindings); } };
@Override protected Iteration<BindingSet, QueryEvaluationException> createIteration() throws QueryEvaluationException { return evaluate(union.getLeftArg(), bindings); } };
Union union = new Union(); Union currentUnion = union; for (int i = 0; i < altCount - 1; i++) { pathAltNode.jjtGetChild(i).jjtAccept(this, data); TupleExpr arg = graphPattern.buildTupleExpr(); currentUnion.setLeftArg(arg); if (i == altCount - 2) { // second-to-last item graphPattern = new GraphPattern(parentGP); pathAltNode.jjtGetChild(i + 1).jjtAccept(this, data); arg = graphPattern.buildTupleExpr(); currentUnion.setRightArg(arg); Union newUnion = new Union(); currentUnion.setRightArg(newUnion); currentUnion = newUnion;
@Override public void meet(Union union) { super.meet(union); TupleExpr leftArg = union.getLeftArg(); TupleExpr rightArg = union.getRightArg(); if (leftArg instanceof EmptySet) { union.replaceWith(rightArg); } else if (rightArg instanceof EmptySet) { union.replaceWith(leftArg); } else if (leftArg instanceof SingletonSet && rightArg instanceof SingletonSet) { union.replaceWith(leftArg); } }
Join leftJoin = new Join(union.getLeftArg(), rightArg.clone()); Join rightJoin = new Join(union.getRightArg(), rightArg.clone()); Union newUnion = new Union(leftJoin, rightJoin); join.replaceWith(newUnion); newUnion.visit(this); Join leftJoin = new Join(leftArg.clone(), union.getLeftArg()); Join rightJoin = new Join(leftArg.clone(), union.getRightArg()); Union newUnion = new Union(leftJoin, rightJoin); join.replaceWith(newUnion); newUnion.visit(this);
Union union = new Union(); Union currentUnion = union; currentUnion.setLeftArg(path); if (length == upperBound - 1) { path = createPath(scope, subjVar, te, endVar, contextVar, length + 1); currentUnion.setRightArg(path); Union nextUnion = new Union(); currentUnion.setRightArg(nextUnion); currentUnion = nextUnion; for (String name : union.getAssuredBindingNames()) { ProjectionElem pe = new ProjectionElem(name); pelist.addElement(pe);
@Override public Object visit(ASTPathExprUnion node, Object data) throws VisitorException { Iterator<ASTPathExpr> args = node.getPathExprList().iterator(); // Create new sub-graph pattern for optional path expressions TupleExpr unionExpr = parseGraphPattern(args.next()).buildTupleExpr(); while (args.hasNext()) { TupleExpr argExpr = parseGraphPattern(args.next()).buildTupleExpr(); unionExpr = new Union(unionExpr, argExpr); } graphPattern.addRequiredTE(unionExpr); return null; }
Var subjVar = sp.getSubjectVar(); Union union = new InferUnion(); union.setLeftArg(sp); union.setRightArg(new StatementPattern(objVar, new Var(predVar.getName(), invPropIri), subjVar, cntxtVar)); node.replaceWith(union);
@Override protected Iteration<BindingSet, QueryEvaluationException> createIteration() throws QueryEvaluationException { return evaluate(union.getRightArg(), bindings); } };
@Override protected Iteration<BindingSet, QueryEvaluationException> createIteration() throws QueryEvaluationException { return evaluate(union.getLeftArg(), bindings); } };
/** * @inheritDoc */ @Override public void meet(Union theOp) throws Exception { binaryOpMeet(theOp, theOp.getLeftArg(), theOp.getRightArg()); }