/** Non-reordering execution of a basic graph pattern, given a iterator of bindings as input */ public static QueryIterator execute(GraphTDB graph, BasicPattern pattern, QueryIterator input, Predicate<Tuple<NodeId>> filter, ExecutionContext execCxt) { // Maybe default graph or named graph. NodeTupleTable ntt = graph.getNodeTupleTable() ; return execute(ntt, graph.getGraphName(), pattern, input, filter, execCxt) ; }
@Override protected final int graphBaseSize() { if ( isDefaultGraph() ) return (int)getNodeTupleTable().size() ; Node gn = getGraphName() ; boolean unionGraph = isUnionGraph(gn) ; gn = unionGraph ? Node.ANY : gn ; QuadTable quadTable = getDatasetGraphTDB().getQuadTable() ; Iterator<Tuple<NodeId>> iter = quadTable.getNodeTupleTable().findAsNodeIds(gn, null, null, null) ; if ( unionGraph ) { iter = Iter.map(iter, project4TupleTo3Tuple) ; iter = Iter.distinctAdjacent(iter) ; } return (int)Iter.count(iter) ; }