use of org.apache.jena.graph.TripleBoundary 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);
}
use of org.apache.jena.graph.TripleBoundary in project jena by apache.
the class TestModelExtract method testStatementTripleBoundaryAnon.
public void testStatementTripleBoundaryAnon() {
final TripleBoundary anon = TripleBoundary.stopAtAnonObject;
Assert.assertSame(anon, new StatementTripleBoundary(anon).asTripleBoundary(null));
Assert.assertFalse(new StatementTripleBoundary(anon).stopAt(ModelHelper.statement("s P o")));
Assert.assertTrue(new StatementTripleBoundary(anon).stopAt(ModelHelper.statement("s P _o")));
}
use of org.apache.jena.graph.TripleBoundary in project jena by apache.
the class TestModelExtract method testStatementTripleBoundaryNowhere.
public void testStatementTripleBoundaryNowhere() {
final TripleBoundary nowhere = TripleBoundary.stopNowhere;
Assert.assertSame(nowhere, new StatementTripleBoundary(nowhere).asTripleBoundary(null));
Assert.assertFalse(new StatementTripleBoundary(nowhere).stopAt(ModelHelper.statement("s P _o")));
Assert.assertFalse(new StatementTripleBoundary(nowhere).stopAt(ModelHelper.statement("s P o")));
}
Aggregations