use of org.apache.jena.tdb2.solver.stats.StatsResults in project jena by apache.
the class TestStats method statsForDftGraph.
private StatsResults statsForDftGraph() {
// StatsCollectorNodeId writes nodes for rdf:type (this is not good).
return Txn.calculateWrite(dsg, () -> {
Iterator<Tuple<NodeId>> iter = triples.findAll();
StatsCollectorNodeId stats = new StatsCollectorNodeId(nt);
for (; iter.hasNext(); ) {
Tuple<NodeId> t = iter.next();
stats.record(null, t.get(0), t.get(1), t.get(2));
}
return stats.results();
});
}
use of org.apache.jena.tdb2.solver.stats.StatsResults in project jena by apache.
the class TestStats method statsForGraph.
private StatsResults statsForGraph(NodeId gid) {
// StatsCollectorNodeId writes nodes for rdf:type (this is not good).
return Txn.calculateWrite(dsg, () -> {
Iterator<Tuple<NodeId>> iter = quads.find(gid, null, null, null);
StatsCollectorNodeId stats = new StatsCollectorNodeId(nt);
for (; iter.hasNext(); ) {
Tuple<NodeId> t = iter.next();
stats.record(t.get(0), t.get(1), t.get(2), t.get(3));
}
return stats.results();
});
}
use of org.apache.jena.tdb2.solver.stats.StatsResults in project jena by apache.
the class TestStats method stats_03.
@Test
public void stats_03() {
NodeId gid = nt.getNodeIdForNode(NodeFactory.createURI("g2"));
StatsResults r = statsForGraph(gid);
assertEquals(2, r.getCount());
assertEquals(1, r.getPredicates().keySet().size());
}
Aggregations