SPARQL Query and Update Endpoints
You can treat any publicly accessible SPARQL store which has both Query and Update endpoints as a read-write store using the ReadWriteSparqlConnector.
Note
If you were looking for documentation on querying a SPARQL endpoint please see Querying with SPARQL
Supported Capabilities
- Save, Load, Delete, Update and List Graphs
- SPARQL Query
- SPARQL Update
Warning
Updating a graph may not work correctly for blank node containing graphs.
Creating a Connection
You can create a connection either just by providing the endpoint URIs like so:
SparqlConnector sparql = new SparqlConnector(new Uri("http://example.org/query"), new Uri("http://example.org/update"));
Or you can provide a SparqlRemoteEndpoint and SparqlRemoteUpdateEndpoint instance like so:
SparqlRemoteEndpoint queryEndpoint = new SparqlRemoteEndpoint(new Uri("http://example.org/query"), "http://default-graph-uri");
SparqlRemoteUpdateEndpoint updateEndpoint = new SparqlRemoteUpdateEndpoint(new Uri("http://example.org/update"));
ReadWriteSparqlConnector sparql = new SparqlConnector(queryEndpoint, updateEndpoint);
In both cases there is an overload which takes a SparqlConnectorLoadMethods which determines whether the LoadGraph()
method operates by making a CONSTRUCT
or a DESCRIBE
query, the default is CONSTRUCT