Package org.openrdf.repository.config

Examples of org.openrdf.repository.config.RepositoryConfig


    RepositoryManager manager = server.getRepositoryManager();

    // create a (non-inferencing) memory store
    MemoryStoreConfig memStoreConfig = new MemoryStoreConfig();
    SailRepositoryConfig sailRepConfig = new SailRepositoryConfig(memStoreConfig);
    RepositoryConfig repConfig = new RepositoryConfig(TEST_REPO_ID, sailRepConfig);

    manager.addRepositoryConfig(TEST_REPO_ID, repConfig.export());

    // create an inferencing memory store
    ForwardChainingRDFSInferencerConfig inferMemStoreConfig = new ForwardChainingRDFSInferencerConfig(
        new MemoryStoreConfig());
    sailRepConfig = new SailRepositoryConfig(inferMemStoreConfig);
    repConfig = new RepositoryConfig(TEST_INFERENCE_REPO_ID, sailRepConfig);

    manager.addRepositoryConfig(TEST_INFERENCE_REPO_ID, repConfig.export());
  }
View Full Code Here


    throws StoreConfigException, StoreException
  {
    Model config = getRepositoryConfig(id);

    if (config != null) {
      RepositoryConfig repConfig = parse(config);

      Repository repository = createRepositoryStack(repConfig.getRepositoryImplConfig());
      try {
        repository.setDataDir(getRepositoryDir(id));
        repository.initialize();
        return repository;
      }
View Full Code Here

  }

  private RepositoryConfig parse(Model config)
    throws StoreConfigException
  {
    RepositoryConfig repConfig = RepositoryConfig.create(config);
    repConfig.validate();
    return repConfig;
  }
View Full Code Here

      if (model != null) {
        repInfo = new RepositoryInfo(id);

        try {
          RepositoryConfig config = parse(model);
          repInfo.setDescription(config.getTitle());
        }
        catch (StoreConfigException e) {
          logger.warn("Failed to parse configuration for store {}: {})", id, e.getMessage());
        }
      }
View Full Code Here

        con.begin();
        con.setNamespace("rdf", RDF.NAMESPACE);
        con.setNamespace("sys", RepositoryConfigSchema.NAMESPACE);

        if (persist) {
          RepositoryConfig repConfig = new RepositoryConfig(TITLE, new SystemRepositoryConfig());
          updateRepositoryConfigs(con, ID, repConfig);
        }

        con.commit();
      }
View Full Code Here

  {
    Model result = delegate.getRepositoryConfig(repositoryID);

    if (result != null) {
      if (!isCorrectType(result)) {
        RepositoryConfig config = parse(result);
        logger.debug(
            "Surpressing retrieval of repository {}: repository type {} did not match expected type {}",
            new Object[] { repositoryID, config.getRepositoryImplConfig().getType(), type });

        result = null;
      }
    }
View Full Code Here

  }

  private RepositoryConfig parse(Model config)
    throws StoreConfigException
  {
    RepositoryConfig repConfig = RepositoryConfig.create(config);
    repConfig.validate();
    return repConfig;
  }
View Full Code Here

    RepositoryConnection con = systemRepository.getConnection();
    try {
      Repository repository = null;

      RepositoryConfig repConfig = RepositoryConfigUtil.getRepositoryConfig(systemRepository, id);
      if (repConfig != null) {
        repConfig.validate();

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

      return repository;
View Full Code Here

  @Override
  public RepositoryInfo getRepositoryInfo(String id)
    throws RepositoryException
  {
    try {
      RepositoryConfig config = null;
      if (id.equals(SystemRepository.ID)) {
        config = new RepositoryConfig(id, new SystemRepositoryConfig());
      }
      else {
        config = getRepositoryConfig(id);
      }

      RepositoryInfo repInfo = new RepositoryInfo();
      repInfo.setId(id);
      repInfo.setDescription(config.getTitle());
      try {
        repInfo.setLocation(getRepositoryDir(id).toURI().toURL());
      }
      catch (MalformedURLException mue) {
        throw new RepositoryException("Location of repository does not resolve to a valid URL", mue);
View Full Code Here

        con.setAutoCommit(false);
        con.setNamespace("rdf", RDF.NAMESPACE);
        con.setNamespace("sys", RepositoryConfigSchema.NAMESPACE);

        RepositoryConfig repConfig = new RepositoryConfig(ID, TITLE, new SystemRepositoryConfig());
        RepositoryConfigUtil.updateRepositoryConfigs(con, repConfig);

        con.commit();
      }
    }
View Full Code Here

TOP

Related Classes of org.openrdf.repository.config.RepositoryConfig

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.