use of org.eclipse.rdf4j.query.algebra.Or in project rdf4j by eclipse.
the class TupleExprBuilder method visit.
@Override
public Or visit(ASTOr node, Object data) throws VisitorException {
ValueExpr leftArg = (ValueExpr) node.jjtGetChild(0).jjtAccept(this, null);
ValueExpr rightArg = (ValueExpr) node.jjtGetChild(1).jjtAccept(this, null);
return new Or(leftArg, rightArg);
}
use of org.eclipse.rdf4j.query.algebra.Or in project rdf4j by eclipse.
the class QueryModelBuilder method visit.
@Override
public ValueExpr visit(ASTInList node, Object data) throws VisitorException {
ValueExpr leftArg = (ValueExpr) node.getValueExpr().jjtAccept(this, null);
ValueExpr result = null;
for (ASTValueExpr argExpr : node.getArgList().getElements()) {
ValueExpr rightArg = (ValueExpr) argExpr.jjtAccept(this, null);
if (result == null) {
// First argument
result = new SameTerm(leftArg, rightArg);
} else {
SameTerm sameTerm = new SameTerm(leftArg.clone(), rightArg);
result = new Or(result, sameTerm);
}
}
assert result != null;
return result;
}
use of org.eclipse.rdf4j.query.algebra.Or in project rdf4j by eclipse.
the class QueryModelBuilder method visit.
@Override
public ValueExpr visit(ASTOr node, Object data) throws VisitorException {
Iterator<ASTBooleanExpr> iter = node.getOperandList().iterator();
ValueExpr result = (ValueExpr) iter.next().jjtAccept(this, null);
while (iter.hasNext()) {
ValueExpr operand = (ValueExpr) iter.next().jjtAccept(this, null);
result = new Or(result, operand);
}
return result;
}
Aggregations