use of org.apache.jena.tdb2.store.GraphTDB in project jena by apache.
the class StageGeneratorDirectTDB method execute.
@Override
public QueryIterator execute(BasicPattern pattern, QueryIterator input, ExecutionContext execCxt) {
// --- In case this isn't for TDB2
Graph g = execCxt.getActiveGraph();
if (g instanceof GraphViewSwitchable) {
GraphViewSwitchable gvs = (GraphViewSwitchable) g;
g = gvs.getBaseGraph();
}
if (!(g instanceof GraphTDB))
// Not us - bounce up the StageGenerator chain
return above.execute(pattern, input, execCxt);
GraphTDB graph = (GraphTDB) g;
Predicate<Tuple<NodeId>> filter = QC2.getFilter(execCxt.getContext());
return PatternMatchTDB2.execute(graph, pattern, input, filter, execCxt);
}
use of org.apache.jena.tdb2.store.GraphTDB in project jena by apache.
the class OpExecutorTDB2 method execute.
@Override
protected QueryIterator execute(OpFilter opFilter, QueryIterator input) {
if (!isForTDB)
return super.execute(opFilter, input);
// (filter (bgp ...))
if (OpBGP.isBGP(opFilter.getSubOp())) {
// Still may be a TDB graph in a non-TDB dataset (e.g. a named model)
GraphTDB graph = (GraphTDB) execCxt.getActiveGraph();
OpBGP opBGP = (OpBGP) opFilter.getSubOp();
return executeBGP(graph, opBGP, input, opFilter.getExprs(), execCxt);
}
// (filter (quadpattern ...))
if (opFilter.getSubOp() instanceof OpQuadPattern) {
OpQuadPattern quadPattern = (OpQuadPattern) opFilter.getSubOp();
DatasetGraphTDB ds = (DatasetGraphTDB) execCxt.getDataset();
return optimizeExecuteQuads(ds, input, quadPattern.getGraphNode(), quadPattern.getBasicPattern(), opFilter.getExprs(), execCxt);
}
// (filter (anything else))
return super.execute(opFilter, input);
}
Aggregations