/** * Compare two graphs for equality. * <p> * Note: This is not very efficient if the {@link Graph} implementations are * not indexed. * <p> * Note: This does not handle equality testing with blank nodes (it does not * test for isomorphic graphs). * * @param expected * @param actual */ static protected void assertSameGraph(final Graph expected, final Graph actual) { for (Statement s : expected) { if (!actual.contains(s)) fail("Expecting: " + s); } assertEquals("size", expected.size(), actual.size()); }
@Override public void handleStatement(Statement st) throws RDFHandlerException { synchronized (bufferLock) { bufferedStatements.add(st); contexts.add(st.getContext()); if (bufferedStatements.size() >= this.bufferSize) { processBuffer(); } } }
case DESCRIBE: case CONSTRUCT: nresults = buildGraph(conn).size(); break; case ASK: // I think that there are some alternative mime types for ask...
case DESCRIBE: case CONSTRUCT: nresults = buildGraph(conn).size(); break; case ASK: // I think that there are some alternative mime types for ask...
/** * Compare two graphs for equality. * <p> * Note: This is not very efficient if the {@link Graph} implementations are * not indexed. * <p> * Note: This does not handle equality testing with blank nodes (it does not * test for isomorphic graphs). * * @param expected * @param actual */ static protected void assertSameGraph(final Graph expected, final Graph actual) { for (Statement s : expected) { if (!actual.contains(s)) fail("Expecting: " + s); } assertEquals("size", expected.size(), actual.size()); }
assertEquals(1, g2.size());
assertEquals(1, g2.size());