use of org.apache.jena.tdb.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 TDB
Graph g = execCxt.getActiveGraph();
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 SolverLib.execute(graph, pattern, input, filter, execCxt);
}
use of org.apache.jena.tdb.store.GraphTDB in project jena by apache.
the class TestDatasetTDBPersist method dataset1.
@Test
public void dataset1() {
Dataset ds = graphLocation.getDataset();
assertTrue(ds.getDefaultModel().getGraph() instanceof GraphTDB);
assertTrue(ds.getNamedModel("http://example/").getGraph() instanceof GraphTDB);
}
use of org.apache.jena.tdb.store.GraphTDB in project jena by apache.
the class OpExecutorTDB1 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