Search in sources :

Example 1 with ASTGraphOrDefault

use of org.eclipse.rdf4j.query.parser.sparql.ast.ASTGraphOrDefault in project rdf4j by eclipse.

the class UpdateExprBuilder method visit.

@Override
public Copy visit(ASTCopy node, Object data) throws VisitorException {
    Copy copy = new Copy();
    copy.setSilent(node.isSilent());
    ASTGraphOrDefault sourceNode = (ASTGraphOrDefault) node.jjtGetChild(0);
    if (sourceNode.jjtGetNumChildren() > 0) {
        ValueConstant sourceGraph = (ValueConstant) sourceNode.jjtGetChild(0).jjtAccept(this, data);
        copy.setSourceGraph(sourceGraph);
    }
    ASTGraphOrDefault destinationNode = (ASTGraphOrDefault) node.jjtGetChild(1);
    if (destinationNode.jjtGetNumChildren() > 0) {
        ValueConstant destinationGraph = (ValueConstant) destinationNode.jjtGetChild(0).jjtAccept(this, data);
        copy.setDestinationGraph(destinationGraph);
    }
    return copy;
}
Also used : ASTCopy(org.eclipse.rdf4j.query.parser.sparql.ast.ASTCopy) Copy(org.eclipse.rdf4j.query.algebra.Copy) ValueConstant(org.eclipse.rdf4j.query.algebra.ValueConstant) ASTGraphOrDefault(org.eclipse.rdf4j.query.parser.sparql.ast.ASTGraphOrDefault)

Example 2 with ASTGraphOrDefault

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

Example 3 with ASTGraphOrDefault

use of org.eclipse.rdf4j.query.parser.sparql.ast.ASTGraphOrDefault 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

ValueConstant (org.eclipse.rdf4j.query.algebra.ValueConstant)3 ASTGraphOrDefault (org.eclipse.rdf4j.query.parser.sparql.ast.ASTGraphOrDefault)3 Add (org.eclipse.rdf4j.query.algebra.Add)1 Copy (org.eclipse.rdf4j.query.algebra.Copy)1 Move (org.eclipse.rdf4j.query.algebra.Move)1 ASTAdd (org.eclipse.rdf4j.query.parser.sparql.ast.ASTAdd)1 ASTCopy (org.eclipse.rdf4j.query.parser.sparql.ast.ASTCopy)1 ASTMove (org.eclipse.rdf4j.query.parser.sparql.ast.ASTMove)1