Package org.openrdf.sail

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


            // Add statement to the implicit null context.
            sc.removeStatements(null, null, null);
            before = countStatements(sc, uriA, uriB, null, false);
            sc.addStatement(uriA, uriB, uriC);
            sc.commit();
            sc.begin();
            after = countStatements(sc, uriA, uriB, null, false);
            assertEquals(0, before);
            assertEquals(1, after);
        } finally {
            sc.rollback();
View Full Code Here


    @Test
    public void testGetStatementsO_SPG() throws Exception {
        SailConnection sc = sail.getConnection();
        try {
            sc.begin();
            URI uriA = sail.getValueFactory().createURI("http://example.org/test/O_SPG#a");
            URI uriB = sail.getValueFactory().createURI("http://example.org/test/O_SPG#b");
            URI uriC = sail.getValueFactory().createURI("http://example.org/test/O_SPG#c");
            Literal plainLitA = sail.getValueFactory().createLiteral("arbitrary plain literal 9548734867");
            Literal stringLitA = sail.getValueFactory().createLiteral("arbitrary string literal 8765", XMLSchema.STRING);
View Full Code Here

            int before, after;

            // Add statement to a specific context.
            sc.removeStatements(null, null, uriA, uriA);
            sc.commit();
            sc.begin();
            before = countStatements(sc, null, null, uriA, false);
            sc.addStatement(uriB, uriC, uriA);
            sc.commit();
            sc.begin();
            after = countStatements(sc, null, null, uriA, false);
View Full Code Here

            sc.commit();
            sc.begin();
            before = countStatements(sc, null, null, uriA, false);
            sc.addStatement(uriB, uriC, uriA);
            sc.commit();
            sc.begin();
            after = countStatements(sc, null, null, uriA, 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, null, plainLitA, false);
            sc.addStatement(uriA, uriA, plainLitA);
            sc.commit();
            sc.begin();
            after = countStatements(sc, null, null, plainLitA, false);
View Full Code Here

            sc.commit();
            sc.begin();
            before = countStatements(sc, null, null, plainLitA, false);
            sc.addStatement(uriA, uriA, plainLitA);
            sc.commit();
            sc.begin();
            after = countStatements(sc, null, null, 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, plainLitA);
            sc.commit();
            sc.begin();
            before = countStatements(sc, null, null, stringLitA, false);
            sc.addStatement(uriA, uriA, stringLitA);
            sc.commit();
            sc.begin();
            after = countStatements(sc, null, null, stringLitA, false);
View Full Code Here

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

    @Test
    public void testGetStatementsPO_SG() throws Exception {
        SailConnection sc = sail.getConnection();
        try {
            sc.begin();
            URI uriA = sail.getValueFactory().createURI("http://example.org/test/PO_SG#a");
            URI uriB = sail.getValueFactory().createURI("http://example.org/test/PO_SG#b");
            URI foo = sail.getValueFactory().createURI("http://example.org/ns#foo");
            URI firstName = sail.getValueFactory().createURI("http://example.org/ns#firstName");
            Literal plainLitA = sail.getValueFactory().createLiteral("arbitrary plain literal 8765675");
View Full Code Here

            int before, after;

            // Add statement to the implicit null context.
            sc.removeStatements(null, null, null, uriA);
            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);
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.