Search in sources :

Example 1 with StatementMetadataOptimizer

use of org.apache.rya.indexing.statement.metadata.matching.StatementMetadataOptimizer in project incubator-rya by apache.

the class StatementMetadataExample method prettyPrintQueryPlan.

private void prettyPrintQueryPlan(String query) throws MalformedQueryException {
    SPARQLParser parser = new SPARQLParser();
    ParsedQuery pq = parser.parseQuery(query, null);
    TupleExpr exp = pq.getTupleExpr();
    new StatementMetadataOptimizer(getConf()).optimize(exp, null, null);
    System.out.println("=================== RYA SPARQL QUERY PLAN ===================");
    for (String str : exp.toString().split("\\r?\\n")) {
        System.out.println(str);
    }
    System.out.println("=================== END RYA QUERY PLAN ======================");
}
Also used : StatementMetadataOptimizer(org.apache.rya.indexing.statement.metadata.matching.StatementMetadataOptimizer) SPARQLParser(org.openrdf.query.parser.sparql.SPARQLParser) ParsedQuery(org.openrdf.query.parser.ParsedQuery) TupleExpr(org.openrdf.query.algebra.TupleExpr)

Example 2 with StatementMetadataOptimizer

use of org.apache.rya.indexing.statement.metadata.matching.StatementMetadataOptimizer in project incubator-rya by apache.

the class StatementMetadataOptimizerTest method init.

@Before
public void init() {
    RdfCloudTripleStoreConfiguration mongoConf = getConf(true);
    RdfCloudTripleStoreConfiguration accumuloConf = getConf(false);
    mongoOptimizer = new StatementMetadataOptimizer(mongoConf);
    accumuloOptimizer = new StatementMetadataOptimizer(accumuloConf);
}
Also used : StatementMetadataOptimizer(org.apache.rya.indexing.statement.metadata.matching.StatementMetadataOptimizer) RdfCloudTripleStoreConfiguration(org.apache.rya.api.RdfCloudTripleStoreConfiguration) Before(org.junit.Before)

Aggregations

StatementMetadataOptimizer (org.apache.rya.indexing.statement.metadata.matching.StatementMetadataOptimizer)2 RdfCloudTripleStoreConfiguration (org.apache.rya.api.RdfCloudTripleStoreConfiguration)1 Before (org.junit.Before)1 TupleExpr (org.openrdf.query.algebra.TupleExpr)1 ParsedQuery (org.openrdf.query.parser.ParsedQuery)1 SPARQLParser (org.openrdf.query.parser.sparql.SPARQLParser)1