Search in sources :

Example 1 with ASTAdd

use of org.eclipse.rdf4j.query.parser.sparql.ast.ASTAdd 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;
}
Also used : Add(org.eclipse.rdf4j.query.algebra.Add) ASTAdd(org.eclipse.rdf4j.query.parser.sparql.ast.ASTAdd) ValueConstant(org.eclipse.rdf4j.query.algebra.ValueConstant) ASTGraphOrDefault(org.eclipse.rdf4j.query.parser.sparql.ast.ASTGraphOrDefault)

Aggregations

Add (org.eclipse.rdf4j.query.algebra.Add)1 ValueConstant (org.eclipse.rdf4j.query.algebra.ValueConstant)1 ASTAdd (org.eclipse.rdf4j.query.parser.sparql.ast.ASTAdd)1 ASTGraphOrDefault (org.eclipse.rdf4j.query.parser.sparql.ast.ASTGraphOrDefault)1