当前位置: 首页>>代码示例>>Java>>正文


Java RepositoryManager类代码示例

本文整理汇总了Java中org.eclipse.rdf4j.repository.manager.RepositoryManager的典型用法代码示例。如果您正苦于以下问题:Java RepositoryManager类的具体用法?Java RepositoryManager怎么用?Java RepositoryManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RepositoryManager类属于org.eclipse.rdf4j.repository.manager包,在下文中一共展示了RepositoryManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testLocalManager

import org.eclipse.rdf4j.repository.manager.RepositoryManager; //导入依赖的package包/类
@Test
public void testLocalManager() throws Exception {
    RepositoryManager manager;
    manager = new LocalRepositoryManager(new File("/tmp/localmanager"));
    manager.initialize();
    RepositoryConfig mlconf = new RepositoryConfig("jimtest1",new MarkLogicRepositoryConfig(host, port, user, password, "DIGEST"));

    manager.addRepositoryConfig(new RepositoryConfig("test", new SailRepositoryConfig(
            new MemoryStoreConfig(true))));
    manager.addRepositoryConfig(mlconf);

    MarkLogicRepository mlrepo = (MarkLogicRepository)manager.getRepository("jimtest1");
    mlrepo.initialize();
    MarkLogicRepositoryConnection mlconn = mlrepo.getConnection();
    ValueFactory vf = mlconn.getValueFactory();
    IRI tommy = vf.createIRI("http://marklogicsparql.com/id#4444");
    IRI lname = vf.createIRI("http://marklogicsparql.com/addressbook#lastName");
    Literal tommylname = vf.createLiteral("Ramone");
    Statement stmt = vf.createStatement(tommy, lname, tommylname);
    mlconn.begin();
    mlconn.add(stmt);
    mlconn.commit();
    Assert.assertEquals(1, mlconn.size());

    mlconn.clear();
}
 
开发者ID:marklogic,项目名称:marklogic-rdf4j,代码行数:27,代码来源:MarkLogicRepositoryManagerTest.java

示例2: connectorIsAbleToConnectToAlreadyInitializedLocalNativeStorage

import org.eclipse.rdf4j.repository.manager.RepositoryManager; //导入依赖的package包/类
@Test
public void connectorIsAbleToConnectToAlreadyInitializedLocalNativeStorage() throws Exception {
    final String repoId = "repositoryTest";
    final URI repoUri = URI
            .create("file://" + getProjectRootPath() + File.separator + "repositories" + File.separator + repoId);
    this.repositoryFolder = new File(getProjectRootPath() + File.separator + "repositories");
    SailImplConfig backend = new NativeStoreConfig();
    final SailRepositoryConfig repoType = new SailRepositoryConfig(backend);
    final RepositoryConfig config = new RepositoryConfig(repoId, repoType);
    final RepositoryManager repoManager = RepositoryProvider.getRepositoryManagerOfRepository(repoUri.toString());
    repoManager.addRepositoryConfig(config);
    final Repository repo = repoManager.getRepository(repoId);
    repo.initialize();
    final OntologyStorageProperties storageProperties = OntologyStorageProperties.driver(DRIVER)
                                                                                 .physicalUri(repoUri).build();

    final StorageConnector connector = new StorageConnector(new Configuration(storageProperties));
    assertTrue(connector.isOpen());
    connector.close();
}
 
开发者ID:kbss-cvut,项目名称:jopa,代码行数:21,代码来源:StorageConnectorTest.java

示例3: bootstrapRemoteRepository

import org.eclipse.rdf4j.repository.manager.RepositoryManager; //导入依赖的package包/类
private RepositoryManager bootstrapRemoteRepository(String repositoryUrl) throws OData2SparqlException {
	RemoteRepositoryManager repositoryManager = new RemoteRepositoryManager(repositoryUrl);
	log.info("Trying remote Repository at " + repositoryUrl);
	try {
		repositoryManager.initialize();
		//Make sure we can find the bootstrap repository
		repositoryManager.getRepositoryInfo(RdfConstants.systemId);
	} catch (RepositoryException e) {
		log.warn("Cannot initialize remote repository manager at " + repositoryUrl
				+ ". Will use local repository instead");
		throw new OData2SparqlException("RdfRepositories bootstrapRemoteRepository failure", null);
	}
	return repositoryManager;
}
 
开发者ID:peterjohnlawrence,项目名称:com.inova8.odata2sparql.v4,代码行数:15,代码来源:RdfRepositories.java


注:本文中的org.eclipse.rdf4j.repository.manager.RepositoryManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。