this.equalities = equality;
}
@Override
public QueryResult process(QueryResult queryResult, int operandID) {
final EqualityResult eqResult = new EqualityResult();
final Iterator<Bindings> it = queryResult.oneTimeIterator();
while (it.hasNext()) {
replace.bindings = it.next();
for (final Equality nextEq : equalities) {
final Equality replacedEq = (Equality) nextEq.accept(replace,
null);
// Externals in Equality auswerten
if (replacedEq.leftExpr instanceof External) {
final Literal evaluated = (Literal) replacedEq.leftExpr
.evaluate(replace.bindings, null, equalityMap);
replacedEq.leftExpr = new Constant(evaluated, replacedEq);
}
if (replacedEq.rightExpr instanceof External) {
final Literal evaluated = (Literal) replacedEq.rightExpr
.evaluate(replace.bindings, null, equalityMap);
replacedEq.rightExpr = new Constant(evaluated, replacedEq);
}
eqResult.getEqualityResult().add(replacedEq);
equalityMap.put(replacedEq.leftExpr, replacedEq.rightExpr);
equalityMap.put(replacedEq.rightExpr, replacedEq.leftExpr);
}
}
return eqResult;