本文整理汇总了Java中org.eclipse.rdf4j.sail.nativerdf.NativeStore类的典型用法代码示例。如果您正苦于以下问题:Java NativeStore类的具体用法?Java NativeStore怎么用?Java NativeStore使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NativeStore类属于org.eclipse.rdf4j.sail.nativerdf包,在下文中一共展示了NativeStore类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadEndpoint
import org.eclipse.rdf4j.sail.nativerdf.NativeStore; //导入依赖的package包/类
@Override
public Endpoint loadEndpoint(RepositoryInformation repoInfo) throws FedXException {
File store = FileUtil.getFileLocation(config, repoInfo.getLocation());
if (!store.exists()){
throw new FedXRuntimeException("Store does not exist at '" + repoInfo.getLocation() + ": " + store.getAbsolutePath() + "'.");
}
try {
NativeStore ns = new NativeStoreExt(store);
SailRepository repo = new SailRepository(ns);
repo.initialize();
ProviderUtil.checkConnectionIfConfigured(config, repo);
Endpoint res = new Endpoint(repoInfo.getId(), repoInfo.getName(), repoInfo.getLocation(), repoInfo.getType(), EndpointClassification.Local);
res.setEndpointConfiguration(repoInfo.getEndpointConfiguration());
res.setRepo(repo);
/*
// register a federated service manager to deal with this endpoint
SAILFederatedService federatedService = new SAILFederatedService(res);
federatedService.initialize();
FederatedServiceManager.getInstance().registerService(repoInfo.getName(), federatedService);
*/
return res;
} catch (RepositoryException e) {
throw new FedXException("Repository " + repoInfo.getId() + " could not be initialized: " + e.getMessage(), e);
}
}
示例2: createRepository
import org.eclipse.rdf4j.sail.nativerdf.NativeStore; //导入依赖的package包/类
public void createRepository() throws IOException {
final Sail sail = new NativeStore(tempDir.newFolder());
repository = new SailRepository(sail);
repository.initialize();
}