Search in sources :

Example 1 with ASTClear

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

the class UpdateExprBuilder method visit.

@Override
public Clear visit(ASTClear node, Object data) throws VisitorException {
    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;
}
Also used : ASTGraphRefAll(org.eclipse.rdf4j.query.parser.sparql.ast.ASTGraphRefAll) ValueConstant(org.eclipse.rdf4j.query.algebra.ValueConstant) ASTClear(org.eclipse.rdf4j.query.parser.sparql.ast.ASTClear) Clear(org.eclipse.rdf4j.query.algebra.Clear)

Aggregations

Clear (org.eclipse.rdf4j.query.algebra.Clear)1 ValueConstant (org.eclipse.rdf4j.query.algebra.ValueConstant)1 ASTClear (org.eclipse.rdf4j.query.parser.sparql.ast.ASTClear)1 ASTGraphRefAll (org.eclipse.rdf4j.query.parser.sparql.ast.ASTGraphRefAll)1