use of org.apache.jena.graph.Graph in project jena by apache.
the class TestGraphUnionRead method gr_union_05.
@Test
public void gr_union_05() {
List<Node> gnodes = list();
Graph g = new GraphUnionRead(dsg, gnodes);
long x = Iter.count(g.find(null, null, null));
assertEquals(0, x);
}
use of org.apache.jena.graph.Graph in project jena by apache.
the class TestGraphUnionRead method gr_union_02.
@Test
public void gr_union_02() {
List<Node> gnodes = list(gn1, gn2);
Graph g = new GraphUnionRead(dsg, gnodes);
Node s = NodeFactory.createURI("http://example/s");
long x = Iter.count(g.find(s, null, null));
assertEquals(3, x);
}
use of org.apache.jena.graph.Graph in project jena by apache.
the class AbstractTestUpdateBase method defaultGraphData.
protected void defaultGraphData(DatasetGraph gStore, Graph data) {
Graph g = gStore.getDefaultGraph();
g.clear();
GraphUtil.addInto(g, data);
}
use of org.apache.jena.graph.Graph in project jena by apache.
the class AbstractTestUpdateBase method namedGraphData.
protected void namedGraphData(DatasetGraph gStore, Node uri, Graph data) {
Graph g = gStore.getGraph(uri);
if (g == null) {
gStore.addGraph(uri, GraphFactory.createJenaDefaultGraph());
g = gStore.getGraph(uri);
} else
g.clear();
GraphUtil.addInto(g, data);
}
use of org.apache.jena.graph.Graph in project jena by apache.
the class ModelExtract method extractInto.
/**
Answer <code>model</code> after updating it with the sub-graph of
<code>s</code> rooted at <code>r</code>, bounded by this instances
<code>boundary</code>.
*/
public Model extractInto(Model model, Resource r, Model s) {
TripleBoundary tb = boundary.asTripleBoundary(s);
Graph g = getGraphExtract(tb).extractInto(model.getGraph(), r.asNode(), s.getGraph());
return ModelFactory.createModelForGraph(g);
}
Aggregations