Class FusekiConnector
Class for connecting to any dataset that can be exposed via Fuseki.
Inheritance
Implements
Inherited Members
Namespace: VDS.RDF.Storage
Assembly: dotNetRdf.Client.dll
Syntax
public class FusekiConnector : SparqlHttpProtocolConnector, IConfigurationSerializable, IAsyncUpdateableStorage, IAsyncQueryableStorage, IAsyncStorageProvider, IUpdateableStorage, IQueryableStorage, IStorageProvider, IStorageCapabilities, IDisposable
Remarks
Uses all three Services provided by a Fuseki instance - Query, Update and HTTP Update.
Constructors
| Edit this page View SourceFusekiConnector(string, IWebProxy)
Creates a new connection to a Fuseki Server.
Declaration
public FusekiConnector(string serviceUri, IWebProxy proxy)
Parameters
Type | Name | Description |
---|---|---|
string | serviceUri | The /data URI of the Fuseki Server. |
IWebProxy | proxy | Proxy Server. |
FusekiConnector(string, MimeTypeDefinition)
Creates a new connection to a Fuseki Server.
Declaration
public FusekiConnector(string serviceUri, MimeTypeDefinition writerMimeTypeDefinition = null)
Parameters
Type | Name | Description |
---|---|---|
string | serviceUri | The /data URI of the Fuseki Server. |
MimeTypeDefinition | writerMimeTypeDefinition | The MIME type of the syntax to use when sending RDF data to the server. Defaults to RDF/XML. |
FusekiConnector(Uri, IWebProxy)
Creates a new connection to a Fuseki Server.
Declaration
public FusekiConnector(Uri serviceUri, IWebProxy proxy)
Parameters
Type | Name | Description |
---|---|---|
Uri | serviceUri | The /data URI of the Fuseki Server. |
IWebProxy | proxy | Proxy Server. |
FusekiConnector(Uri, MimeTypeDefinition)
Creates a new connection to a Fuseki Server.
Declaration
public FusekiConnector(Uri serviceUri, MimeTypeDefinition writerMimeTypeDefinition = null)
Parameters
Type | Name | Description |
---|---|---|
Uri | serviceUri | The /data URI of the Fuseki Server. |
MimeTypeDefinition | writerMimeTypeDefinition | The MIME type of the syntax to use when sending RDF data to the server. Defaults to RDF/XML. |
Properties
| Edit this page View SourceIOBehaviour
Gets the IO Behaviour of the Store.
Declaration
public override IOBehaviour IOBehaviour { get; }
Property Value
Type | Description |
---|---|
IOBehaviour |
Overrides
| Edit this page View SourceListGraphsSupported
Returns that Listing Graphs is supported.
Declaration
public override bool ListGraphsSupported { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceUpdateSupported
Returns that Triple level updates are supported using Fuseki.
Declaration
public override bool UpdateSupported { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
Methods
| Edit this page View SourceListGraphNames()
Gets an enumeration of the names of the graphs in the store.
Declaration
public override IEnumerable<string> ListGraphNames()
Returns
Type | Description |
---|---|
IEnumerable<string> |
Overrides
Remarks
Implementations should implement this method only if they need to provide a custom way of listing Graphs. If the Store for which you are providing a manager can efficiently return the Graphs using a SELECT DISTINCT ?g WHERE { GRAPH ?g { ?s ?p ?o } } query then there should be no need to implement this function.
ListGraphs()
Gets the List of Graphs from the store.
Declaration
[Obsolete("Replaced by ListGraphNames")]
public override IEnumerable<Uri> ListGraphs()
Returns
Type | Description |
---|---|
IEnumerable<Uri> |
Overrides
| Edit this page View SourceListGraphs(AsyncStorageCallback, object)
Lists the graph sin the Store asynchronously.
Declaration
[Obsolete("Replaced with ListGraphsAsync(CancellationToken)")]
public override void ListGraphs(AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
AsyncStorageCallback | callback | Callback. |
object | state | State to pass to the callback. |
Overrides
| Edit this page View SourceListGraphsAsync(CancellationToken)
List the names of the graph on the remote server asynchronously.
Declaration
public override Task<IEnumerable<string>> ListGraphsAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<string>> | Task that returns the list of graph names. |
Overrides
Remarks
This implementation uses a SPARQL query to list the names of the graphs in the store. Many stores support more efficient means of listing graphs and so this method SHOULD be overridden. If the store does not implement the IAsyncQueryableStorage interface, then this method MUST be overridden.
Exceptions
Type | Condition |
---|---|
RdfStorageException | Raised if the store does not support the asynchronous SPARQL query required to retrieve a list of graph names. |
Query(string)
Executes a SPARQL Query on the Fuseki store.
Declaration
public object Query(string sparqlQuery)
Parameters
Type | Name | Description |
---|---|---|
string | sparqlQuery | SPARQL Query. |
Returns
Type | Description |
---|---|
object |
Query(string, AsyncStorageCallback, object)
Makes a SPARQL Query against the underlying store.
Declaration
public void Query(string sparqlQuery, AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
string | sparqlQuery | SPARQL Query. |
AsyncStorageCallback | callback | Callback. |
object | state | State to pass to the callback. |
Query(IRdfHandler, ISparqlResultsHandler, string)
Executes a SPARQL Query on the Fuseki store processing the results using an appropriate handler from those provided.
Declaration
public void Query(IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, string sparqlQuery)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | rdfHandler | RDF Handler. |
ISparqlResultsHandler | resultsHandler | Results Handler. |
string | sparqlQuery | SPARQL Query. |
Query(IRdfHandler, ISparqlResultsHandler, string, AsyncStorageCallback, object)
Executes a SPARQL Query on the Fuseki store processing the results using an appropriate handler from those provided.
Declaration
public void Query(IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, string sparqlQuery, AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | rdfHandler | RDF Handler. |
ISparqlResultsHandler | resultsHandler | Results Handler. |
string | sparqlQuery | SPARQL Query. |
AsyncStorageCallback | callback | Callback. |
object | state | State to pass to the callback. |
QueryAsync(string, CancellationToken)
Queries the store asynchronously.
Declaration
public Task<object> QueryAsync(string sparqlQuery, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | sparqlQuery | SPARQL Query. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<object> |
QueryAsync(IRdfHandler, ISparqlResultsHandler, string, CancellationToken)
Queries the store asynchronously.
Declaration
public Task QueryAsync(IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, string sparqlQuery, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | rdfHandler | RDF Handler that will receive graph results from CONSTRUCT or DESCRIBE queries. |
ISparqlResultsHandler | resultsHandler | SPARQL Results set handler that will receive results from ASK or SELECT queries. |
string | sparqlQuery | The SPARQL query to execute. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
SerializeConfiguration(ConfigurationSerializationContext)
Serializes the connection's configuration.
Declaration
public override void SerializeConfiguration(ConfigurationSerializationContext context)
Parameters
Type | Name | Description |
---|---|---|
ConfigurationSerializationContext | context | Configuration Serialization Context. |
Overrides
| Edit this page View SourceToString()
Gets a String which gives details of the Connection.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
| Edit this page View SourceUpdate(string)
Executes SPARQL Updates against the Fuseki store.
Declaration
public void Update(string sparqlUpdate)
Parameters
Type | Name | Description |
---|---|---|
string | sparqlUpdate | SPARQL Update. |
Update(string, AsyncStorageCallback, object)
Executes SPARQL Updates against the Fuseki store.
Declaration
public void Update(string sparqlUpdate, AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
string | sparqlUpdate | SPARQL Update. |
AsyncStorageCallback | callback | Callback. |
object | state | State to pass to the callback. |
UpdateAsync(string, CancellationToken)
Updates the store asynchronously.
Declaration
public Task UpdateAsync(string sparqlUpdates, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | sparqlUpdates | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
UpdateGraph(string, IEnumerable<Triple>, IEnumerable<Triple>)
Updates a Graph in the Fuseki store.
Declaration
public override void UpdateGraph(string graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals)
Parameters
Type | Name | Description |
---|---|---|
string | graphUri | URI of the Graph to update. |
IEnumerable<Triple> | additions | Triples to be added. |
IEnumerable<Triple> | removals | Triples to be removed. |
Overrides
| Edit this page View SourceUpdateGraph(string, IEnumerable<Triple>, IEnumerable<Triple>, AsyncStorageCallback, object)
Updates a Graph on the Fuseki Server.
Declaration
public override void UpdateGraph(string graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals, AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
string | graphUri | URI of the Graph to update. |
IEnumerable<Triple> | additions | Triples to be added. |
IEnumerable<Triple> | removals | Triples to be removed. |
AsyncStorageCallback | callback | Callback. |
object | state | State to pass to the callback. |
Overrides
| Edit this page View SourceUpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>)
Updates a Graph in the Fuseki store.
Declaration
public override void UpdateGraph(Uri graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals)
Parameters
Type | Name | Description |
---|---|---|
Uri | graphUri | URI of the Graph to update. |
IEnumerable<Triple> | additions | Triples to be added. |
IEnumerable<Triple> | removals | Triples to be removed. |
Overrides
| Edit this page View SourceUpdateGraphAsync(string, IEnumerable<Triple>, IEnumerable<Triple>, CancellationToken)
Updates a graph in the store asynchronously.
Declaration
public override Task UpdateGraphAsync(string graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | graphUri | |
IEnumerable<Triple> | additions | Triples to be added. |
IEnumerable<Triple> | removals | Triples to be removed. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |