Class ReadWriteSparqlConnector
Class for connecting to any SPARQL server that provides both a query and update endpoint.
Implements
Inherited Members
Namespace: VDS.RDF.Storage
Assembly: dotNetRdf.dll
Syntax
public class ReadWriteSparqlConnector : SparqlConnector, IConfigurationSerializable, IUpdateableStorage, IQueryableStorage, IStorageProvider, IStorageCapabilities, IDisposable
Remarks
This class is a wrapper around a SparqlRemoteEndpoint and a SparqlRemoteUpdateEndpoint. The former is used for the query functionality while the latter is used for the update functionality. As updates happen via SPARQL the behaviour with respects to adding and removing blank nodes will be somewhat up to the underlying SPARQL implementation. This connector is not able to carry out UpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>) operations which attempt to delete blank nodes and cannot guarantee that added blank nodes bear any relation to existing blank nodes in the store.
Unlike other HTTP based connectors this connector does not derive from BaseHttpConnector - if you need to specify proxy information you should do so on the SPARQL Endpoint you are wrapping either by providing endpoint instance pre-configured with the proxy settings or by accessing the endpoint via the Endpoint and UpdateEndpoint properties and programmatically adding the settings.
Constructors
| Edit this page View SourceReadWriteSparqlConnector(Uri, Uri)
Creates a new connection.
Declaration
public ReadWriteSparqlConnector(Uri queryEndpoint, Uri updateEndpoint)
Parameters
Type | Name | Description |
---|---|---|
Uri | queryEndpoint | Query Endpoint. |
Uri | updateEndpoint | Update Endpoint. |
ReadWriteSparqlConnector(Uri, Uri, SparqlConnectorLoadMethod)
Creates a new connection.
Declaration
public ReadWriteSparqlConnector(Uri queryEndpoint, Uri updateEndpoint, SparqlConnectorLoadMethod mode)
Parameters
Type | Name | Description |
---|---|---|
Uri | queryEndpoint | Query Endpoint. |
Uri | updateEndpoint | Update Endpoint. |
SparqlConnectorLoadMethod | mode | Method for loading graphs. |
ReadWriteSparqlConnector(SparqlQueryClient, SparqlUpdateClient, SparqlConnectorLoadMethod)
Creates a new connector.
Declaration
public ReadWriteSparqlConnector(SparqlQueryClient queryClient, SparqlUpdateClient updateClient, SparqlConnectorLoadMethod loadMethod = SparqlConnectorLoadMethod.Construct)
Parameters
Type | Name | Description |
---|---|---|
SparqlQueryClient | queryClient | The SPARQL query client to use. |
SparqlUpdateClient | updateClient | The SPARQL update client to use. |
SparqlConnectorLoadMethod | loadMethod | The method to use for loading graphs. |
ReadWriteSparqlConnector(SparqlRemoteEndpoint, SparqlRemoteUpdateEndpoint)
Creates a new connection.
Declaration
[Obsolete("Replaced by ReadWriteSparqlConnector(SparqlQueryClient, SparqlUpdateClient, SparqlConnectorLoadMethod")]
public ReadWriteSparqlConnector(SparqlRemoteEndpoint queryEndpoint, SparqlRemoteUpdateEndpoint updateEndpoint)
Parameters
Type | Name | Description |
---|---|---|
SparqlRemoteEndpoint | queryEndpoint | Query Endpoint. |
SparqlRemoteUpdateEndpoint | updateEndpoint | Update Endpoint. |
ReadWriteSparqlConnector(SparqlRemoteEndpoint, SparqlRemoteUpdateEndpoint, SparqlConnectorLoadMethod)
Creates a new connection.
Declaration
[Obsolete("Replaced by ReadWriteSparqlConnector(SparqlQueryClient, SparqlUpdateClient, SparqlConnectorLoadMethod")]
public ReadWriteSparqlConnector(SparqlRemoteEndpoint queryEndpoint, SparqlRemoteUpdateEndpoint updateEndpoint, SparqlConnectorLoadMethod mode)
Parameters
Type | Name | Description |
---|---|---|
SparqlRemoteEndpoint | queryEndpoint | Query Endpoint. |
SparqlRemoteUpdateEndpoint | updateEndpoint | Update Endpoint. |
SparqlConnectorLoadMethod | mode | Method for loading graphs. |
Properties
| Edit this page View SourceDeleteSupported
Gets that deleting graphs is supported.
Declaration
public override bool DeleteSupported { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceIOBehaviour
Gets the IO behaviour for the store.
Declaration
public override IOBehaviour IOBehaviour { get; }
Property Value
Type | Description |
---|---|
IOBehaviour |
Overrides
| Edit this page View SourceIsReadOnly
Gets that the store is not read-only.
Declaration
public override bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceTimeout
Gets/Sets the HTTP Timeout in milliseconds used for communicating with the SPARQL Endpoint.
Declaration
[Obsolete("This property is only used by the obsolete SparqlRemoteEndpoint-backed implementation.")]
public override int Timeout { get; set; }
Property Value
Type | Description |
---|---|
int |
Overrides
| Edit this page View SourceUpdateClient
Gets the underlying SparqlUpdateClient which this class is a wrapper around.
Declaration
public SparqlUpdateClient UpdateClient { get; }
Property Value
Type | Description |
---|---|
SparqlUpdateClient |
UpdateEndpoint
Gets the underlying SparqlRemoteUpdateEndpoint which this class is a wrapper around.
Declaration
[TypeConverter(typeof(ExpandableObjectConverter))]
[Obsolete]
public SparqlRemoteUpdateEndpoint UpdateEndpoint { get; }
Property Value
Type | Description |
---|---|
SparqlRemoteUpdateEndpoint |
UpdateSupported
Gets that triple level updates are supported, see the remarks section of the ReadWriteSparqlConnector for exactly what is and isn't supported.
Declaration
public override bool UpdateSupported { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
Methods
| Edit this page View SourceDeleteGraph(string)
Deletes a graph from the store.
Declaration
public override void DeleteGraph(string graphUri)
Parameters
Type | Name | Description |
---|---|---|
string | graphUri | URI of the graph to delete. |
Overrides
| Edit this page View SourceDeleteGraph(Uri)
Deletes a graph from the store.
Declaration
public override void DeleteGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
Uri | graphUri | URI of the graph to delete. |
Overrides
| Edit this page View SourceSaveGraph(IGraph)
Saves a graph to the store.
Declaration
public override void SaveGraph(IGraph g)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to save. |
Overrides
| Edit this page View SourceSerializeConfiguration(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)
Makes a SPARQL Update against the store.
Declaration
public void Update(string sparqlUpdate)
Parameters
Type | Name | Description |
---|---|---|
string | sparqlUpdate | SPARQL Update. |
UpdateGraph(string, IEnumerable<Triple>, IEnumerable<Triple>)
Updates a graph in the 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 add. |
IEnumerable<Triple> | removals | Triples to remove. |
Overrides
| Edit this page View SourceUpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>)
Updates a graph in the 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 add. |
IEnumerable<Triple> | removals | Triples to remove. |