Package org.openrdf.repository

Examples of org.openrdf.repository.Repository.initialize()


        InputStream rss = this.getClass().getResourceAsStream(fileName + ".rss");
        InputStream sparql = this.getClass().getResourceAsStream(fileName+".sparql");
        assumeThat("Could not load testfiles", asList(rss, sparql), everyItem(notNullValue(InputStream.class)));

        Repository repository = new SailRepository(new MemoryStore());
        repository.initialize();

        RepositoryConnection connection = repository.getConnection();
        try {
            connection.add(rss, "http://localhost/rss/", RSSFormat.FORMAT);
            connection.commit();
View Full Code Here


        InputStream vcard = this.getClass().getResourceAsStream(fileName+".vcf");
        InputStream sparql = this.getClass().getResourceAsStream(fileName+".sparql");
        assumeThat("Could not load testfiles", asList(vcard, sparql), everyItem(notNullValue(InputStream.class)));

        Repository repository = new SailRepository(new MemoryStore());
        repository.initialize();

        RepositoryConnection connection = repository.getConnection();
        try {
            connection.add(vcard,"http://localhost/vcard/", VCardFormat.FORMAT);
            connection.commit();
View Full Code Here

    private void testGetBase(RDFFormat format) throws Exception {
        String data = given().header("Accept",format.getDefaultMIMEType()).expect().statusCode(200).when().get(createResourceURI("sepp_huber").stringValue()).asString();

        Repository mem = new SailRepository(new MemoryStore());
        mem.initialize();

        RepositoryConnection con = mem.getConnection();
        RepositoryConnection icon = sesameService.getConnection();
        try {
            con.begin();
View Full Code Here

        given().header("Accept",format.getDefaultMIMEType()).expect().statusCode(404).when().get(resource1.stringValue());


        // create resource 2 with some triples that we generate randomly in a temporary repository
        Repository mem = new SailRepository(new MemoryStore());
        mem.initialize();

        RepositoryConnection con = mem.getConnection();
        RepositoryConnection mcon = sesameService.getConnection();
        try {
            for(int i=0; i < rnd.nextInt(20); i++ ) {
View Full Code Here

        String prefix = getEndpointSuffix(endpoint);
        try {
            final LdapConnection ldap = openLdapConnection(endpoint);

            Repository rep = new SailRepository(new MemoryStore());
            rep.initialize();

            RepositoryConnection conn = rep.getConnection();
            try {
                ValueFactory vf = conn.getValueFactory();
                String userDN = buildDN(prefix, account, ldap);
View Full Code Here

    public ClientResponse retrieveResource(String resource, LDClientService client, Endpoint endpoint) throws DataRetrievalException {

        Repository triples = new SailRepository(new MemoryStore());
        RepositoryConnection conn;
        try {
            triples.initialize();
            conn = triples.getConnection();
        } catch (RepositoryException e) {
            String msg = "Error initializing in-memory repository connection: " + e.getMessage();
            log.error(msg);
            throw new RuntimeException(msg, e);
View Full Code Here

        InputStream ical = this.getClass().getResourceAsStream(fileName+".ics");
        InputStream sparql = this.getClass().getResourceAsStream(fileName+".sparql");
        assumeThat("Could not load testfiles", asList(ical, sparql), everyItem(notNullValue(InputStream.class)));

        Repository repository = new SailRepository(new MemoryStore());
        repository.initialize();

        RepositoryConnection connection = repository.getConnection();
        try {
            connection.add(ical,"http://localhost/ical/", ICalFormat.FORMAT);
            connection.commit();
View Full Code Here

            ClientConfiguration config = new ClientConfiguration();

            backend = new LDCachingFileBackend(dataDirectory);
            sail = new GenericLinkedDataSail(new MemoryStore(),backend, cacheFilter, config);
            Repository repository = new SailRepository(sail);
            repository.initialize();
            setRepository(repository);

        } catch (RepositoryException e) {
            log.error("error initialising connection to Sesame in-memory repository",e);
        }
View Full Code Here

  public ClientResponse retrieveResource(String resource, LDClientService client, Endpoint endpoint) throws DataRetrievalException {
        String filename = resource.substring("http://localhost/".length()) + ".ttl";

        try {
            Repository triples = new SailRepository(new MemoryStore());
            triples.initialize();

            RepositoryConnection con = triples.getConnection();
            try {
                con.begin();
View Full Code Here

  public ClientResponse retrieveResource(String resource, LDClientService client, Endpoint endpoint) throws DataRetrievalException {
        String filename = resource.substring("http://remote/".length()) + ".ttl";

        try {
            Repository triples = new SailRepository(new MemoryStore());
            triples.initialize();

            RepositoryConnection con = triples.getConnection();
            try {
                con.begin();
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.