Package org.openrdf.repository.http

Examples of org.openrdf.repository.http.HTTPRepository


    logger.info("Removing statements...");
    String actionResult = "repository.modify.remove.statements.success";

    RemovalSpecification toRemove = (RemovalSpecification)command;

    HTTPRepository repo = (HTTPRepository)request.getSession().getAttribute(SessionKeys.REPOSITORY_KEY);
    RepositoryConnection conn = null;
    try {
      conn = repo.getConnection();
      conn.remove(toRemove.getSubject(), toRemove.getPredicate(), toRemove.getObject(),
          toRemove.getContexts());
      conn.commit();
      logger.info("Remove committed.");
    }
View Full Code Here


  @Override
  public void stop()
    throws Exception
  {
    Repository systemRepo = new HTTPRepository(Protocol.getRepositoryLocation(SERVER_URL,
        SystemRepository.ID));
    RepositoryConnection con = systemRepo.getConnection();
    try {
      con.clear();
    }
    finally {
      con.close();
View Full Code Here

   * @throws RepositoryException
   */
  private void createTestRepositories()
    throws RepositoryException, RepositoryConfigException
  {
    Repository systemRep = new HTTPRepository(Protocol.getRepositoryLocation(SERVER_URL,
        SystemRepository.ID));

    // create a (non-inferencing) memory store
    MemoryStoreConfig memStoreConfig = new MemoryStoreConfig();
    SailRepositoryConfig sailRepConfig = new SailRepositoryConfig(memStoreConfig);
View Full Code Here

    logger.info("Uploading data...");
    RDFUpload rdfUpload = (RDFUpload)command;
    InputStream in = rdfUpload.getInputStream();

    HTTPRepository repo = (HTTPRepository)request.getSession().getAttribute(SessionKeys.REPOSITORY_KEY);
    RepositoryConnection conn = null;
    try {
      conn = repo.getConnection();
      conn.add(in, rdfUpload.getBaseUri(), rdfUpload.getFormat());
      conn.commit();
      logger.info("Upload committed.");
    }
    catch (RDFParseException e) {
View Full Code Here

  }

  public Repository getRepository(RepositoryImplConfig config)
    throws RepositoryConfigException
  {
    HTTPRepository result = null;
   
    if (config instanceof HTTPRepositoryConfig) {
      HTTPRepositoryConfig httpConfig = (HTTPRepositoryConfig)config;
      result = new HTTPRepository(httpConfig.getURL());
//      result.setUsernameAndPassword(httpConfig.getUsername(), httpConfig.getPassword());
    }
    else {
      throw new RepositoryConfigException("Invalid configuration class: " + config.getClass());
    }
View Full Code Here

      if(m.find()) {
        String type = m.group(1);
        String param = m.group(2);
       
        if("HTTP".equals(type))
          repository = new HTTPRepository(param);
        else if("Memory".equals(type)) {
          if(param == null || "".equals(param))
            repository = new SailRepository(new MemoryStore());
          else
            repository = new SailRepository(new MemoryStore(new File(param)));
View Full Code Here

 
  /*
   * Initialize th Wrapper with a connection to a remote HTTP repository
   */
  public RepositoryConnection initWithHttp(String url, String user, String password) throws RepositoryException {
    HTTPRepository httpRepository = new HTTPRepository(url);
    if(user != null) {
      httpRepository.setUsernameAndPassword(user, password);
    }
    httpRepository.initialize();
    sesameRepository = httpRepository;
    sesameConnection = sesameRepository.getConnection();
    return sesameConnection;
  }
View Full Code Here

            throw new IllegalStateException("no server URL defined for HTTP backend (property backend.http.url)");
        }

        log.info("creating new HTTP repository client for server at {}", serverUrl);

        httpRepository = new HTTPRepository(serverUrl);

        // TODO: would be better to implement a RepositorySail as NotifyingSail wrapper around a repository
        Federation store = new Federation();
        store.addMember(httpRepository);
View Full Code Here

    try {
      if (aPhysRepo != null) {
        aRepository = (Repository) aPhysRepo;
      }
      else if (aURL != null && aRepo != null) {
        aRepository = new HTTPRepository(aURL.toString(), aRepo.toString());

        aRepository.initialize();
      }
      else if (aFiles != null) {
        aRepository = new SailRepository(new MemoryStore());
View Full Code Here

TOP

Related Classes of org.openrdf.repository.http.HTTPRepository

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.