/** Assert that <code>g</code> contains every triple in <code>other</code>. */ public void testContains( Graph g, Graph other ) { testContains( g, GraphUtil.findAll( other ) ); }
/** * Delete triples in {@code srcGraph} from {@code dstGraph} * by looping on {@code srcGraph}. * */ public static void deleteLoopSrc(Graph dstGraph, Graph srcGraph) { deleteIteratorWorker(dstGraph, findAll(srcGraph)) ; dstGraph.getEventManager().notifyDeleteGraph(dstGraph, srcGraph) ; }
/** Assert that <code>g</code> contains none of the triples in <code>other</code>. */ public void testOmits( Graph g, Graph other ) { testOmits( g, GraphUtil.findAll( other ) ); }
/** Assert that <code>g</code> contains none of the triples in <code>other</code>. */ public void testOmits( Graph g, Graph other ) { testOmits( g, GraphUtil.findAll( other ) ); }
/** * Assert that <code>g</code> contains every triple in <code>other</code>. */ public static void testContains(Graph g, Graph other) { testContains(g, GraphUtil.findAll(other)); }
/** * Assert that <code>g</code> contains none of the triples in * <code>other</code>. */ public static void testOmits(Graph g, Graph other) { testOmits(g, GraphUtil.findAll(other)); }
/** Assert that <code>g</code> contains every triple in <code>other</code>. */ public void testContains( Graph g, Graph other ) { testContains( g, GraphUtil.findAll( other ) ); }
/** * Assert that <code>g</code> contains none of the triples in * <code>other</code>. */ public static void testOmits(Graph g, Graph other) { testOmits(g, GraphUtil.findAll(other)); }
/** * Delete triples in {@code srcGraph} from {@code dstGraph} * by looping on {@code srcGraph}. * */ public static void deleteLoopSrc(Graph dstGraph, Graph srcGraph) { deleteIteratorWorker(dstGraph, findAll(srcGraph)) ; dstGraph.getEventManager().notifyDeleteGraph(dstGraph, srcGraph) ; }
static public int hashCode(Graph g) { ClosableIterator<Triple> ci = GraphUtil.findAll( g ); int hash = 0; GraphMatcher gm = new GraphMatcher(g); while ( ci.hasNext() ) { Triple t = ci.next(); hash += gm.new AnonStatement(t).myHashCode(null); } return hash; } /**
static public int hashCode(Graph g) { ClosableIterator<Triple> ci = GraphUtil.findAll( g ); int hash = 0; GraphMatcher gm = new GraphMatcher(g); while ( ci.hasNext() ) { Triple t = ci.next(); hash += gm.new AnonStatement(t).myHashCode(null); } return hash; } /**
public void testX() { MultiUnion mu = multi( "a P b; !b Q c; ~c R d", "" ); for (ExtendedIterator<Triple> it = GraphUtil.findAll( mu ); it.hasNext();) { System.err.println( "]] " + it.next() ); } }
public void testX() { MultiUnion mu = multi( "a P b; !b Q c; ~c R d", "" ); for (ExtendedIterator<Triple> it = GraphUtil.findAll( mu ); it.hasNext();) { System.err.println( "]] " + it.next() ); } }
/** * Find all the base triples matching tm, exclude the ones that are deleted, * add the ones that have been added. */ @Override protected ExtendedIterator<Triple> graphBaseFind(Triple t) { ExtendedIterator<Triple> iterator = base.find(t).filterDrop(ifIn(GraphUtil.findAll(deletions))).andThen(additions.find(t)) ; return SimpleEventManager.notifyingRemove( this, iterator ) ; }
/** * Find all the base triples matching tm, exclude the ones that are deleted, * add the ones that have been added. */ @Override protected ExtendedIterator<Triple> graphBaseFind(Triple t) { ExtendedIterator<Triple> iterator = base.find(t).filterDrop(ifIn(GraphUtil.findAll(deletions))).andThen(additions.find(t)) ; return SimpleEventManager.notifyingRemove( this, iterator ) ; }
/** * Answer a string which is a newline-separated list of triples (as produced * by niceTriple) in the graph <code>g</code>. The map <code>bnodes</code> * maps already-seen bnodes to their "nice" strings. */ public static String nice(Graph g, Map<Node, Object> bnodes) { StringBuffer b = new StringBuffer(g.size() * 100); ExtendedIterator<Triple> it = GraphUtil.findAll(g); while (it.hasNext()) niceTriple(b, bnodes, it.next()); return b.toString(); }
/** Answer a string which is a newline-separated list of triples (as produced by niceTriple) in the graph <code>g</code>. The map <code>bnodes</code> maps already-seen bnodes to their "nice" strings. */ public static String nice( Graph g, Map<Node, Object> bnodes ) { StringBuffer b = new StringBuffer( g.size() * 100 ); ExtendedIterator<Triple> it = GraphUtil.findAll( g ); while (it.hasNext()) niceTriple( b, bnodes, it.next() ); return b.toString(); }
/** Answer a string which is a newline-separated list of triples (as produced by niceTriple) in the graph <code>g</code>. The map <code>bnodes</code> maps already-seen bnodes to their "nice" strings. */ public static String nice( Graph g, Map<Node, Object> bnodes ) { StringBuffer b = new StringBuffer( g.size() * 100 ); ExtendedIterator<Triple> it = GraphUtil.findAll( g ); while (it.hasNext()) niceTriple( b, bnodes, it.next() ); return b.toString(); }
/** Add triples into the destination (arg 1) from the source (arg 2)*/ public static void addInto(Graph dstGraph, Graph srcGraph ) { if ( dstGraph == srcGraph && ! dstGraph.getEventManager().listening() ) return ; dstGraph.getPrefixMapping().setNsPrefixes(srcGraph.getPrefixMapping()) ; addIteratorWorker(dstGraph, findAll( srcGraph )); dstGraph.getEventManager().notifyAddGraph( dstGraph, srcGraph ); }
/** Add triples into the destination (arg 1) from the source (arg 2)*/ public static void addInto(Graph dstGraph, Graph srcGraph ) { if ( dstGraph == srcGraph && ! dstGraph.getEventManager().listening() ) return ; dstGraph.getPrefixMapping().setNsPrefixes(srcGraph.getPrefixMapping()) ; addIteratorWorker(dstGraph, findAll( srcGraph )); dstGraph.getEventManager().notifyAddGraph( dstGraph, srcGraph ); }