Package org.openrdf.repository

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


        cacheEntries = recordManager.treeMap("resources");

        try {
            Repository repository = new SailRepository(new NativeStore(tripleStore));
            repository.initialize();
            setRepository(repository);

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


    private Repository parseRDFResponse(final URI resource, InputStream in, String contentType) throws RepositoryException, IOException, RDFParseException {
        RDFFormat format = RDFParserRegistry.getInstance().getFileFormatForMIMEType(contentType, RDFFormat.RDFXML);

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

        InterceptingRepositoryConnection con =
                new InterceptingRepositoryConnectionWrapper(triples,triples.getConnection());

        con.addRepositoryConnectionInterceptor(new RepositoryConnectionInterceptorAdapter() {
View Full Code Here

    private Repository parseSparqlResponse(final URI resource, InputStream in, String contentType) throws RepositoryException, IOException, QueryResultParseException, TupleQueryResultHandlerException {
        TupleQueryResultFormat format = QueryResultIO.getParserFormatForMIMEType(contentType, TupleQueryResultFormat.SPARQL);


        final Repository triples = new SailRepository(new MemoryStore());
        triples.initialize();

        QueryResultIO.parse(in,format,
                new TupleQueryResultHandler() {

                    RepositoryConnection con;
View Full Code Here

                r = new SailRepository(s);
            } else {
                s = new MemoryStore();
                r = new SailRepository(new MemoryStore());
            }
            r.initialize();

            return new RepoSailTuple(r,s);
        } catch (Exception e) {
            _logger.error("Exception caught while creating Sesame in-memory repository", e);
            return null;
View Full Code Here

        try {
            Sail sail = new NativeStore();
            sail.setDataDir(dir);
            ((NativeStore) sail).setTripleIndexes("spoc,posc,opsc");
            Repository r = new SailRepository(sail);
            r.initialize();
            return new RepoSailTuple(r,sail);
        } catch (Exception e) {
            _logger.error("Exception caught while creating Sesame native repository", e);
            return null;
        }
View Full Code Here

    }
   
    Repository tempRepository = new SailRepository(new MemoryStore());
    RepositoryConnection conn = null;
    try {
      tempRepository.initialize();
      conn = tempRepository.getConnection();
    } catch (RepositoryException e1) {
      Global.log().warning("Failed to create repository for merging");
      return;
    }
View Full Code Here

        }
      }
     
      Repository repository = new SailRepository(
          new ForwardChainingRDFSInferencer(new MemoryStore()));
      repository.initialize();
      RepositoryConnection con = repository.getConnection();
      RDFFormat rdfFromat;
      if(format.equals("auto-detect")){
        rdfFromat = guessFormat(filename);
      }else if(format.equals("TTL")){
View Full Code Here

      if (repConfig != null) {
        repConfig.validate();

        repository = createRepositoryStack(repConfig.getRepositoryImplConfig());
        repository.setDataDir(getRepositoryDir(id));
        repository.initialize();
      }

      return repository;
    }
    finally {
View Full Code Here

    // Create test suite
    TestSuite suite = new TestSuite();

    // Add the manifest to a repository and query it
    Repository repository = new SailRepository(new MemoryStore());
    repository.initialize();
    RepositoryConnection con = repository.getConnection();

    URL url = new URL(MANIFEST_URL);
    con.add(url, MANIFEST_URL, RDFFormat.TURTLE);
View Full Code Here

  {
    Repository result = null;

    if (RepositoryConfigUtil.hasRepositoryConfig(getSystemRepository(), id)) {
      result = new HTTPRepository(serverURL, id);
      result.initialize();
    }

    return result;
  }
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.