public void setSubQuery(TupleExpr subQuery) { assert subQuery != null : "subQuery must not be null"; subQuery.setParentNode(this); this.subQuery = subQuery; }
/** * Sets the left argument of this binary tuple operator. * * @param leftArg * The (new) left argument for this operator, must not be * <tt>null</tt>. */ public void setLeftArg(TupleExpr leftArg) { assert leftArg != null : "leftArg must not be null"; leftArg.setParentNode(this); this.leftArg = leftArg; }
/** * Sets the argument of this unary tuple operator. * * @param arg * The (new) argument for this operator, must not be <tt>null</tt>. */ public void setArg(TupleExpr arg) { assert arg != null : "arg must not be null"; arg.setParentNode(this); this.arg = arg; }
/** * Sets the right argument of this binary tuple operator. * * @param rightArg * The (new) right argument for this operator, must not be * <tt>null</tt>. */ public void setRightArg(TupleExpr rightArg) { assert rightArg != null : "rightArg must not be null"; rightArg.setParentNode(this); this.rightArg = rightArg; }
public void setPathExpression(TupleExpr pathExpression) { pathExpression.setParentNode(this); this.pathExpression = pathExpression; }
public static TupleExpr parseTupleExpr(final String string, @Nullable final String baseURI, @Nullable final Map<String, String> namespaces) throws MalformedQueryException { Objects.requireNonNull(string); final TupleExpr expr = ((Projection) parseQuery("SELECT *\nWHERE {\n" + string + "\n}", baseURI, namespaces).getTupleExpr()).getArg(); expr.setParentNode(null); return expr; }
public static TupleExpr rewriteGraph(final TupleExpr expr, final Var graphVar) { if (expr == null) { return null; } final TupleExpr result = expr.clone(); result.setParentNode(null); result.visit(new QueryModelVisitorBase<RuntimeException>() { @Override public void meet(final StatementPattern pattern) throws RuntimeException { pattern.setContextVar(graphVar); } }); return result; }
public void visitDeleteWhere(Resource query) throws OpenRDFException { SingletonSet stub = new SingletonSet(); tupleRoot = new QueryRoot(stub); tupleNode = stub; visitWhere(query); tupleNode.setParentNode(null); updateRoot = new Modify(tupleNode, null, tupleNode.clone()); }
expr.setParentNode(null);
@Nullable public static TupleExpr explodeFilters(@Nullable TupleExpr expr) { if (expr == null) { return null; } expr = expr.clone(); expr.setParentNode(null); final List<Filter> filters = extractNodes(expr, Filter.class, (final Filter filter) -> { return filter.getCondition() instanceof And; }, null); if (filters.isEmpty()) { return expr; } for (final Filter filter : filters) { TupleExpr arg = filter.getArg(); for (final ValueExpr condition : extractNodes(filter.getCondition(), ValueExpr.class, e -> !(e instanceof And), e -> e instanceof And)) { arg = new Filter(arg, condition); } expr = (TupleExpr) replaceNode(expr, filter, arg); } return expr; }
clonedExpr.setParentNode(null);
public void visitInsertData(Resource query) throws OpenRDFException { SingletonSet stub = new SingletonSet(); tupleRoot = new QueryRoot(stub); tupleNode = stub; TupleExpr insertExpr; Value insert = Statements.singleValue(query, SP.DATA_PROPERTY, store); if (!(insert instanceof Resource)) { throw new MalformedSpinException( String.format("Value of %s is not a resource", SP.DATA_PROPERTY)); } visitInsert((Resource)insert); insertExpr = tupleNode; insertExpr.setParentNode(null); DataVisitor visitor = new DataVisitor(); insertExpr.visit(visitor); updateRoot = new InsertData(visitor.getData()); }
visitDelete((Resource)delete); deleteExpr = tupleNode; deleteExpr.setParentNode(null); visitInsert((Resource)insert); insertExpr = tupleNode; insertExpr.setParentNode(null); visitGroupGraphPattern((Resource)where); whereExpr = tupleNode; whereExpr.setParentNode(null);
public void visitDeleteData(Resource query) throws OpenRDFException { SingletonSet stub = new SingletonSet(); tupleRoot = new QueryRoot(stub); tupleNode = stub; TupleExpr deleteExpr; Value delete = Statements.singleValue(query, SP.DATA_PROPERTY, store); if (!(delete instanceof Resource)) { throw new MalformedSpinException( String.format("Value of %s is not a resource", SP.DATA_PROPERTY)); } visitDelete((Resource)delete); deleteExpr = tupleNode; deleteExpr.setParentNode(null); DataVisitor visitor = new DataVisitor(); deleteExpr.visit(visitor); updateRoot = new DeleteData(visitor.getData()); }
expr.setParentNode(null);
expr.setParentNode(null);