java.lang.Object
org.apache.jena.http.AsyncHttpRDF
A collection of convenience operations for HTTP level operations
for RDF related tasks which are performed asynchronously.
See also
HttpRDF
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CompletableFuture<DatasetGraph>
Get a dataset, asynchronouslystatic CompletableFuture<DatasetGraph>
asyncGetDatasetGraph
(HttpClient httpClient, String url) Get a dataset, asynchronouslystatic CompletableFuture<org.apache.jena.graph.Graph>
asyncGetGraph
(String url) Get a graph, asynchronouslystatic CompletableFuture<org.apache.jena.graph.Graph>
asyncGetGraph
(HttpClient httpClient, String url) Get a graph, asynchronouslystatic CompletableFuture<Void>
asyncGetToStream
(HttpClient httpClient, String url, String acceptHeader, StreamRDF dest, Transactional transactional) Execute an asynchronous GET and parse the result to a StreamRDF.static CompletableFuture<Void>
asyncLoadDatasetGraph
(String url, DatasetGraph dsg) Load a DatasetGraph asynchronously.static CompletableFuture<Void>
asyncLoadDatasetGraph
(HttpClient httpClient, String url, Map<String, String> headers, DatasetGraph dsg) Load a DatasetGraph asynchronously.static CompletableFuture<Void>
asyncLoadDatasetGraph
(HttpClient httpClient, String url, DatasetGraph dsg) Load a DatasetGraph asynchronously.static <T> T
getOrElseThrow
(CompletableFuture<T> cf) Wait for theCompletableFuture
then return the result or throw a runtime exception.static void
Wait for theCompletableFuture
or throw a runtime exception.
-
Constructor Details
-
AsyncHttpRDF
public AsyncHttpRDF()
-
-
Method Details
-
asyncGetGraph
Get a graph, asynchronously -
asyncGetGraph
public static CompletableFuture<org.apache.jena.graph.Graph> asyncGetGraph(HttpClient httpClient, String url) Get a graph, asynchronously -
asyncGetDatasetGraph
Get a dataset, asynchronously -
asyncGetDatasetGraph
public static CompletableFuture<DatasetGraph> asyncGetDatasetGraph(HttpClient httpClient, String url) Get a dataset, asynchronously -
asyncLoadDatasetGraph
Load a DatasetGraph asynchronously. The dataset is updated inside a transaction. -
asyncLoadDatasetGraph
public static CompletableFuture<Void> asyncLoadDatasetGraph(HttpClient httpClient, String url, DatasetGraph dsg) Load a DatasetGraph asynchronously. The dataset is updated inside a transaction. -
asyncLoadDatasetGraph
public static CompletableFuture<Void> asyncLoadDatasetGraph(HttpClient httpClient, String url, Map<String, String> headers, DatasetGraph dsg) Load a DatasetGraph asynchronously. The dataset is updated inside a transaction. -
asyncGetToStream
public static CompletableFuture<Void> asyncGetToStream(HttpClient httpClient, String url, String acceptHeader, StreamRDF dest, Transactional transactional) Execute an asynchronous GET and parse the result to a StreamRDF. If "transactional" is not null, the object is used a write transaction around the parsing step.Call
CompletableFuture.join()
to await completion.
CallsyncOrElseThrow(CompletableFuture)
to await completion, with exceptions translated to the underlyingRuntimeException
. -
syncOrElseThrow
Wait for theCompletableFuture
or throw a runtime exception. This operation extracts RuntimeException from theCompletableFuture
. -
getOrElseThrow
Wait for theCompletableFuture
then return the result or throw a runtime exception. This operation extracts RuntimeException from theCompletableFuture
.
-