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
        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


        assumeThat("Could not load test-data: demo-data.foaf", rdfXML, notNullValue(InputStream.class));

        RepositoryConnection connectionRDF = repository.getConnection();
        try {
            connectionRDF.add(rdfXML, "http://localhost/foaf/", RDFFormat.RDFXML);
            connectionRDF.commit();
        } finally {
            connectionRDF.close();
        }
        end = System.currentTimeMillis();
View Full Code Here

        assumeThat("Could not load testData from '" + TEST_DATA + "'", rdfXML, notNullValue(InputStream.class));

        RepositoryConnection connection = repository.getConnection();
        try {
            connection.add(rdfXML, "http://localhost/foaf/", RDFFormat.RDFXML);
            connection.commit();
        } finally {
            connection.close();
        }
    }
View Full Code Here

        assumeThat("Could not load testData from '" + TEST_DATA + "'", rdfXML, notNullValue(InputStream.class));

        RepositoryConnection connection = repository.getConnection();
        try {
            connection.add(rdfXML, "http://localhost/foaf/", RDFFormat.RDFXML);
            connection.commit();
        } finally {
            connection.close();
        }
    }
View Full Code Here

        Assert.assertThat(resources, hasItems(
                "http://localhost:8080/LMF/resource/hans_meier",
                "http://localhost:8080/LMF/resource/sepp_huber",
                "http://localhost:8080/LMF/resource/anna_schmidt"
        ));
        connection.commit();
        connection.close();

        end = System.currentTimeMillis();

        log.info("QUERY EVALUATION: {} ms", end-start);
View Full Code Here

        connection.begin();
        connection.setNamespace("ns1","http://localhost/ns1/");
        connection.setNamespace("ns2","http://localhost/ns2/");

        connection.commit();

        Assert.assertEquals("http://localhost/ns1/", connection.getNamespace("ns1"));
        Assert.assertEquals("http://localhost/ns2/", connection.getNamespace("ns2"));
        Assert.assertEquals(2, Iterations.asList(connection.getNamespaces()).size());
        Assert.assertThat(
View Full Code Here

        );

        // update ns1 to a different URL
        connection.begin();
        connection.setNamespace("ns1","http://localhost/ns3/");
        connection.commit();

        Assert.assertEquals("http://localhost/ns3/", connection.getNamespace("ns1"));
        Assert.assertThat(
                Iterations.asList(connection.getNamespaces()),
                CoreMatchers.<Namespace>hasItems(
View Full Code Here


        // remove ns2
        connection.begin();
        connection.removeNamespace("ns2");
        connection.commit();

        connection.begin();
        Assert.assertEquals(1, Iterations.asList(connection.getNamespaces()).size());

View Full Code Here

        connection.begin();
        Assert.assertEquals(1, Iterations.asList(connection.getNamespaces()).size());


        connection.commit();
        connection.close();

    }

View Full Code Here

        assumeThat("Could not load test-data: demo-data.foaf", rdfXML, notNullValue(InputStream.class));

        RepositoryConnection connectionRDF = repository.getConnection();
        try {
            connectionRDF.add(rdfXML, "http://localhost/foaf/", RDFFormat.RDFXML);
            connectionRDF.commit();
        } finally {
            connectionRDF.close();
        }
        // get another connection and check if demo data is available
        RepositoryConnection connection = repository.getConnection();
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.