本文整理汇总了Java中com.hp.hpl.jena.query.DatasetAccessorFactory类的典型用法代码示例。如果您正苦于以下问题:Java DatasetAccessorFactory类的具体用法?Java DatasetAccessorFactory怎么用?Java DatasetAccessorFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DatasetAccessorFactory类属于com.hp.hpl.jena.query包,在下文中一共展示了DatasetAccessorFactory类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
import com.hp.hpl.jena.query.DatasetAccessorFactory; //导入依赖的package包/类
/**
* Builds a new SolRDF proxy instance.
*
* @return a new SolRDF proxy instance.
* @throws UnableToBuildSolRDFClientException in case of build failure.
*/
public SolRDF build() throws UnableToBuildSolRDFClientException {
if (endpoints.isEmpty()) {
endpoints.add(DEFAULT_ENDPOINT);
}
// FIXME: for DatasetAccessor and (HTTP) query execution service we also need something like LBHttpSolrServer
final String firstEndpointAddress = endpoints.iterator().next();
try {
return new SolRDF(
DatasetAccessorFactory.createHTTP(
firstEndpointAddress +
graphStoreProtocolEndpointPath),
firstEndpointAddress + sparqlEndpointPath,
zkHost != null
? new CloudSolrClient(zkHost)
: (endpoints.size() == 1)
? new HttpSolrClient(endpoints.iterator().next(), httpClient)
: new LBHttpSolrClient(httpClient, endpoints.toArray(new String[endpoints.size()])));
} catch (final Exception exception) {
throw new UnableToBuildSolRDFClientException(exception);
}
}
示例2: uploadFile
import com.hp.hpl.jena.query.DatasetAccessorFactory; //导入依赖的package包/类
public void uploadFile(Path path) {
Model m = FileManager.get().loadModel(path.toString());
DatasetAccessorFactory.createHTTP(
CONFIG.sparqlUpload(), authenticator).add(m);
}