while (it.hasNext()) {
final Triple t = it.next();
BasicOperator lastOperator = union;
for (int i = 0; i < 3; i++) {
if (tp.getPos(i).isVariable()) {
final AddBinding add = new AddBinding(
(Variable) tp.getPos(i), t
.getPos(i));
add
.addSucceedingOperator(new OperatorIDTuple(
lastOperator, 0));
// Not completely correct, but for
// the succeeding optimization steps
// enough!
add
.setUnionVariables((HashSet<Variable>) tp
.getVariables().clone());
add.setIntersectionVariables(add
.getUnionVariables());
lastOperator.addPrecedingOperator(add);
lastOperator = add;
}
}