/** Answer a new graph which is the reachable subgraph from <code>node</code> in <code>graph</code> with the terminating condition given by the TripleBoundary passed to the constructor. */ public Graph extract( Node node, Graph graph ) { return extractInto( Factory.createGraphMem(), node, graph ); }
/** 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 ); }