Java 类com.hp.hpl.jena.query.DatasetAccessorFactory 实例源码

项目:SolRDF    文件:SolRDF.java   
/**
 * 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);
    }   
}
项目:DAAFSE    文件:Store.java   
public void uploadFile(Path path) {
    Model m = FileManager.get().loadModel(path.toString());
    DatasetAccessorFactory.createHTTP(
            CONFIG.sparqlUpload(), authenticator).add(m);
}