Search in sources :

Example 1 with ASTInsertClause

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

the class UpdateExprBuilder method visit.

@Override
public Modify visit(ASTModify node, Object data) throws VisitorException {
    ASTWhereClause whereClause = node.getWhereClause();
    TupleExpr where = null;
    if (whereClause != null) {
        where = (TupleExpr) whereClause.jjtAccept(this, data);
    }
    TupleExpr delete = null;
    ASTDeleteClause deleteNode = node.getDeleteClause();
    if (deleteNode != null) {
        delete = (TupleExpr) deleteNode.jjtAccept(this, data);
    }
    TupleExpr insert = null;
    ASTInsertClause insertNode = node.getInsertClause();
    if (insertNode != null) {
        insert = (TupleExpr) insertNode.jjtAccept(this, data);
    }
    Modify modifyExpr = new Modify(delete, insert, where);
    return modifyExpr;
}
Also used : ASTWhereClause(org.eclipse.rdf4j.query.parser.sparql.ast.ASTWhereClause) ASTDeleteClause(org.eclipse.rdf4j.query.parser.sparql.ast.ASTDeleteClause) Modify(org.eclipse.rdf4j.query.algebra.Modify) ASTModify(org.eclipse.rdf4j.query.parser.sparql.ast.ASTModify) TupleExpr(org.eclipse.rdf4j.query.algebra.TupleExpr) ASTInsertClause(org.eclipse.rdf4j.query.parser.sparql.ast.ASTInsertClause)

Aggregations

Modify (org.eclipse.rdf4j.query.algebra.Modify)1 TupleExpr (org.eclipse.rdf4j.query.algebra.TupleExpr)1 ASTDeleteClause (org.eclipse.rdf4j.query.parser.sparql.ast.ASTDeleteClause)1 ASTInsertClause (org.eclipse.rdf4j.query.parser.sparql.ast.ASTInsertClause)1 ASTModify (org.eclipse.rdf4j.query.parser.sparql.ast.ASTModify)1 ASTWhereClause (org.eclipse.rdf4j.query.parser.sparql.ast.ASTWhereClause)1