Package org.openrdf.sail

Examples of org.openrdf.sail.SailConnection.begin()


        addFile(SailTest.class.getResourceAsStream("graph-example-bnodes.trig"), RDFFormat.TRIG);

        sc = sail.getConnection();
        //showStatements(sc, null, null, null);
        try {
            sc.begin();
            assertEquals(14, countStatements(sc, null, null, null, false));
            assertEquals(edgesBefore + 14, countEdges());
            assertEquals(verticesBefore + 10, countVertices());

            sc.removeStatements(ref, null, null);
View Full Code Here


            assertEquals(edgesBefore + 14, countEdges());
            assertEquals(verticesBefore + 10, countVertices());

            sc.removeStatements(ref, null, null);
            sc.commit();
            sc.begin();

            assertEquals(13, countStatements(sc, null, null, null, false));
            assertEquals(edgesBefore + 13, countEdges());
            assertEquals(verticesBefore + 9, countVertices());
View Full Code Here

            assertEquals(edgesBefore + 13, countEdges());
            assertEquals(verticesBefore + 9, countVertices());

            sc.clear();
            sc.commit();
            sc.begin();

            assertEquals(0, countStatements(sc, null, null, null, false));
            assertEquals(0, countEdges());
            // Namespaces vertex is still present.
            assertEquals(verticesBefore, countVertices());
View Full Code Here

        clear();
        int edgesBefore, verticesBefore;

        SailConnection sc = sail.getConnection();
        try {
            sc.begin();
            edgesBefore = countEdges();
            verticesBefore = countVertices();
        } finally {
            sc.rollback();
            sc.close();
View Full Code Here

            sc.commit();
            sc.begin();
            before = countStatements(sc, uriA, uriB, uriC, false);
            sc.addStatement(uriA, uriB, uriC);
            sc.commit();
            sc.begin();
            after = countStatements(sc, uriA, uriB, uriC, false);
            assertEquals(0, before);
            assertEquals(1, after);

            // one specific context, different S,P,O
View Full Code Here

            assertEquals(1, after);

            // one specific context, different S,P,O
            sc.removeStatements(uriA, null, null, uriD);
            sc.commit();
            sc.begin();
            before = countStatements(sc, uriA, uriB, uriC, false, uriD);
            sc.addStatement(uriA, uriB, uriC, uriD);
            sc.commit();
            sc.begin();
            after = countStatements(sc, uriA, uriB, uriC, false, uriD);
View Full Code Here

            sc.commit();
            sc.begin();
            before = countStatements(sc, uriA, uriB, uriC, false, uriD);
            sc.addStatement(uriA, uriB, uriC, uriD);
            sc.commit();
            sc.begin();
            after = countStatements(sc, uriA, uriB, uriC, false, uriD);
            assertEquals(0, before);
            assertEquals(1, after);

            // one specific context, same S,P,O,G
View Full Code Here

            assertEquals(1, after);

            // one specific context, same S,P,O,G
            sc.removeStatements(uriA, null, null, uriA);
            sc.commit();
            sc.begin();
            before = countStatements(sc, uriA, uriB, uriC, false, uriA);
            sc.addStatement(uriA, uriB, uriC, uriA);
            sc.commit();
            sc.begin();
            after = countStatements(sc, uriA, uriB, uriC, false, uriA);
View Full Code Here

            sc.commit();
            sc.begin();
            before = countStatements(sc, uriA, uriB, uriC, false, uriA);
            sc.addStatement(uriA, uriB, uriC, uriA);
            sc.commit();
            sc.begin();
            after = countStatements(sc, uriA, uriB, uriC, false, uriA);
            assertEquals(0, before);
            assertEquals(1, after);
        } finally {
            sc.rollback();
View Full Code Here

    @Test
    public void testGetStatementsP_SOG() throws Exception {
        SailConnection sc = sail.getConnection();
        try {
            sc.begin();
            URI uriA = sail.getValueFactory().createURI("http://example.org/test/P_SOG#a");
            URI uriB = sail.getValueFactory().createURI("http://example.org/test/P_SOG#b");
            URI uriC = sail.getValueFactory().createURI("http://example.org/test/P_SOG#c");
            URI foo = sail.getValueFactory().createURI("http://example.org/ns#foo");
            URI firstName = sail.getValueFactory().createURI("http://example.org/ns#firstName");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.