use of org.eclipse.rdf4j.query.algebra.ValueExpr in project rdf4j by eclipse.
the class GraphPattern method addOptionalTE.
public void addOptionalTE(GraphPattern gp) {
List<ValueExpr> constraints = gp.removeAllConstraints();
TupleExpr tupleExpr = gp.buildTupleExpr();
OptionalTupleExpr optTE;
if (constraints.isEmpty()) {
optTE = new OptionalTupleExpr(tupleExpr);
} else {
ValueExpr constraint = constraints.get(0);
for (int i = 1; i < constraints.size(); i++) {
constraint = new And(constraint, constraints.get(i));
}
optTE = new OptionalTupleExpr(tupleExpr, constraint);
}
optionalTEs.add(optTE);
}
use of org.eclipse.rdf4j.query.algebra.ValueExpr in project rdf4j by eclipse.
the class QueryModelBuilder method visit.
@Override
public Like visit(ASTLike node, Object data) throws VisitorException {
ValueExpr expr = (ValueExpr) node.getValueExpr().jjtAccept(this, null);
String pattern = (String) node.getPattern().jjtAccept(this, null);
boolean caseSensitive = !node.ignoreCase();
return new Like(expr, pattern, caseSensitive);
}
use of org.eclipse.rdf4j.query.algebra.ValueExpr in project rdf4j by eclipse.
the class QueryModelBuilder method visit.
@Override
public CompareAny visit(ASTCompareAny node, Object data) throws VisitorException {
ValueExpr valueExpr = (ValueExpr) node.getLeftOperand().jjtAccept(this, null);
TupleExpr tupleExpr = (TupleExpr) node.getRightOperand().jjtAccept(this, null);
CompareOp op = node.getOperator().getValue();
return new CompareAny(valueExpr, tupleExpr, op);
}
use of org.eclipse.rdf4j.query.algebra.ValueExpr in project rdf4j by eclipse.
the class QueryModelBuilder method visit.
@Override
public Compare visit(ASTCompare node, Object data) throws VisitorException {
ValueExpr leftArg = (ValueExpr) node.getLeftOperand().jjtAccept(this, null);
ValueExpr rightArg = (ValueExpr) node.getRightOperand().jjtAccept(this, null);
CompareOp operator = node.getOperator().getValue();
return new Compare(leftArg, rightArg, operator);
}
use of org.eclipse.rdf4j.query.algebra.ValueExpr in project rdf4j by eclipse.
the class QueryModelBuilder method visit.
@Override
public In visit(ASTIn node, Object data) throws VisitorException {
ValueExpr valueExpr = (ValueExpr) node.getLeftOperand().jjtAccept(this, null);
TupleExpr tupleExpr = (TupleExpr) node.getRightOperand().jjtAccept(this, null);
return new In(valueExpr, tupleExpr);
}
Aggregations