@Override public void meet(Projection node) { this.projection = node; node.getArg().visit(this); }
public SubsetEqualsVisitor(ExternalTupleSet index, TupleExpr query) { this.tuple = index.getTupleExpr(); this.set = index; indexQNode = ((Projection) tuple).getArg(); sSet = getQNodes(indexQNode); }
@Override public void meet(Projection node) { projection = node; node.getArg().visit(this); projection = null; }
public SPBubbleDownVisitor(ExternalTupleSet index) { this.tuple = index.getTupleExpr(); indexQNode = ((Projection) tuple).getArg(); sSet = getQNodes("sp", indexQNode); }
@Override public void meet(final Projection node) { node.getArg().visit(this); }
@Override public void meet(final Projection node) { projection = node; node.getArg().visit(this); }
public FilterBubbleManager(ExternalTupleSet index) { this.tuple = index.getTupleExpr(); indexQNode = ((Projection) tuple).getArg(); sSet = getQNodes(indexQNode); }
@Override public void meet(Projection node) { node.getArg().visit(this); }
@Override public void meet(Projection node) { node.getArg().visit(this); }
public void meet(Projection node) { relocationParent = node; node.getArg().visit(this); }
public void meet(Projection node) { node.getArg().visit(this); }
/** * Make a {@link ProjectionEvaluator} that processes the logic of a {@link Projection}. * * @param projection - Defines the projection that will be processed. (not null) * @return A {@link ProjectionEvaluator} for the provided {@link Projection}. */ public static ProjectionEvaluator make(final Projection projection) { requireNonNull(projection); final ProjectionElemList projectionElems = projection.getProjectionElemList(); final TupleExpr arg = projection.getArg(); final Optional<Extension> extension = arg instanceof Extension ? Optional.of((Extension)arg) : Optional.empty(); return new ProjectionEvaluator(projectionElems, extension); }
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 CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Projection projection, BindingSet bindings) throws QueryEvaluationException { CloseableIteration<BindingSet, QueryEvaluationException> result; result = this.evaluate(projection.getArg(), bindings); result = new ProjectionIterator(projection, result, bindings); return result; }
public static ValueExpr parseValueExpr(final String string, @Nullable final String baseURI, @Nullable final Map<String, String> namespaces) throws MalformedQueryException { Objects.requireNonNull(string); final TupleExpr expr = parseQuery("SELECT ((" + string + ") AS ?dummy) WHERE {}", baseURI, namespaces).getTupleExpr(); return ((Extension) ((Projection) expr).getArg()).getElements().get(0).getExpr(); }
@Override public void meet(Projection node) throws QueryEvaluationException { TupleExpr arg = node.getArg(); if (arg instanceof Extension) { Extension extension = (Extension) arg; TupleExpr arg2 = extension.getArg(); if (arg2 instanceof SingletonSet) { evaluate(node); } } }
@Override public Set<String> getAssuredBindingNames() { // Return all target binding names for which the source binding is assured // by the argument return projElemList.getTargetNamesFor(getArg().getAssuredBindingNames()); }
@Override public void meet(Projection projectionNode) throws Exception { projectionNode.visitChildren(this); if (projectionNode.getArg() instanceof AggregationPipelineQueryNode && projectionNode.getParentNode() != null) { AggregationPipelineQueryNode pipelineNode = (AggregationPipelineQueryNode) projectionNode.getArg(); if (pipelineNode.project(Arrays.asList(projectionNode.getProjectionElemList()))) { projectionNode.replaceWith(pipelineNode); } } }
private TupleExpr getTupleExpr(ParsedQuery query) { TupleExpr tupleExpr = query.getTupleExpr(); if (tupleExpr instanceof Projection) { Projection proj = (Projection) tupleExpr; for (ProjectionElem e : proj.getProjectionElemList().getElements()) { if (!e.getSourceName().equals(e.getTargetName())) return proj; } return proj.getArg(); } return tupleExpr; }
@Override public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Projection projection, BindingSet bindings) throws QueryEvaluationException { // count projected variables if(isSupported(projection.getArg())) { for (ProjectionElem elem : projection.getProjectionElemList().getElements()) { projectedVars.add(elem.getSourceName()); } } return super.evaluate(projection, bindings); }