Package org.apache.marmotta.ldclient.model

Examples of org.apache.marmotta.ldclient.model.ClientResponse


     */
    @Test
    public void testGeoNames() throws Exception {
        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");
View Full Code Here


     *
     */
    @Test
    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");
View Full Code Here

     * @throws Exception
     *
     */
    @Test
    public void testFoafWikier() throws Exception {
        ClientResponse response = ldclient.retrieveResource(WIKIER);

        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("foaf-wikier.sparql");
View Full Code Here

     * @throws Exception
     *
     */
    @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

     */
    @Test
    public void testArticle() throws Exception {

        String uriArticle = "http://en.wikipedia.org/wiki/Marmot";
        ClientResponse respArticle = ldclient.retrieveResource(uriArticle);

        RepositoryConnection conArticle = respArticle.getTriples().getConnection();
        conArticle.begin();
        Assert.assertTrue(conArticle.size() > 0);

        // run a SPARQL test to see if the returned data is correct
        InputStream sparql = this.getClass().getResourceAsStream("wikipedia-marmot.sparql");
View Full Code Here

    @GET
    @Path("/live")
    public Response retrieveLive(@QueryParam("uri") String uri) {
        if(cacheSailProvider.isEnabled()) {
            try {
                ClientResponse response = cacheSailProvider.getLDClient().retrieveResource(uri);

                RepositoryConnection con = response.getTriples().getConnection();
                con.begin();

                ByteArrayOutputStream out = new ByteArrayOutputStream();
                RDFHandler handler = new RDFXMLPrettyWriter(out);
                con.export(handler);
View Full Code Here

     */
    @Test
    public void testVideo() throws Exception {

        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

     */
    @Test
    public void testChannel() throws Exception {

        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

                throw new DataRetrievalException("could not load resource data for file "+filename);
            } finally {
                con.close();
            }

            ClientResponse response = new ClientResponse(200, triples);

            return response;
        } catch (RepositoryException e) {
            throw new DataRetrievalException("could not load resource data for file "+filename);
        }
View Full Code Here

                throw new DataRetrievalException("could not load resource data for file "+filename);
            } finally {
                con.close();
            }

            ClientResponse response = new ClientResponse(200, triples);

            return response;
        } catch (RepositoryException e) {
            throw new DataRetrievalException("could not load resource data for file "+filename);
        }
View Full Code Here

TOP

Related Classes of org.apache.marmotta.ldclient.model.ClientResponse

Copyright © 2018 www.massapicom. 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.