tupleExpr = new QueryRoot(tupleExpr);
}
try {
KiWiTripleSource tripleSource = new KiWiTripleSource(this,valueFactory,includeInferred);
EvaluationStrategy strategy = new KiWiEvaluationStrategyImpl(tripleSource, dataset, connection);
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 QueryJoinOptimizer(new KiWiEvaluationStatistics()).optimize(tupleExpr, dataset, bindings);
new IterativeEvaluationOptimizer().optimize(tupleExpr, dataset, bindings);
new FilterOptimizer().optimize(tupleExpr, dataset, bindings);
new OrderLimitOptimizer().optimize(tupleExpr, dataset, bindings);
new DistinctLimitOptimizer().optimize(tupleExpr, dataset, bindings);
log.debug("evaluating SPARQL query:\n {}", tupleExpr);
return strategy.evaluate(tupleExpr, EmptyBindingSet.getInstance());
} catch (QueryEvaluationException e) {
throw new SailException(e.getMessage(),e);
}
}