Package org.openrdf.sail

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


                assertEquals(1, countStatements(sc, uriA, uriB, uriC, false));

                sc.addStatement(uriA, uriB, uriC, uriC);
                assertEquals(2, countStatements(sc, uriA, uriB, uriC, false));
                assertEquals(1, countStatements(sc, uriA, uriB, uriC, false, uriC));
                sc.commit();
            } finally {
                sc.rollback();
                sc.close();
            }
        }
View Full Code Here


                sc.addStatement(uriA, uriA, bNode);
            } catch (SailException se) {
                // FIXME: not supporting blank nodes ATM
                assertTrue(se.getCause() instanceof UnsupportedOperationException);
            }
            sc.commit();
        } finally {
            sc.rollback();
            sc.close();
        }
    }
View Full Code Here

            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");
            sc.addStatement(uriA, uriB, uriC);
            sc.commit();
            sc.begin();

            SPARQLParser parser = new SPARQLParser();
            BindingSet bindings = new EmptyBindingSet();
            String baseURI = "http://example.org/bogus/";
View Full Code Here

            URI uriC = sail.getValueFactory().createURI("http://example.org/uriC");
            SailConnection sc = sail.getConnection();
            try {
                sc.begin();
                sc.clear();
                sc.commit();
                sc.begin();
                events.clear();
                assertEquals(0, events.size());
                sc.addStatement(uriA, uriB, uriC, uriA);
                sc.addStatement(uriB, uriC, uriA, uriA);
View Full Code Here

                assertEquals(0, events.size());
                sc.addStatement(uriA, uriB, uriC, uriA);
                sc.addStatement(uriB, uriC, uriA, uriA);
                // Events are buffered until the commit
                assertEquals(0, events.size());
                sc.commit();
                sc.begin();
                // Only one SailChangedEvent per commit
                assertEquals(1, events.size());
                SailChangedEvent event = events.iterator().next();
                assertTrue(event.statementsAdded());
View Full Code Here

                assertTrue(event.statementsAdded());
                assertFalse(event.statementsRemoved());
                events.clear();
                assertEquals(0, events.size());
                sc.removeStatements(uriA, uriB, uriC, uriA);
                sc.commit();
                sc.begin();
                assertEquals(1, events.size());
                event = events.iterator().next();
                assertFalse(event.statementsAdded());
                assertTrue(event.statementsRemoved());
View Full Code Here

                assertFalse(event.statementsAdded());
                assertTrue(event.statementsRemoved());
                events.clear();
                assertEquals(0, events.size());
                sc.clear();
                sc.commit();
                sc.begin();
                assertEquals(1, events.size());
                event = events.iterator().next();
                assertFalse(event.statementsAdded());
                assertTrue(event.statementsRemoved());
View Full Code Here

            String prefixPrefix = "testns";
            String namePrefix = "http://example.org/test";
            for (int i = 0; i < nTests; i++) {
                sc.setNamespace(prefixPrefix + i, namePrefix + i);
            }
            sc.commit();
            sc.begin();
            namespaces = sc.getNamespaces();
            while (namespaces.hasNext()) {
                Namespace ns = namespaces.next();
                during++;
View Full Code Here

            }
            namespaces.close();
            for (int i = 0; i < nTests; i++) {
                sc.removeNamespace(prefixPrefix + i);
            }
            sc.commit();
            sc.begin();
            namespaces = sc.getNamespaces();
            while (namespaces.hasNext()) {
                namespaces.next();
                after++;
View Full Code Here

            String name = "http://example.org/foo";
            String otherName = "http://example.org/bar";

            sc.removeNamespace(prefix);
            sc.removeNamespace(emptyPrefix);
            sc.commit();
            sc.begin();

            // Namespace initially absent?
            assertNull(sc.getNamespace(prefix));
            assertNull(sc.getNamespace(emptyPrefix));
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.