use of org.eclipse.rdf4j.query.algebra.ListMemberOperator in project rdf4j by eclipse.
the class TupleExprBuilder method visit.
@Override
public ValueExpr visit(ASTIn node, Object data) throws VisitorException {
ValueExpr result = null;
ValueExpr leftArg = (ValueExpr) data;
int listItemCount = node.jjtGetNumChildren();
if (listItemCount == 0) {
result = new ValueConstant(BooleanLiteral.FALSE);
} else if (listItemCount == 1) {
ValueExpr arg = (ValueExpr) node.jjtGetChild(0).jjtAccept(this, null);
result = new Compare(leftArg, arg, CompareOp.EQ);
} else {
ListMemberOperator listMemberOperator = new ListMemberOperator();
listMemberOperator.addArgument(leftArg);
for (int i = 0; i < listItemCount; i++) {
ValueExpr arg = (ValueExpr) node.jjtGetChild(i).jjtAccept(this, null);
listMemberOperator.addArgument(arg);
}
result = listMemberOperator;
}
return result;
}
Aggregations