Class SparqlHttpProtocolConnector
Class for connecting to any store that implements the SPARQL Graph Store HTTP Protocol for Managing Graphs.
Inheritance
System.Object
SparqlHttpProtocolConnector
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: VDS.RDF.Storage
Assembly: dotNetRDF.dll
Syntax
public class SparqlHttpProtocolConnector : BaseAsyncHttpConnector, IConfigurationSerializable, IAsyncStorageProvider, IStorageProvider, IStorageCapabilities, IDisposable
Remarks
The SPARQL Graph Store HTTP Protocol is defined as part of SPARQL 1.1 and is currently a working draft so implementations are not guaranteed to be fully compliant with the draft and the protocol may change in the future.
Note: While this connector supports the update of a Graph the Graph Store HTTP Protocol only allows for the addition of data to an existing Graph and not the removal of data, therefore any calls to UpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>) that would require the removal of Triple(s) will result in an error.
Constructors
| Improve this Doc View SourceSparqlHttpProtocolConnector(String, IWebProxy)
Creates a new SPARQL Graph Store HTTP Protocol Connector.
Declaration
public SparqlHttpProtocolConnector(string serviceUri, IWebProxy proxy)
Parameters
Type | Name | Description |
---|---|---|
System.String | serviceUri | URI of the Protocol Server. |
System.Net.IWebProxy | proxy | Proxy Server. |
SparqlHttpProtocolConnector(String, MimeTypeDefinition)
Creates a new SPARQL Graph Store HTTP Protocol Connector.
Declaration
public SparqlHttpProtocolConnector(string serviceUri, MimeTypeDefinition writerMimeTypeDefinition = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | serviceUri | URI of the Protocol Server. |
MimeTypeDefinition | writerMimeTypeDefinition | The MIME type specifying the syntax to use when sending RDF data to the server. Defaults to "application/rdf+xml". |
SparqlHttpProtocolConnector(Uri)
Creates a new SPARQL Graph Store HTTP Protocol Connector.
Declaration
public SparqlHttpProtocolConnector(Uri serviceUri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | serviceUri | URI of the Protocol Server. |
SparqlHttpProtocolConnector(Uri, IWebProxy)
Creates a new SPARQL Graph Store HTTP Protocol Connector.
Declaration
public SparqlHttpProtocolConnector(Uri serviceUri, IWebProxy proxy)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | serviceUri | URI of the Protocol Server. |
System.Net.IWebProxy | proxy | Proxy Server. |
Fields
| Improve this Doc View Source_serviceUri
URI of the Protocol Server.
Declaration
protected string _serviceUri
Field Value
Type | Description |
---|---|
System.String |
_writerMimeTypeDefinition
The MIME type of the syntax to use when sending RDF data to the server.
Declaration
protected MimeTypeDefinition _writerMimeTypeDefinition
Field Value
Type | Description |
---|---|
MimeTypeDefinition |
Properties
| Improve this Doc View SourceDeleteSupported
Returns that deleting Graphs is supported.
Declaration
public override bool DeleteSupported { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceIOBehaviour
Gets the IO Behaviour of SPARQL Graph Store protocol based stores.
Declaration
public override IOBehaviour IOBehaviour { get; }
Property Value
Type | Description |
---|---|
IOBehaviour |
Overrides
| Improve this Doc View SourceIsReadOnly
Gets that the Store is not read-only.
Declaration
public override bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceIsReady
Gets that the Store is ready.
Declaration
public override bool IsReady { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceListGraphsSupported
Returns that listing Graphs is not supported.
Declaration
public override bool ListGraphsSupported { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceUpdateSupported
Gets that Updates are supported.
Declaration
public override bool UpdateSupported { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
Methods
| Improve this Doc View SourceDeleteGraph(String)
Deletes a Graph from the store.
Declaration
public virtual void DeleteGraph(string graphUri)
Parameters
Type | Name | Description |
---|---|---|
System.String | graphUri | URI of the Graph to delete. |
DeleteGraph(String, AsyncStorageCallback, Object)
Deletes a Graph from the store asynchronously.
Declaration
public override void DeleteGraph(string graphUri, AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
System.String | graphUri | URI of the graph to delete. |
AsyncStorageCallback | callback | Callback. |
System.Object | state | State to pass to the callback. |
Overrides
| Improve this Doc View SourceDeleteGraph(Uri)
Deletes a Graph from the store.
Declaration
public virtual void DeleteGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | graphUri | URI of the Graph to delete. |
Dispose()
Disposes of the Connection.
Declaration
public override void Dispose()
Overrides
| Improve this Doc View SourceHasGraph(String)
Sends a HEAD Command to the Protocol Server to determine whether a given Graph exists.
Declaration
public virtual bool HasGraph(string graphUri)
Parameters
Type | Name | Description |
---|---|---|
System.String | graphUri | URI of the Graph to check for. |
Returns
Type | Description |
---|---|
System.Boolean |
HasGraph(Uri)
Sends a HEAD Command to the Protocol Server to determine whether a given Graph exists.
Declaration
public virtual bool HasGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | graphUri | URI of the Graph to check for. |
Returns
Type | Description |
---|---|
System.Boolean |
ListGraphs()
Throws an exception as listing graphs in a SPARQL Graph Store HTTP Protocol does not support listing graphs.
Declaration
public virtual IEnumerable<Uri> ListGraphs()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Uri> |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown since SPARQL Graph Store HTTP Protocol does not support listing graphs. |
ListGraphs(AsyncStorageCallback, Object)
Lists the Graphs in the Store asynchronously.
Declaration
public override void ListGraphs(AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
AsyncStorageCallback | callback | Callback. |
System.Object | state | State to pass to the callback. |
Overrides
| Improve this Doc View SourceLoadGraph(IGraph, String)
Loads a Graph from the Protocol Server.
Declaration
public virtual void LoadGraph(IGraph g, string graphUri)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to load into. |
System.String | graphUri | URI of the Graph to load. |
LoadGraph(IGraph, String, AsyncStorageCallback, Object)
Loads a Graph from the Protocol Server.
Declaration
public override void LoadGraph(IGraph g, string graphUri, AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to load into. |
System.String | graphUri | URI of the Graph to load. |
AsyncStorageCallback | callback | Callback. |
System.Object | state | State to pass to the callback. |
Overrides
| Improve this Doc View SourceLoadGraph(IGraph, Uri)
Loads a Graph from the Protocol Server.
Declaration
public virtual void LoadGraph(IGraph g, Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to load into. |
System.Uri | graphUri | URI of the Graph to load. |
LoadGraph(IRdfHandler, String)
Loads a Graph from the Protocol Server.
Declaration
public virtual void LoadGraph(IRdfHandler handler, string graphUri)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler. |
System.String | graphUri | URI of the Graph to load. |
LoadGraph(IRdfHandler, String, AsyncStorageCallback, Object)
Loads a Graph from the Protocol Server.
Declaration
public override void LoadGraph(IRdfHandler handler, string graphUri, AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler. |
System.String | graphUri | URI of the Graph to load. |
AsyncStorageCallback | callback | Callback. |
System.Object | state | State to pass to the callback. |
Overrides
| Improve this Doc View SourceLoadGraph(IRdfHandler, Uri)
Loads a Graph from the Protocol Server.
Declaration
public virtual void LoadGraph(IRdfHandler handler, Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler. |
System.Uri | graphUri | URI of the Graph to load. |
SaveGraph(IGraph)
Saves a Graph to the Protocol Server.
Declaration
public virtual void SaveGraph(IGraph g)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to save. |
SaveGraph(IGraph, AsyncStorageCallback, Object)
Saves a Graph to the Protocol Server.
Declaration
public override void SaveGraph(IGraph g, AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to save. |
AsyncStorageCallback | callback | Callback. |
System.Object | state | State to pass to the callback. |
Overrides
| Improve this Doc View SourceSerializeConfiguration(ConfigurationSerializationContext)
Serializes the connection's configuration.
Declaration
public virtual void SerializeConfiguration(ConfigurationSerializationContext context)
Parameters
Type | Name | Description |
---|---|---|
ConfigurationSerializationContext | context | Configuration Serialization Context. |
ToString()
Gets a String representation of the connection.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
System.Object.ToString()
|
Improve this Doc
View Source
UpdateGraph(String, IEnumerable<Triple>, IEnumerable<Triple>)
Updates a Graph on the Protocol Server.
Declaration
public virtual void UpdateGraph(string graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals)
Parameters
Type | Name | Description |
---|---|---|
System.String | graphUri | URI of the Graph to update. |
System.Collections.Generic.IEnumerable<Triple> | additions | Triples to be added. |
System.Collections.Generic.IEnumerable<Triple> | removals | Triples to be removed. |
Remarks
Note: The SPARQL Graph Store HTTP Protocol for Graph Management only supports the addition of Triples to a Graph and does not support removal of Triples from a Graph. If you attempt to remove Triples then an RdfStorageException will be thrown.
|
Improve this Doc
View Source
UpdateGraph(String, IEnumerable<Triple>, IEnumerable<Triple>, AsyncStorageCallback, Object)
Updates a Graph on the Protocol Server.
Declaration
public override void UpdateGraph(string graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals, AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
System.String | graphUri | URI of the Graph to update. |
System.Collections.Generic.IEnumerable<Triple> | additions | Triples to be added. |
System.Collections.Generic.IEnumerable<Triple> | removals | Triples to be removed. |
AsyncStorageCallback | callback | Callback. |
System.Object | state | State to pass to the callback. |
Overrides
Remarks
Note: The SPARQL Graph Store HTTP Protocol for Graph Management only supports the addition of Triples to a Graph and does not support removal of Triples from a Graph. If you attempt to remove Triples then an RdfStorageException will be thrown.
|
Improve this Doc
View Source
UpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>)
Updates a Graph on the Protocol Server.
Declaration
public virtual void UpdateGraph(Uri graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | graphUri | URI of the Graph to update. |
System.Collections.Generic.IEnumerable<Triple> | additions | Triples to be added. |
System.Collections.Generic.IEnumerable<Triple> | removals | Triples to be removed. |
Remarks
Note: The SPARQL Graph Store HTTP Protocol for Graph Management only supports the addition of Triples to a Graph and does not support removal of Triples from a Graph. If you attempt to remove Triples then an RdfStorageException will be thrown.
Implements
System.IDisposable