Search in sources :

Example 11 with QueryBindingSet

use of org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet in project incubator-rya by apache.

the class ConstructProjectionTest method testConstructProjectionProjPred.

@Test
public void testConstructProjectionProjPred() throws MalformedQueryException {
    String query = "select ?p where { <uri:Joe> ?p <uri:Bob> }";
    SPARQLParser parser = new SPARQLParser();
    ParsedQuery pq = parser.parseQuery(query, null);
    List<StatementPattern> patterns = StatementPatternCollector.process(pq.getTupleExpr());
    ConstructProjection projection = new ConstructProjection(patterns.get(0));
    QueryBindingSet bs = new QueryBindingSet();
    bs.addBinding("p", VF.createIRI("uri:worksWith"));
    VisibilityBindingSet vBs = new VisibilityBindingSet(bs);
    RyaStatement statement = projection.projectBindingSet(vBs, new HashMap<>());
    RyaStatement expected = new RyaStatement(new RyaIRI("uri:Joe"), new RyaIRI("uri:worksWith"), new RyaIRI("uri:Bob"));
    expected.setTimestamp(statement.getTimestamp());
    expected.setColumnVisibility(new byte[0]);
    assertEquals(expected, statement);
}
Also used : StatementPattern(org.eclipse.rdf4j.query.algebra.StatementPattern) SPARQLParser(org.eclipse.rdf4j.query.parser.sparql.SPARQLParser) VisibilityBindingSet(org.apache.rya.api.model.VisibilityBindingSet) ParsedQuery(org.eclipse.rdf4j.query.parser.ParsedQuery) RyaIRI(org.apache.rya.api.domain.RyaIRI) RyaStatement(org.apache.rya.api.domain.RyaStatement) QueryBindingSet(org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet) Test(org.junit.Test)

Example 12 with QueryBindingSet

use of org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet in project incubator-rya by apache.

the class BatchIT method simpleJoinDelete.

@Test
public void simpleJoinDelete() throws Exception {
    final String sparql = "SELECT ?subject ?object1 ?object2 WHERE { ?subject <urn:predicate_1> ?object1; " + " <urn:predicate_2> ?object2 } ";
    try (FluoClient fluoClient = new FluoClientImpl(getFluoConfiguration())) {
        RyaIRI subj = new RyaIRI("urn:subject_1");
        RyaStatement statement1 = new RyaStatement(subj, new RyaIRI("urn:predicate_1"), null);
        RyaStatement statement2 = new RyaStatement(subj, new RyaIRI("urn:predicate_2"), null);
        Set<RyaStatement> statements1 = getRyaStatements(statement1, 5);
        Set<RyaStatement> statements2 = getRyaStatements(statement2, 5);
        // Create the PCJ table.
        final PrecomputedJoinStorage pcjStorage = new AccumuloPcjStorage(getAccumuloConnector(), getRyaInstanceName());
        final String pcjId = pcjStorage.createPcj(sparql);
        // Tell the Fluo app to maintain the PCJ.
        String queryId = new CreateFluoPcj().withRyaIntegration(pcjId, pcjStorage, fluoClient, getAccumuloConnector(), getRyaInstanceName()).getQueryId();
        List<String> ids = getNodeIdStrings(fluoClient, queryId);
        String joinId = ids.get(2);
        String rightSp = ids.get(4);
        QueryBindingSet bs = new QueryBindingSet();
        bs.addBinding("subject", VF.createIRI("urn:subject_1"));
        bs.addBinding("object1", VF.createIRI("urn:object_0"));
        VisibilityBindingSet vBs = new VisibilityBindingSet(bs);
        // create sharded span for deletion
        IRI iri = VF.createIRI("urn:subject_1");
        Bytes prefixBytes = BindingHashShardingFunction.getShardedScanPrefix(rightSp, iri);
        Span span = Span.prefix(prefixBytes);
        // Stream the data into Fluo.
        InsertTriples inserter = new InsertTriples();
        inserter.insert(fluoClient, statements1, Optional.absent());
        inserter.insert(fluoClient, statements2, Optional.absent());
        getMiniFluo().waitForObservers();
        verifyCounts(fluoClient, ids, Arrays.asList(25, 25, 25, 5, 5));
        JoinBatchInformation batch = JoinBatchInformation.builder().setBatchSize(1).setColumn(FluoQueryColumns.STATEMENT_PATTERN_BINDING_SET).setSpan(span).setTask(Task.Delete).setJoinType(JoinType.NATURAL_JOIN).setSide(Side.LEFT).setBs(vBs).build();
        // Verify the end results of the query match the expected results.
        createSpanBatch(fluoClient, joinId, batch);
        getMiniFluo().waitForObservers();
        verifyCounts(fluoClient, ids, Arrays.asList(25, 25, 20, 5, 5));
    }
}
Also used : RyaIRI(org.apache.rya.api.domain.RyaIRI) IRI(org.eclipse.rdf4j.model.IRI) FluoClient(org.apache.fluo.api.client.FluoClient) FluoClientImpl(org.apache.fluo.core.client.FluoClientImpl) VisibilityBindingSet(org.apache.rya.api.model.VisibilityBindingSet) AccumuloPcjStorage(org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage) RyaIRI(org.apache.rya.api.domain.RyaIRI) InsertTriples(org.apache.rya.indexing.pcj.fluo.api.InsertTriples) RyaStatement(org.apache.rya.api.domain.RyaStatement) CreateFluoPcj(org.apache.rya.indexing.pcj.fluo.api.CreateFluoPcj) JoinBatchInformation(org.apache.rya.indexing.pcj.fluo.app.batch.JoinBatchInformation) Span(org.apache.fluo.api.data.Span) QueryBindingSet(org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet) Bytes(org.apache.fluo.api.data.Bytes) PrecomputedJoinStorage(org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage) Test(org.junit.Test)

Example 13 with QueryBindingSet

use of org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet in project incubator-rya by apache.

the class BatchIT method simpleJoinAdd.

@Test
public void simpleJoinAdd() throws Exception {
    final String sparql = "SELECT ?subject ?object1 ?object2 WHERE { ?subject <urn:predicate_1> ?object1; " + " <urn:predicate_2> ?object2 } ";
    try (FluoClient fluoClient = new FluoClientImpl(getFluoConfiguration())) {
        RyaIRI subj = new RyaIRI("urn:subject_1");
        RyaStatement statement2 = new RyaStatement(subj, new RyaIRI("urn:predicate_2"), null);
        Set<RyaStatement> statements2 = getRyaStatements(statement2, 5);
        // Create the PCJ table.
        final PrecomputedJoinStorage pcjStorage = new AccumuloPcjStorage(getAccumuloConnector(), getRyaInstanceName());
        final String pcjId = pcjStorage.createPcj(sparql);
        // Tell the Fluo app to maintain the PCJ.
        String queryId = new CreateFluoPcj().withRyaIntegration(pcjId, pcjStorage, fluoClient, getAccumuloConnector(), getRyaInstanceName()).getQueryId();
        List<String> ids = getNodeIdStrings(fluoClient, queryId);
        String joinId = ids.get(2);
        String rightSp = ids.get(4);
        QueryBindingSet bs = new QueryBindingSet();
        bs.addBinding("subject", VF.createIRI("urn:subject_1"));
        bs.addBinding("object1", VF.createIRI("urn:object_0"));
        VisibilityBindingSet vBs = new VisibilityBindingSet(bs);
        IRI iri = VF.createIRI("urn:subject_1");
        Bytes prefixBytes = BindingHashShardingFunction.getShardedScanPrefix(rightSp, iri);
        Span span = Span.prefix(prefixBytes);
        // Stream the data into Fluo.
        InsertTriples inserter = new InsertTriples();
        inserter.insert(fluoClient, statements2, Optional.absent());
        getMiniFluo().waitForObservers();
        verifyCounts(fluoClient, ids, Arrays.asList(0, 0, 0, 0, 5));
        JoinBatchInformation batch = JoinBatchInformation.builder().setBatchSize(1).setColumn(FluoQueryColumns.STATEMENT_PATTERN_BINDING_SET).setSpan(span).setTask(Task.Add).setJoinType(JoinType.NATURAL_JOIN).setSide(Side.LEFT).setBs(vBs).build();
        // Verify the end results of the query match the expected results.
        createSpanBatch(fluoClient, joinId, batch);
        getMiniFluo().waitForObservers();
        verifyCounts(fluoClient, ids, Arrays.asList(5, 5, 5, 0, 5));
    }
}
Also used : RyaIRI(org.apache.rya.api.domain.RyaIRI) IRI(org.eclipse.rdf4j.model.IRI) FluoClient(org.apache.fluo.api.client.FluoClient) FluoClientImpl(org.apache.fluo.core.client.FluoClientImpl) VisibilityBindingSet(org.apache.rya.api.model.VisibilityBindingSet) AccumuloPcjStorage(org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage) RyaIRI(org.apache.rya.api.domain.RyaIRI) InsertTriples(org.apache.rya.indexing.pcj.fluo.api.InsertTriples) RyaStatement(org.apache.rya.api.domain.RyaStatement) CreateFluoPcj(org.apache.rya.indexing.pcj.fluo.api.CreateFluoPcj) JoinBatchInformation(org.apache.rya.indexing.pcj.fluo.app.batch.JoinBatchInformation) Span(org.apache.fluo.api.data.Span) QueryBindingSet(org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet) Bytes(org.apache.fluo.api.data.Bytes) PrecomputedJoinStorage(org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage) Test(org.junit.Test)

Example 14 with QueryBindingSet

use of org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet in project incubator-rya by apache.

the class StatementPatternProcessorIT method singlePattern_manyStatements.

@Test
public void singlePattern_manyStatements() throws Exception {
    // Enumerate some topics that will be re-used
    final String ryaInstance = UUID.randomUUID().toString();
    final UUID queryId = UUID.randomUUID();
    final String statementsTopic = KafkaTopics.statementsTopic(ryaInstance);
    final String resultsTopic = KafkaTopics.queryResultsTopic(ryaInstance, queryId);
    // Setup a topology.
    final String query = "SELECT * WHERE { ?person <urn:talksTo> ?otherPerson }";
    final TopologyFactory factory = new TopologyFactory();
    final TopologyBuilder builder = factory.build(query, statementsTopic, resultsTopic, new RandomUUIDFactory());
    // Create some statements where some generates SP results and others do not.
    final ValueFactory vf = SimpleValueFactory.getInstance();
    final List<VisibilityStatement> statements = new ArrayList<>();
    statements.add(new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob")), "a"));
    statements.add(new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:TacoJoin")), "b"));
    statements.add(new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Alice")), "a|b"));
    statements.add(new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:BurgerJoint")), "c"));
    // Show the correct binding set results from the job.
    final Set<VisibilityBindingSet> expected = new HashSet<>();
    QueryBindingSet bs = new QueryBindingSet();
    bs.addBinding("person", vf.createIRI("urn:Alice"));
    bs.addBinding("otherPerson", vf.createIRI("urn:Bob"));
    expected.add(new VisibilityBindingSet(bs, "a"));
    bs = new QueryBindingSet();
    bs.addBinding("person", vf.createIRI("urn:Bob"));
    bs.addBinding("otherPerson", vf.createIRI("urn:Alice"));
    expected.add(new VisibilityBindingSet(bs, "a|b"));
    // Run the test.
    RyaStreamsTestUtil.runStreamProcessingTest(kafka, statementsTopic, resultsTopic, builder, statements, expected, VisibilityBindingSetDeserializer.class);
}
Also used : VisibilityBindingSet(org.apache.rya.api.model.VisibilityBindingSet) TopologyBuilder(org.apache.kafka.streams.processor.TopologyBuilder) ArrayList(java.util.ArrayList) TopologyFactory(org.apache.rya.streams.kafka.topology.TopologyFactory) ValueFactory(org.eclipse.rdf4j.model.ValueFactory) SimpleValueFactory(org.eclipse.rdf4j.model.impl.SimpleValueFactory) VisibilityStatement(org.apache.rya.api.model.VisibilityStatement) QueryBindingSet(org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet) RandomUUIDFactory(org.apache.rya.api.function.projection.RandomUUIDFactory) UUID(java.util.UUID) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 15 with QueryBindingSet

use of org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet in project incubator-rya by apache.

the class RdfCloudTripleStoreConnection method evaluateInternal.

@Override
protected CloseableIteration<? extends BindingSet, QueryEvaluationException> evaluateInternal(TupleExpr tupleExpr, final Dataset dataset, BindingSet bindings, final boolean flag) throws SailException {
    verifyIsOpen();
    logger.trace("Incoming query model:\n{}", tupleExpr.toString());
    if (provenanceCollector != null) {
        try {
            provenanceCollector.recordQuery(tupleExpr.toString());
        } catch (final ProvenanceCollectionException e) {
            logger.trace("Provenance failed to record query.", e);
        }
    }
    tupleExpr = tupleExpr.clone();
    final C queryConf = (C) store.getConf().clone();
    if (queryConf == null) {
        // Should not happen, but this is better than a null dereference error.
        throw new SailException("Cloning store.getConf() returned null, aborting.");
    }
    if (bindings != null) {
        final Binding dispPlan = bindings.getBinding(RdfCloudTripleStoreConfiguration.CONF_QUERYPLAN_FLAG);
        if (dispPlan != null) {
            queryConf.setDisplayQueryPlan(Boolean.parseBoolean(dispPlan.getValue().stringValue()));
        }
        final Binding authBinding = bindings.getBinding(RdfCloudTripleStoreConfiguration.CONF_QUERY_AUTH);
        if (authBinding != null) {
            queryConf.setAuths(authBinding.getValue().stringValue().split(","));
        }
        final Binding ttlBinding = bindings.getBinding(RdfCloudTripleStoreConfiguration.CONF_TTL);
        if (ttlBinding != null) {
            queryConf.setTtl(Long.valueOf(ttlBinding.getValue().stringValue()));
        }
        final Binding startTimeBinding = bindings.getBinding(RdfCloudTripleStoreConfiguration.CONF_STARTTIME);
        if (startTimeBinding != null) {
            queryConf.setStartTime(Long.valueOf(startTimeBinding.getValue().stringValue()));
        }
        final Binding performantBinding = bindings.getBinding(RdfCloudTripleStoreConfiguration.CONF_PERFORMANT);
        if (performantBinding != null) {
            queryConf.setBoolean(RdfCloudTripleStoreConfiguration.CONF_PERFORMANT, Boolean.parseBoolean(performantBinding.getValue().stringValue()));
        }
        final Binding inferBinding = bindings.getBinding(RdfCloudTripleStoreConfiguration.CONF_INFER);
        if (inferBinding != null) {
            queryConf.setInfer(Boolean.parseBoolean(inferBinding.getValue().stringValue()));
        }
        final Binding useStatsBinding = bindings.getBinding(RdfCloudTripleStoreConfiguration.CONF_USE_STATS);
        if (useStatsBinding != null) {
            queryConf.setUseStats(Boolean.parseBoolean(useStatsBinding.getValue().stringValue()));
        }
        final Binding offsetBinding = bindings.getBinding(RdfCloudTripleStoreConfiguration.CONF_OFFSET);
        if (offsetBinding != null) {
            queryConf.setOffset(Long.parseLong(offsetBinding.getValue().stringValue()));
        }
        final Binding limitBinding = bindings.getBinding(RdfCloudTripleStoreConfiguration.CONF_LIMIT);
        if (limitBinding != null) {
            queryConf.setLimit(Long.parseLong(limitBinding.getValue().stringValue()));
        }
    } else {
        bindings = new QueryBindingSet();
    }
    if (!(tupleExpr instanceof QueryRoot)) {
        tupleExpr = new QueryRoot(tupleExpr);
    }
    try {
        final List<Class<QueryOptimizer>> optimizers = queryConf.getOptimizers();
        final Class<QueryOptimizer> pcjOptimizer = queryConf.getPcjOptimizer();
        if (pcjOptimizer != null) {
            QueryOptimizer opt = null;
            try {
                final Constructor<QueryOptimizer> construct = pcjOptimizer.getDeclaredConstructor();
                opt = construct.newInstance();
            } catch (final Exception e) {
            }
            if (opt == null) {
                throw new NoSuchMethodException("Could not find valid constructor for " + pcjOptimizer.getName());
            }
            if (opt instanceof Configurable) {
                ((Configurable) opt).setConf(conf);
            }
            opt.optimize(tupleExpr, dataset, bindings);
        }
        final ParallelEvaluationStrategyImpl strategy = new ParallelEvaluationStrategyImpl(new StoreTripleSource<C>(queryConf, ryaDAO), inferenceEngine, dataset, queryConf);
        (new BindingAssigner()).optimize(tupleExpr, dataset, bindings);
        (new ConstantOptimizer(strategy)).optimize(tupleExpr, dataset, bindings);
        (new CompareOptimizer()).optimize(tupleExpr, dataset, bindings);
        (new ConjunctiveConstraintSplitter()).optimize(tupleExpr, dataset, bindings);
        (new DisjunctiveConstraintOptimizer()).optimize(tupleExpr, dataset, bindings);
        (new SameTermFilterOptimizer()).optimize(tupleExpr, dataset, bindings);
        (new QueryModelNormalizer()).optimize(tupleExpr, dataset, bindings);
        (new IterativeEvaluationOptimizer()).optimize(tupleExpr, dataset, bindings);
        if (!optimizers.isEmpty()) {
            for (final Class<QueryOptimizer> optclz : optimizers) {
                QueryOptimizer result = null;
                try {
                    final Constructor<QueryOptimizer> meth = optclz.getDeclaredConstructor();
                    result = meth.newInstance();
                } catch (final Exception e) {
                }
                try {
                    final Constructor<QueryOptimizer> meth = optclz.getDeclaredConstructor(EvaluationStrategy.class);
                    result = meth.newInstance(strategy);
                } catch (final Exception e) {
                }
                if (result == null) {
                    throw new NoSuchMethodException("Could not find valid constructor for " + optclz.getName());
                }
                if (result instanceof Configurable) {
                    ((Configurable) result).setConf(conf);
                }
                result.optimize(tupleExpr, dataset, bindings);
            }
        }
        (new FilterOptimizer()).optimize(tupleExpr, dataset, bindings);
        (new OrderLimitOptimizer()).optimize(tupleExpr, dataset, bindings);
        logger.trace("Optimized query model:\n{}", tupleExpr.toString());
        if (queryConf.isInfer() && this.inferenceEngine != null) {
            try {
                tupleExpr.visit(new DomainRangeVisitor(queryConf, inferenceEngine));
                tupleExpr.visit(new SomeValuesFromVisitor(queryConf, inferenceEngine));
                tupleExpr.visit(new AllValuesFromVisitor(queryConf, inferenceEngine));
                tupleExpr.visit(new HasValueVisitor(queryConf, inferenceEngine));
                tupleExpr.visit(new IntersectionOfVisitor(queryConf, inferenceEngine));
                tupleExpr.visit(new ReflexivePropertyVisitor(queryConf, inferenceEngine));
                tupleExpr.visit(new PropertyChainVisitor(queryConf, inferenceEngine));
                tupleExpr.visit(new TransitivePropertyVisitor(queryConf, inferenceEngine));
                tupleExpr.visit(new SymmetricPropertyVisitor(queryConf, inferenceEngine));
                tupleExpr.visit(new InverseOfVisitor(queryConf, inferenceEngine));
                tupleExpr.visit(new SubPropertyOfVisitor(queryConf, inferenceEngine));
                tupleExpr.visit(new SubClassOfVisitor(queryConf, inferenceEngine));
                tupleExpr.visit(new SameAsVisitor(queryConf, inferenceEngine));
                tupleExpr.visit(new OneOfVisitor(queryConf, inferenceEngine));
                tupleExpr.visit(new HasSelfVisitor(queryConf, inferenceEngine));
            } catch (final Exception e) {
                logger.error("Error encountered while visiting query node.", e);
            }
        }
        if (queryConf.isPerformant()) {
            tupleExpr.visit(new SeparateFilterJoinsVisitor());
        // tupleExpr.visit(new FilterTimeIndexVisitor(queryConf));
        // tupleExpr.visit(new PartitionFilterTimeIndexVisitor(queryConf));
        }
        final FilterRangeVisitor rangeVisitor = new FilterRangeVisitor(queryConf);
        tupleExpr.visit(rangeVisitor);
        // this has to be done twice to get replace the statementpatterns with the right ranges
        tupleExpr.visit(rangeVisitor);
        EvaluationStatistics stats = null;
        if (!queryConf.isUseStats() && queryConf.isPerformant() || rdfEvalStatsDAO == null) {
            stats = new DefaultStatistics();
        } else if (queryConf.isUseStats()) {
            if (queryConf.isUseSelectivity()) {
                stats = new RdfCloudTripleStoreSelectivityEvaluationStatistics<C>(queryConf, rdfEvalStatsDAO, selectEvalDAO);
            } else {
                stats = new RdfCloudTripleStoreEvaluationStatistics<C>(queryConf, rdfEvalStatsDAO);
            }
        }
        if (stats != null) {
            if (stats instanceof RdfCloudTripleStoreSelectivityEvaluationStatistics) {
                final QueryJoinSelectOptimizer qjso = new QueryJoinSelectOptimizer(stats, selectEvalDAO);
                qjso.optimize(tupleExpr, dataset, bindings);
            } else {
                final QueryJoinOptimizer qjo = new QueryJoinOptimizer(stats);
                // TODO: Make pluggable
                qjo.optimize(tupleExpr, dataset, bindings);
            }
        }
        final CloseableIteration<BindingSet, QueryEvaluationException> iter = strategy.evaluate(tupleExpr, EmptyBindingSet.getInstance());
        final CloseableIteration<BindingSet, QueryEvaluationException> iterWrap = new CloseableIteration<BindingSet, QueryEvaluationException>() {

            @Override
            public void remove() throws QueryEvaluationException {
                iter.remove();
            }

            @Override
            public BindingSet next() throws QueryEvaluationException {
                return iter.next();
            }

            @Override
            public boolean hasNext() throws QueryEvaluationException {
                return iter.hasNext();
            }

            @Override
            public void close() throws QueryEvaluationException {
                iter.close();
                strategy.shutdown();
            }
        };
        return iterWrap;
    } catch (final QueryEvaluationException e) {
        throw new SailException(e);
    } catch (final Exception e) {
        throw new SailException(e);
    }
}
Also used : OneOfVisitor(org.apache.rya.rdftriplestore.inference.OneOfVisitor) FilterOptimizer(org.eclipse.rdf4j.query.algebra.evaluation.impl.FilterOptimizer) SameTermFilterOptimizer(org.eclipse.rdf4j.query.algebra.evaluation.impl.SameTermFilterOptimizer) EvaluationStatistics(org.eclipse.rdf4j.query.algebra.evaluation.impl.EvaluationStatistics) RdfCloudTripleStoreSelectivityEvaluationStatistics(org.apache.rya.rdftriplestore.evaluation.RdfCloudTripleStoreSelectivityEvaluationStatistics) RdfCloudTripleStoreEvaluationStatistics(org.apache.rya.rdftriplestore.evaluation.RdfCloudTripleStoreEvaluationStatistics) DisjunctiveConstraintOptimizer(org.eclipse.rdf4j.query.algebra.evaluation.impl.DisjunctiveConstraintOptimizer) DomainRangeVisitor(org.apache.rya.rdftriplestore.inference.DomainRangeVisitor) IterativeEvaluationOptimizer(org.eclipse.rdf4j.query.algebra.evaluation.impl.IterativeEvaluationOptimizer) BindingAssigner(org.eclipse.rdf4j.query.algebra.evaluation.impl.BindingAssigner) QueryRoot(org.eclipse.rdf4j.query.algebra.QueryRoot) QueryJoinOptimizer(org.apache.rya.rdftriplestore.evaluation.QueryJoinOptimizer) InverseOfVisitor(org.apache.rya.rdftriplestore.inference.InverseOfVisitor) Binding(org.eclipse.rdf4j.query.Binding) EmptyBindingSet(org.eclipse.rdf4j.query.impl.EmptyBindingSet) QueryBindingSet(org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet) BindingSet(org.eclipse.rdf4j.query.BindingSet) ProvenanceCollectionException(org.apache.rya.rdftriplestore.provenance.ProvenanceCollectionException) ReflexivePropertyVisitor(org.apache.rya.rdftriplestore.inference.ReflexivePropertyVisitor) SymmetricPropertyVisitor(org.apache.rya.rdftriplestore.inference.SymmetricPropertyVisitor) QueryJoinSelectOptimizer(org.apache.rya.rdftriplestore.evaluation.QueryJoinSelectOptimizer) QueryBindingSet(org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet) IntersectionOfVisitor(org.apache.rya.rdftriplestore.inference.IntersectionOfVisitor) QueryEvaluationException(org.eclipse.rdf4j.query.QueryEvaluationException) RdfCloudTripleStoreEvaluationStatistics(org.apache.rya.rdftriplestore.evaluation.RdfCloudTripleStoreEvaluationStatistics) HasSelfVisitor(org.apache.rya.rdftriplestore.inference.HasSelfVisitor) OrderLimitOptimizer(org.eclipse.rdf4j.query.algebra.evaluation.impl.OrderLimitOptimizer) SameAsVisitor(org.apache.rya.rdftriplestore.inference.SameAsVisitor) HasValueVisitor(org.apache.rya.rdftriplestore.inference.HasValueVisitor) SameTermFilterOptimizer(org.eclipse.rdf4j.query.algebra.evaluation.impl.SameTermFilterOptimizer) SubClassOfVisitor(org.apache.rya.rdftriplestore.inference.SubClassOfVisitor) SeparateFilterJoinsVisitor(org.apache.rya.rdftriplestore.evaluation.SeparateFilterJoinsVisitor) Configurable(org.apache.hadoop.conf.Configurable) PropertyChainVisitor(org.apache.rya.rdftriplestore.inference.PropertyChainVisitor) FilterRangeVisitor(org.apache.rya.rdftriplestore.evaluation.FilterRangeVisitor) ParallelEvaluationStrategyImpl(org.apache.rya.rdftriplestore.evaluation.ParallelEvaluationStrategyImpl) TransitivePropertyVisitor(org.apache.rya.rdftriplestore.inference.TransitivePropertyVisitor) SomeValuesFromVisitor(org.apache.rya.rdftriplestore.inference.SomeValuesFromVisitor) DefaultStatistics(org.apache.rya.rdftriplestore.utils.DefaultStatistics) QueryModelNormalizer(org.eclipse.rdf4j.query.algebra.evaluation.impl.QueryModelNormalizer) ConjunctiveConstraintSplitter(org.eclipse.rdf4j.query.algebra.evaluation.impl.ConjunctiveConstraintSplitter) SubPropertyOfVisitor(org.apache.rya.rdftriplestore.inference.SubPropertyOfVisitor) RdfCloudTripleStoreSelectivityEvaluationStatistics(org.apache.rya.rdftriplestore.evaluation.RdfCloudTripleStoreSelectivityEvaluationStatistics) SailException(org.eclipse.rdf4j.sail.SailException) QueryOptimizer(org.eclipse.rdf4j.query.algebra.evaluation.QueryOptimizer) QueryEvaluationException(org.eclipse.rdf4j.query.QueryEvaluationException) ProvenanceCollectionException(org.apache.rya.rdftriplestore.provenance.ProvenanceCollectionException) SailException(org.eclipse.rdf4j.sail.SailException) NoSuchElementException(java.util.NoSuchElementException) RyaDAOException(org.apache.rya.api.persist.RyaDAOException) CloseableIteration(org.eclipse.rdf4j.common.iteration.CloseableIteration) CompareOptimizer(org.eclipse.rdf4j.query.algebra.evaluation.impl.CompareOptimizer) ConstantOptimizer(org.eclipse.rdf4j.query.algebra.evaluation.impl.ConstantOptimizer) AllValuesFromVisitor(org.apache.rya.rdftriplestore.inference.AllValuesFromVisitor)

Aggregations

QueryBindingSet (org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet)111 Test (org.junit.Test)84 BindingSet (org.eclipse.rdf4j.query.BindingSet)83 QueryEvaluationException (org.eclipse.rdf4j.query.QueryEvaluationException)56 RyaIRI (org.apache.rya.api.domain.RyaIRI)46 RyaStatement (org.apache.rya.api.domain.RyaStatement)45 StatementPattern (org.eclipse.rdf4j.query.algebra.StatementPattern)42 SPARQLParser (org.eclipse.rdf4j.query.parser.sparql.SPARQLParser)42 ParsedQuery (org.eclipse.rdf4j.query.parser.ParsedQuery)41 RyaType (org.apache.rya.api.domain.RyaType)39 ArrayList (java.util.ArrayList)30 HashSet (java.util.HashSet)28 StatementMetadata (org.apache.rya.api.domain.StatementMetadata)26 VisibilityBindingSet (org.apache.rya.api.model.VisibilityBindingSet)20 TupleExpr (org.eclipse.rdf4j.query.algebra.TupleExpr)16 StatementMetadataNode (org.apache.rya.indexing.statement.metadata.matching.StatementMetadataNode)15 Statement (org.eclipse.rdf4j.model.Statement)15 Value (org.eclipse.rdf4j.model.Value)14 Collection (java.util.Collection)13 BatchWriter (org.apache.accumulo.core.client.BatchWriter)12