@Override protected Iteration<BindingSet, QueryEvaluationException> createIteration() throws QueryEvaluationException { return evaluate(union.getLeftArg(), bindings); } };
@Override protected Iteration<BindingSet, QueryEvaluationException> createIteration() throws QueryEvaluationException { return evaluate(union.getLeftArg(), bindings); } };
@Override public Set<String> getAssuredBindingNames() { Set<String> bindingNames = new LinkedHashSet<>(16); bindingNames.addAll(getLeftArg().getAssuredBindingNames()); bindingNames.retainAll(getRightArg().getAssuredBindingNames()); return bindingNames; }
@Override public Set<String> getBindingNames() { Set<String> bindingNames = new LinkedHashSet<>(16); bindingNames.addAll(getLeftArg().getBindingNames()); bindingNames.addAll(getRightArg().getBindingNames()); return bindingNames; }
/** * @inheritDoc */ @Override public void meet(Union theOp) throws Exception { String aLeft = renderTupleExpr(theOp.getLeftArg()); String aRight = renderTupleExpr(theOp.getRightArg()); mBuffer.append(aLeft).append("\nunion\n").append(aRight); }
/** * @inheritDoc */ @Override public void meet(Union theOp) throws Exception { String aLeft = renderTupleExpr(theOp.getLeftArg()); String aRight = renderTupleExpr(theOp.getRightArg()); mBuffer.append(aLeft).append("\nunion\n").append(aRight); }
public Set<String> getBindingNames() { Set<String> bindingNames = new LinkedHashSet<String>(16); bindingNames.addAll(getLeftArg().getBindingNames()); bindingNames.addAll(getRightArg().getBindingNames()); return bindingNames; }
public Set<String> getAssuredBindingNames() { Set<String> bindingNames = new LinkedHashSet<String>(16); bindingNames.addAll(getLeftArg().getAssuredBindingNames()); bindingNames.retainAll(getRightArg().getAssuredBindingNames()); return bindingNames; }
/** * @inheritDoc */ @Override public void meet(Union theOp) throws Exception { String aLeft = renderTupleExpr(theOp.getLeftArg()); String aRight = renderTupleExpr(theOp.getRightArg()); mBuffer.append(aLeft).append("\nunion\n").append(aRight); }
/** * @inheritDoc */ @Override public void meet(Union theOp) throws Exception { binaryOpMeet(theOp, theOp.getLeftArg(), theOp.getRightArg()); }
/** * @inheritDoc */ @Override public void meet(Union theOp) throws Exception { binaryOpMeet(theOp, theOp.getLeftArg(), theOp.getRightArg()); }
/** * @inheritDoc */ @Override public void meet(Union theOp) throws Exception { binaryOpMeet(theOp, theOp.getLeftArg(), theOp.getRightArg()); }
@Override public void meet(final Union union) { boolean filterMoved = false; if (Sets.intersection(union.getRightArg().getBindingNames(), filterVars).size() > 0) { relocate(filter, union.getRightArg()); filterMoved = true; } if (Sets.intersection(union.getLeftArg().getBindingNames(), filterVars).size() > 0) { if (filterMoved) { final Filter clone = new Filter(filter.getArg(), filter.getCondition().clone()); relocate(clone, union.getLeftArg()); } else { relocate(filter, union.getLeftArg()); } } }
@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(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(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(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(Union union) { Filter clone = new Filter(); clone.setCondition(filter.getCondition().clone()); relocate(filter, union.getLeftArg()); relocate(clone, union.getRightArg()); FilterRelocator.relocate(filter); FilterRelocator.relocate(clone); }
@Override public void meet(Union union) { Filter clone = new Filter(); clone.setCondition(filter.getCondition().clone()); relocate(filter, union.getLeftArg()); relocate(clone, union.getRightArg()); FilterRelocator.relocate(filter); FilterRelocator.relocate(clone); }
@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); } } } }