Package org.openrdf.repository

Examples of org.openrdf.repository.RepositoryConnection.commit()


        // query all triples for http://marmotta.apache.org/testing/ns1/R2, should be 3
        List<Statement> s2_r2_triples = asList(snapshot2.getStatements(repository.getValueFactory().createURI("http://marmotta.apache.org/testing/ns1/R2"), null, null, true));
        Assert.assertEquals(3, s2_r2_triples.size());

        snapshot2.commit();
        snapshot2.close();


        // test snapshot connection for now (i.e. after both updates)
        RepositoryConnection snapshot3 = repository.getSnapshot(new Date());
View Full Code Here


        // query all triples for http://marmotta.apache.org/testing/ns1/R2, should be 3
        List<Statement> s3_r2_triples = asList(snapshot3.getStatements(repository.getValueFactory().createURI("http://marmotta.apache.org/testing/ns1/R2"), null, null, true));
        Assert.assertEquals(3, s3_r2_triples.size());

        snapshot3.commit();
        snapshot3.close();

    }

    @Test
View Full Code Here

        assumeThat("Could not load test-data: version-base.rdf", baseData, notNullValue(InputStream.class));

        RepositoryConnection connectionBase = repository.getConnection();
        try {
            connectionBase.add(baseData, "http://marmotta.apache.org/testing/ns1/", RDFFormat.RDFXML);
            connectionBase.commit();
        } finally {
            connectionBase.close();
        }

        Thread.sleep(1000);
View Full Code Here

        assumeThat("Could not load test-data: version-update1.rdf", update1Data, notNullValue(InputStream.class));

        RepositoryConnection connectionUpdate1 = repository.getConnection();
        try {
            connectionUpdate1.add(update1Data, "http://marmotta.apache.org/testing/ns1/", RDFFormat.RDFXML);
            connectionUpdate1.commit();
        } finally {
            connectionUpdate1.close();
        }

        Thread.sleep(1000);
View Full Code Here

        assumeThat("Could not load test-data: version-update2.rdf", update2Data, notNullValue(InputStream.class));

        RepositoryConnection connectionUpdate2 = repository.getConnection();
        try {
            connectionUpdate2.add(update2Data, "http://marmotta.apache.org/testing/ns1/", RDFFormat.RDFXML);
            connectionUpdate2.commit();
        } finally {
            connectionUpdate2.close();
        }

View Full Code Here

        // query all triples for http://marmotta.apache.org/testing/ns1/R2, should be zero
        BooleanQuery query1_2 = snapshot1.prepareBooleanQuery(QueryLanguage.SPARQL, "ASK { <http://marmotta.apache.org/testing/ns1/R2> ?p ?o }");
        Assert.assertFalse("SPARQL query for R2 did not return false", query1_2.evaluate());

        snapshot1.commit();
        snapshot1.close();

        // test snapshot connection for date3 (i.e. after first update)
        RepositoryConnection snapshot2 = repository.getSnapshot(date3);
View Full Code Here

        // query all triples for http://marmotta.apache.org/testing/ns1/R2, should be 3
        BooleanQuery query2_2 = snapshot2.prepareBooleanQuery(QueryLanguage.SPARQL, "ASK { <http://marmotta.apache.org/testing/ns1/R2> ?p ?o }");
        Assert.assertTrue("SPARQL query for R2 did not return true", query2_2.evaluate());

        snapshot2.commit();
        snapshot2.close();


    }
View Full Code Here

        final RepositoryConnection con = loader.getRepository().getConnection();
        try {
            con.begin();
            testRepoContent(con);
            con.commit();
        } finally {
            if (con.isActive()) {
                con.rollback();
            }
            con.close();
View Full Code Here

        final RepositoryConnection con = loader.getRepository().getConnection();
        try {
            con.begin();
            testRepoContent(con);
            con.commit();
        } finally {
            if (con.isActive()) {
                con.rollback();
            }
            con.close();
View Full Code Here

        final RepositoryConnection con = loader.getRepository().getConnection();
        try {
            con.begin();
            testRepoContent(con);
            con.commit();
        } finally {
            if (con.isActive()) {
                con.rollback();
            }
            con.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.