Package org.openrdf.sail

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


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

            // Add plain literal statement to the default context.
View Full Code Here


            assertEquals(1, after);

            // Add plain literal statement to the default context.
            sc.removeStatements(null, null, plainLitA);
            sc.commit();
            sc.begin();
            before = countStatements(sc, null, uriA, plainLitA, false);
            sc.addStatement(uriA, uriA, plainLitA);
            sc.addStatement(uriA, uriB, plainLitA);
            sc.addStatement(uriB, uriB, plainLitA);
            sc.commit();
View Full Code Here

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

            // Add string-typed literal statement to the default context.
View Full Code Here

            assertEquals(1, after);

            // Add string-typed literal statement to the default context.
            sc.removeStatements(null, null, fooLabel);
            sc.commit();
            sc.begin();
            before = countStatements(sc, null, firstName, fooLabel, false);
            sc.addStatement(foo, firstName, fooLabel);
            sc.commit();
            sc.begin();
            after = countStatements(sc, null, firstName, fooLabel, false);
View Full Code Here

            sc.commit();
            sc.begin();
            before = countStatements(sc, null, firstName, fooLabel, false);
            sc.addStatement(foo, firstName, fooLabel);
            sc.commit();
            sc.begin();
            after = countStatements(sc, null, firstName, fooLabel, false);
            assertEquals(0, before);
            assertEquals(1, after);
            assertEquals(foo, toSet(sc.getStatements(null, firstName, fooLabel, false)).iterator().next().getSubject());
View Full Code Here

    @Test
    public void testGetStatementsSPO_G() throws Exception {
        SailConnection sc = sail.getConnection();
        try {
            sc.begin();
            URI uriA = sail.getValueFactory().createURI("http://example.org/test/S_POG#a");
            URI uriB = sail.getValueFactory().createURI("http://example.org/test/S_POG#b");
            URI uriC = sail.getValueFactory().createURI("http://example.org/test/S_POG#c");
            URI uriD = sail.getValueFactory().createURI("http://example.org/test/S_POG#d");
            int before, after;
View Full Code Here

            int before, after;

            // default context, different S,P,O
            sc.removeStatements(uriA, null, null);
            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);
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);

            // default context, same S,P,O
View Full Code Here

            assertEquals(1, after);

            // default context, same S,P,O
            sc.removeStatements(uriA, null, null);
            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);
View Full Code Here

        clear();
        int edgesBefore, verticesBefore;

        SailConnection sc = sail.getConnection();
        try {
            sc.begin();
            edgesBefore = countEdges();
            verticesBefore = countVertices();
        } finally {
            sc.commit();
            sc.close();
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.