Search in sources :

Example 1 with TransformFilterEquality

use of org.apache.jena.sparql.algebra.optimize.TransformFilterEquality in project jena by apache.

the class QueryEngineSDB method init.

//    @Override
//    protected Op modifyOp(Op op)
//    { 
//        return op ;
//    }
private void init(DatasetGraphSDB dsg, Query query, Binding initialBinding, Context context) {
    if (context == null)
        context = ARQ.getContext().copy();
    // See "DynamicDatasets" -- this could be enabled.
    if (query != null) {
        if (query.hasDatasetDescription())
            throw new SDBException("Queries with dataset descriptions (FROM/FROM NAMED) not supported");
    }
    if (context.isDefined(ARQConstants.sysDatasetDescription))
        throw new SDBException("Queries with dataset descriptions set in the context not supported");
    this.store = dsg.getStore();
    this.request = new SDBRequest(store, query, context);
    this.originalOp = getOp();
    // Enable transformations : use own choice of transformations.
    // e.g. don't place filters
    // Op op = Algebra.optimize(originalOp, context) ;
    Op op = originalOp;
    // Do property functions.
    op = Transformer.transform(new TransformPropertyFunction(context), op);
    op = Transformer.transform(new TransformFilterEquality(), op);
    // Quad it now so it can be passed to Compile.compile
    op = Algebra.toQuadForm(op);
    // Compile to SQL / extract parts to execute as SQL.
    op = SDBCompile.compile(store, op, initialBinding, context, request);
    setOp(op);
}
Also used : Op(org.apache.jena.sparql.algebra.Op) TransformFilterEquality(org.apache.jena.sparql.algebra.optimize.TransformFilterEquality) SDBException(org.apache.jena.sdb.SDBException) SDBRequest(org.apache.jena.sdb.core.SDBRequest) TransformPropertyFunction(org.apache.jena.sparql.algebra.optimize.TransformPropertyFunction)

Aggregations

SDBException (org.apache.jena.sdb.SDBException)1 SDBRequest (org.apache.jena.sdb.core.SDBRequest)1 Op (org.apache.jena.sparql.algebra.Op)1 TransformFilterEquality (org.apache.jena.sparql.algebra.optimize.TransformFilterEquality)1 TransformPropertyFunction (org.apache.jena.sparql.algebra.optimize.TransformPropertyFunction)1