public SPBubbleDownVisitor(ExternalTupleSet index) { this.tuple = index.getTupleExpr(); indexQNode = ((Projection) tuple).getArg(); sSet = getQNodes("sp", indexQNode); }
public FilterBubbleManager(ExternalTupleSet index) { this.tuple = index.getTupleExpr(); indexQNode = ((Projection) tuple).getArg(); sSet = getQNodes(indexQNode); }
@Override public void meet(final Projection node) { projection = node; node.getArg().visit(this); }
@Override public void meet(Projection node) { projection = node; node.getArg().visit(this); projection = null; }
@Override public void meet(Projection node) { projection = node; node.getArg().visit(this); projection = null; }
@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); }
public void meet(Projection node) { node.getArg().visit(this); }
public void meet(Projection node) { relocationParent = node; node.getArg().visit(this); }
@Override 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); }
@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()); }
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; }
@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()); }
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; }
@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); } } }
public void meet(Projection node) { count++; node.getArg().visit(this); }
@Test public void nowTest() throws Exception { //tests to see if NOW function is correctly serialized and deserialized //by FilterSerializer String query = "select * {Filter(NOW())}"; SPARQLParser parser = new SPARQLParser(); ParsedQuery pq = parser.parseQuery(query, null); Filter filter = (Filter) ((Projection) pq.getTupleExpr()).getArg(); String filterString = FilterSerializer.serialize(filter); Filter deserializedFilter = FilterSerializer.deserialize(filterString); assertEquals(filter, deserializedFilter); }
@Test public void testEmptyProjection() throws Exception { StatementPattern isClass = new StatementPattern(constant(UNDERGRAD), constant(RDF.TYPE), constant(OWL.CLASS)); QueryRoot queryTree = new QueryRoot(new Projection(isClass, new ProjectionElemList())); SparqlToPipelineTransformVisitor visitor = new SparqlToPipelineTransformVisitor(collection); queryTree.visit(visitor); Assert.assertTrue(queryTree.getArg() instanceof Projection); Projection projectNode = (Projection) queryTree.getArg(); Assert.assertTrue(projectNode.getArg() instanceof AggregationPipelineQueryNode); AggregationPipelineQueryNode pipelineNode = (AggregationPipelineQueryNode) projectNode.getArg(); Assert.assertEquals(Sets.newHashSet(), pipelineNode.getAssuredBindingNames()); }