本文整理汇总了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();
}
示例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();
}
示例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;
}