use of org.apache.jena.sparql.sse.Item in project jena by apache.
the class Stats method format.
private static Item format(Map<Node, Integer> predicates, Map<Node, Integer> types, long count) {
Item stats = Item.createList();
ItemList statsList = stats.getList();
statsList.add("stats");
Item meta = createTagged(StatsMatcher.META);
addPair(meta.getList(), "timestamp", NodeFactoryExtra.nowAsDateTime());
addPair(meta.getList(), "run@", DateTimeUtils.nowAsString());
if (count >= 0)
addPair(meta.getList(), StatsMatcher.COUNT, NodeFactoryExtra.intToNode((int) count));
statsList.add(meta);
for (Entry<Node, Integer> entry : types.entrySet()) {
Node type = entry.getKey();
addTypeTriple(statsList, type, NodeFactoryExtra.intToNode(entry.getValue()));
}
for (Entry<Node, Integer> entry : predicates.entrySet()) {
Node node = entry.getKey();
// Skip these - they just clog things up!
if (node.getURI().startsWith("http://www.w3.org/1999/02/22-rdf-syntax-ns#_"))
continue;
addPair(statsList, node, NodeFactoryExtra.intToNode(entry.getValue()));
}
// Add a default rule.
addPair(statsList, StatsMatcher.OTHER, ZERO);
return stats;
}
use of org.apache.jena.sparql.sse.Item in project jena by apache.
the class TestConcurrentAccess method buildGraph.
private static Graph buildGraph() {
Item item = SSE.parse(data);
Graph g = BuilderGraph.buildGraph(item);
return g;
}
use of org.apache.jena.sparql.sse.Item in project jena by apache.
the class TestSSE_Forms method testPrefix_05.
@Test
public void testPrefix_05() {
Item r = SSE.parse("(<http://example/abc>)", null);
testItem("(prefix ((ex: <http://example/>)) ( (prefix ((x: <http://EXAMPLE/>)) ex:abc) ))", r);
}
use of org.apache.jena.sparql.sse.Item in project jena by apache.
the class TestSSE_Forms method testBase_06.
@Test
public void testBase_06() {
Item r = SSE.parse("(<http://example/xyz> <http://EXAMPLE/other#foo>)", null);
testItem("(base <http://example/> (<xyz> (base <http://EXAMPLE/other> <#foo>)))", r);
}
use of org.apache.jena.sparql.sse.Item in project jena by apache.
the class TestSSE_Forms method testBase_02.
@Test
public void testBase_02() {
Item r = Item.createNode(NodeFactory.createURI("http://example/x"));
testItem("(base <http://HOST/> (base <http://example/xyz> <x>))", r);
}
Aggregations