use of org.eclipse.rdf4j.query.algebra.ValueConstant in project rdf4j by eclipse.
the class UpdateExprBuilder method visit.
@Override
public Move visit(ASTMove node, Object data) throws VisitorException {
Move move = new Move();
move.setSilent(node.isSilent());
ASTGraphOrDefault sourceNode = (ASTGraphOrDefault) node.jjtGetChild(0);
if (sourceNode.jjtGetNumChildren() > 0) {
ValueConstant sourceGraph = (ValueConstant) sourceNode.jjtGetChild(0).jjtAccept(this, data);
move.setSourceGraph(sourceGraph);
}
ASTGraphOrDefault destinationNode = (ASTGraphOrDefault) node.jjtGetChild(1);
if (destinationNode.jjtGetNumChildren() > 0) {
ValueConstant destinationGraph = (ValueConstant) destinationNode.jjtGetChild(0).jjtAccept(this, data);
move.setDestinationGraph(destinationGraph);
}
return move;
}
use of org.eclipse.rdf4j.query.algebra.ValueConstant in project rdf4j by eclipse.
the class UpdateExprBuilder method visit.
@Override
public Clear visit(ASTDrop node, Object data) throws VisitorException {
// implementing drop as a synonym of clear, in Sesame this is really the
// same thing, as empty
// graphs are not recorded.
Clear clear = new Clear();
clear.setSilent(node.isSilent());
ASTGraphRefAll graphRef = node.jjtGetChild(ASTGraphRefAll.class);
if (graphRef.jjtGetNumChildren() > 0) {
ValueConstant graph = (ValueConstant) graphRef.jjtGetChild(0).jjtAccept(this, data);
clear.setGraph(graph);
} else {
if (graphRef.isDefault()) {
clear.setScope(Scope.DEFAULT_CONTEXTS);
} else if (graphRef.isNamed()) {
clear.setScope(Scope.NAMED_CONTEXTS);
}
}
return clear;
}
use of org.eclipse.rdf4j.query.algebra.ValueConstant in project rdf4j by eclipse.
the class UpdateExprBuilder method visit.
@Override
public Add visit(ASTAdd node, Object data) throws VisitorException {
Add add = new Add();
add.setSilent(node.isSilent());
ASTGraphOrDefault sourceNode = (ASTGraphOrDefault) node.jjtGetChild(0);
if (sourceNode.jjtGetNumChildren() > 0) {
ValueConstant sourceGraph = (ValueConstant) sourceNode.jjtGetChild(0).jjtAccept(this, data);
add.setSourceGraph(sourceGraph);
}
ASTGraphOrDefault destinationNode = (ASTGraphOrDefault) node.jjtGetChild(1);
if (destinationNode.jjtGetNumChildren() > 0) {
ValueConstant destinationGraph = (ValueConstant) destinationNode.jjtGetChild(0).jjtAccept(this, data);
add.setDestinationGraph(destinationGraph);
}
return add;
}
use of org.eclipse.rdf4j.query.algebra.ValueConstant in project rdf4j by eclipse.
the class UpdateExprBuilder method visit.
@Override
public Load visit(ASTLoad node, Object data) throws VisitorException {
ValueConstant source = (ValueConstant) node.jjtGetChild(0).jjtAccept(this, data);
Load load = new Load(source);
load.setSilent(node.isSilent());
if (node.jjtGetNumChildren() > 1) {
ValueConstant graph = (ValueConstant) node.jjtGetChild(1).jjtAccept(this, data);
load.setGraph(graph);
}
return load;
}
use of org.eclipse.rdf4j.query.algebra.ValueConstant in project rdf4j by eclipse.
the class TupleExprBuilder method visit.
@Override
public Object visit(ASTFunctionCall node, Object data) throws VisitorException {
ValueConstant uriNode = (ValueConstant) node.jjtGetChild(0).jjtAccept(this, null);
IRI functionURI = (IRI) uriNode.getValue();
FunctionCall functionCall = new FunctionCall(functionURI.toString());
for (int i = 1; i < node.jjtGetNumChildren(); i++) {
Node argNode = node.jjtGetChild(i);
functionCall.addArg((ValueExpr) argNode.jjtAccept(this, null));
}
return functionCall;
}
Aggregations