use of org.eclipse.rdf4j.query.parser.sparql.ast.ASTGraphRefAll 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;
}
use of org.eclipse.rdf4j.query.parser.sparql.ast.ASTGraphRefAll 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;
}
Aggregations