DatasetGraphFilteredView extends DatasetGraphReadOnly implements DatasetGraphWrapperView { @Override public Iterator<Quad> find() { return filter(super.find()); } DatasetGraphFilteredView(DatasetGraph dsg, Predicate<Quad> filter, Collection<Node> visibleGraphs); @Override Graph getDefaultGraph(); @Override Graph getGraph(Node graphNode); @Override Iterator<Node> listGraphNodes(); @Override long size(); @Override Graph getUnionGraph(); @Override Iterator<Quad> find(); @Override Iterator<Quad> find(Node g, Node s, Node p, Node o); @Override Iterator<Quad> find(Quad quad); @Override Iterator<Quad> findNG(Node g, Node s, Node p , Node o); @Override boolean contains(Node g, Node s, Node p , Node o); @Override boolean contains(Quad quad); @Override boolean isEmpty(); @Override String toString();  }
@Test public void filtered5() { Predicate<Quad> filter = x-> x.getSubject().equals(s2) || x.getSubject().equals(s1); Txn.executeRead(basedsg, ()->{ DatasetGraph dsg = new DatasetGraphFilteredView(basedsg, filter, Arrays.asList(g1, g2)); long x0 = Iter.count(dsg.find(null, null, null, null)); assertEquals(3,x0); long x1 = Iter.count(dsg.find(g2, null, null, null)); assertEquals(2,x1); }); }