Package org.openrdf.sail

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


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

        } finally {
View Full Code Here


    @Test
    public void testGetStatementsWithVariableContexts() throws Exception {
        SailConnection sc = sail.getConnection();
        try {
            sc.begin();
            URI uriA = sail.getValueFactory().createURI("http://example.org/uriA");
            URI uriB = sail.getValueFactory().createURI("http://example.org/uriB");
            URI uriC = sail.getValueFactory().createURI("http://example.org/uriC");
            int count;
            sc.clear();
View Full Code Here

            URI uriC = sail.getValueFactory().createURI("http://example.org/uriC");
            int count;
            sc.clear();
            //sc.removeStatements(uriA, uriA, uriA);
            sc.commit();
            sc.begin();
            Resource[] contexts = {uriA, null};
            sc.addStatement(uriA, uriB, uriC, contexts);
            sc.commit();
            sc.begin();
View Full Code Here

            sc.commit();
            sc.begin();
            Resource[] contexts = {uriA, null};
            sc.addStatement(uriA, uriB, uriC, contexts);
            sc.commit();
            sc.begin();

            // Get statements from all contexts.
            count = countStatements(sc, uriA, null, null, false);
            assertEquals(2, count);
View Full Code Here

    @Test
    public void testRemoveStatements() throws Exception {
        SailConnection sc = sail.getConnection();
        try {
            sc.begin();
            URI uriA = sail.getValueFactory().createURI("http://example.org/uriA");
            URI uriB = sail.getValueFactory().createURI("http://example.org/uriB");
            URI uriC = sail.getValueFactory().createURI("http://example.org/uriC");
            Resource[] contexts = {uriA, null};
            int count;
View Full Code Here

            int count;

            // Remove from all contexts.
            sc.removeStatements(uriA, null, null);
            sc.commit();
            sc.begin();
            count = countStatements(sc, uriA, null, null, false);
            assertEquals(0, count);
            sc.addStatement(uriA, uriB, uriC, contexts);
            sc.commit();
            sc.begin();
View Full Code Here

            sc.begin();
            count = countStatements(sc, uriA, null, null, false);
            assertEquals(0, count);
            sc.addStatement(uriA, uriB, uriC, contexts);
            sc.commit();
            sc.begin();
            count = countStatements(sc, uriA, null, null, false);
            assertEquals(2, count);
            sc.removeStatements(uriA, null, null);
            sc.commit();
            sc.begin();
View Full Code Here

            sc.begin();
            count = countStatements(sc, uriA, null, null, false);
            assertEquals(2, count);
            sc.removeStatements(uriA, null, null);
            sc.commit();
            sc.begin();
            count = countStatements(sc, uriA, null, null, false);
            assertEquals(0, count);

            // Remove from one partition context.
            sc.removeStatements(uriA, null, null);
View Full Code Here

            assertEquals(0, count);

            // Remove from one partition context.
            sc.removeStatements(uriA, null, null);
            sc.commit();
            sc.begin();
            count = countStatements(sc, uriA, null, null, false);
            assertEquals(0, count);
            sc.addStatement(uriA, uriB, uriC, contexts);
            sc.commit();
            sc.begin();
View Full Code Here

            sc.begin();
            count = countStatements(sc, uriA, null, null, false);
            assertEquals(0, count);
            sc.addStatement(uriA, uriB, uriC, contexts);
            sc.commit();
            sc.begin();
            count = countStatements(sc, uriA, null, null, false);
            assertEquals(2, count);
            Resource[] oneContext = {uriA};
            sc.removeStatements(uriA, null, null, oneContext);
            sc.commit();
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.