/* Count the triples for the graph.find */ public static long countTriples(Graph graph, Node s, Node p, Node o) { ExtendedIterator<Triple> iter = graph.find(s, p, o); try { return Iter.count(iter); } finally { iter.close(); } }
/* Count the matches to a pattern across the dataset */ public static long countTriples(DatasetGraph dsg, Node s, Node p, Node o) { Iterator<Quad> iter = dsg.find(Node.ANY, s, p, o); return Iter.count(iter); }