Package org.apache.marmotta.ldclient.model

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


                        }
                    }

                }

                final ClientResponse resp = new ClientResponse(rep);
                resp.setExpires(new Date());
                return resp;

            } catch (Exception e) {
        throw new DataRetrievalException(e);
      } finally {
View Full Code Here


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

            ClientResponse response = new ClientResponse(triples);

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

        log.info("blocked retrieval of resource {}", resource);

        long defaultExpires = client.getClientConfiguration().getDefaultExpiry();
        Date expiresDate = new Date(System.currentTimeMillis() + defaultExpires * 1000);

        ClientResponse result = new ClientResponse(empty_repository);
        result.setExpires(expiresDate);
        return result;
    }
View Full Code Here

                RepositoryConnection con = handler.triples.getConnection();
                log.info("retrieved {} triples for resource {}; expiry date: {}",new Object[] {con.size(),resource,expiresDate});
                con.close();
            }

            ClientResponse result = new ClientResponse(handler.triples);
            result.setExpires(expiresDate);
            return result;
        } catch (RepositoryException e) {
            log.error("error while initialising Sesame repository; classpath problem?",e);
            throw new DataRetrievalException("error while initialising Sesame repository; classpath problem?",e);
        } catch (ClientProtocolException e) {
View Full Code Here

        config.addEndpoint(new StanbolEndpoint("DBPedia (Stanbol Cache)","http://dev.iks-project.eu:8080/entityhub/site/dbpedia/","^http://dbpedia\\.org/resource/.*"));

        LDClientService ldclient = new TestLDClient(new LDClient(config));

        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");
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.