Package org.openrdf.repository

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


        try {
            Map<String,Object> data = mapper.readValue(in, new TypeReference<Map<String,Object>>() { });

            RepositoryConnection con = repository.getConnection();
            try {
                con.begin();

                ValueFactory vf = repository.getValueFactory();

                URI subject = vf.createURI(resourceUri);
View Full Code Here


     */
    @Test(expected=DataRetrievalException.class)
    public void testNotRDF() throws Exception {
        ClientResponse response = ldclient.retrieveResource(EXAMPLE);
        RepositoryConnection conn = response.getTriples().getConnection();
        conn.begin();
        Assert.assertTrue(conn.size() == 0);
        conn.commit();
        conn.close();
    }

View Full Code Here

        String uriBerlin = "http://dbpedia.org/resource/Berlin";
        ClientResponse respBerlin = ldclient.retrieveResource(uriBerlin);

        RepositoryConnection conBerlin = respBerlin.getTriples().getConnection();
        conBerlin.begin();
        Assert.assertTrue(conBerlin.size() > 0);

        // run a SPARQL test to see if the returned data is correct
        InputStream sparql = this.getClass().getResourceAsStream("dbpedia-berlin.sparql");
        BooleanQuery testLabel = conBerlin.prepareBooleanQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
View Full Code Here

        String uriLMFVideo = "http://vimeo.com/7223527";
        ClientResponse respLMFVideo = ldclient.retrieveResource(uriLMFVideo);

        RepositoryConnection conLMFVideo = respLMFVideo.getTriples().getConnection();
        conLMFVideo.begin();
        Assert.assertTrue(conLMFVideo.size() > 0);

        conLMFVideo.export(Rio.createWriter(RDFFormat.TURTLE, System.out));

View Full Code Here

        String uriChannel = "http://vimeo.com/channels/ninlive09";
        ClientResponse respChannel = ldclient.retrieveResource(uriChannel);

        RepositoryConnection conChannel = respChannel.getTriples().getConnection();
        conChannel.begin();
        Assert.assertTrue(conChannel.size() > 0);

        conChannel.export(Rio.createWriter(RDFFormat.TURTLE, System.out));

View Full Code Here

        ClientConfiguration config = new ClientConfiguration();
        config.addEndpoint(endpoint);
        LDClientService ldclient = new TestLDClient(new LDClient(config));
        ClientResponse response = ldclient.retrieveResource(resource);
        RepositoryConnection connection = response.getTriples().getConnection();
        connection.begin();
        Assert.assertTrue(connection.size() > 0);
        connection.commit();
        connection.close();
    }
View Full Code Here

        String uriBerlin = "http://dbpedia.org/resource/Berlin";
        ClientResponse respBerlin = ldclient.retrieveResource(uriBerlin);

        RepositoryConnection conBerlin = respBerlin.getTriples().getConnection();
        conBerlin.begin();
        Assert.assertTrue(conBerlin.size() > 0);

        // run a SPARQL test to see if the returned data is correct
        InputStream sparql = this.getClass().getResourceAsStream("dbpedia-berlin.sparql");
        BooleanQuery testLabel = conBerlin.prepareBooleanQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
View Full Code Here

        Assume.assumeTrue(ldclient.ping(DBPEDIA));
       
        ClientResponse respBerlin = ldclient.retrieveResource(DBPEDIA);

        RepositoryConnection conBerlin = respBerlin.getTriples().getConnection();
        conBerlin.begin();
        Assert.assertTrue(conBerlin.size() > 0);

        // run a SPARQL test to see if the returned data is correct
        InputStream sparql = this.getClass().getResourceAsStream("dbpedia-berlin.sparql");
        BooleanQuery testLabel = conBerlin.prepareBooleanQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
View Full Code Here

        Assume.assumeTrue(ldclient.ping(GEONAMES));
       
        ClientResponse respEmbrun = ldclient.retrieveResource(GEONAMES);

        RepositoryConnection conEmbrun = respEmbrun.getTriples().getConnection();
        conEmbrun.begin();
        Assert.assertTrue(conEmbrun.size() > 0);

        // run a SPARQL test to see if the returned data is correct
        InputStream sparql = this.getClass().getResourceAsStream("geonames-embrun.sparql");
        BooleanQuery testLabel = conEmbrun.prepareBooleanQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
View Full Code Here

    public void testRDFOhloh() throws Exception {
      Assume.assumeTrue(ldclient.ping(MARMOTTA));
        ClientResponse response = ldclient.retrieveResource(MARMOTTA);

        RepositoryConnection conn = response.getTriples().getConnection();
        conn.begin();
        Assert.assertTrue(conn.size() > 0);

        // run a SPARQL test to see if the returned data is correct
        InputStream sparql = this.getClass().getResourceAsStream("ohloh-marmotta.sparql");
        BooleanQuery testLabel = conn.prepareBooleanQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
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.