/** * 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); } }
public void uploadFile(Path path) { Model m = FileManager.get().loadModel(path.toString()); DatasetAccessorFactory.createHTTP( CONFIG.sparqlUpload(), authenticator).add(m); }