本文整理汇总了Java中com.hp.hpl.jena.query.DatasetAccessorFactory.createHTTP方法的典型用法代码示例。如果您正苦于以下问题:Java DatasetAccessorFactory.createHTTP方法的具体用法?Java DatasetAccessorFactory.createHTTP怎么用?Java DatasetAccessorFactory.createHTTP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hp.hpl.jena.query.DatasetAccessorFactory
的用法示例。
在下文中一共展示了DatasetAccessorFactory.createHTTP方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}