Class SparqlConnector
Class for connecting to any SPARQL Endpoint as a read-only Store.
Implements
Inherited Members
Namespace: VDS.RDF.Storage
Assembly: dotNetRdf.dll
Syntax
public class SparqlConnector : IQueryableStorage, IStorageProvider, IStorageCapabilities, IDisposable, IConfigurationSerializable
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
Constructors
| Improve this Doc View SourceSparqlConnector(Uri, SparqlConnectorLoadMethod)
Creates a new SPARQL Connector which uses the given SPARQL Endpoint.
Declaration
[Obsolete("Replaced by SparqlConnector(SparqlQueryClient, SparqlConnectorLoadMethod)")]
public SparqlConnector(Uri endpointUri, SparqlConnectorLoadMethod mode)
Parameters
Type | Name | Description |
---|---|---|
System. |
endpointUri | Endpoint URI. |
Sparql |
mode | Load Method to use. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
SparqlConnector(Uri)
Creates a new SPARQL Connector which uses the given SPARQL Endpoint.
Declaration
[Obsolete("Replaced by SparqlConnector(SparqlQueryClient)")]
public SparqlConnector(Uri endpointUri)
Parameters
Type | Name | Description |
---|---|---|
System. |
endpointUri | Endpoint URI. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
SparqlConnector(SparqlQueryClient, SparqlConnectorLoadMethod)
Creates a new SPARQL connector which uses the given SPARQL query client.
Declaration
public SparqlConnector(SparqlQueryClient client, SparqlConnectorLoadMethod mode)
Parameters
Type | Name | Description |
---|---|---|
Sparql |
client | Query client to use. |
Sparql |
mode | Load method to use. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
SparqlConnector(SparqlQueryClient)
Creates a new SPARQL connector which uses the given SPARQL query client.
Declaration
public SparqlConnector(SparqlQueryClient client)
Parameters
Type | Name | Description |
---|---|---|
Sparql |
client |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
SparqlConnector(SparqlRemoteEndpoint, SparqlConnectorLoadMethod)
Creates a new SPARQL Connector which uses the given SPARQL Endpoint.
Declaration
[Obsolete("Replaced by SparqlConnector(SparqlQueryClient, SparqlConnectorLoadMethod)")]
public SparqlConnector(SparqlRemoteEndpoint endpoint, SparqlConnectorLoadMethod mode)
Parameters
Type | Name | Description |
---|---|---|
Sparql |
endpoint | Endpoint. |
Sparql |
mode | Load Method to use. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
SparqlConnector(SparqlRemoteEndpoint)
Creates a new SPARQL Connector which uses the given SPARQL Endpoint.
Declaration
[Obsolete("Replaced by SparqlConnector(SparqlQueryClient)")]
public SparqlConnector(SparqlRemoteEndpoint endpoint)
Parameters
Type | Name | Description |
---|---|---|
Sparql |
endpoint | Endpoint. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
Fields
| Improve this Doc View Source_endpoint
Underlying SPARQL query endpoint.
Declaration
protected SparqlRemoteEndpoint _endpoint
Field Value
Type | Description |
---|---|
Sparql |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
_mode
Method for loading graphs.
Declaration
protected SparqlConnectorLoadMethod _mode
Field Value
Type | Description |
---|---|
Sparql |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
_timeout
Timeout for endpoints.
Declaration
protected int _timeout
Field Value
Type | Description |
---|---|
int |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
Properties
| Improve this Doc View SourceDeleteSupported
Returns that deleting graphs is not supported.
Declaration
public virtual bool DeleteSupported { get; }
Property Value
Type | Description |
---|---|
System. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
Endpoint
Gets the underlying Sparql
Declaration
[TypeConverter(typeof(ExpandableObjectConverter))]
[Obsolete]
public SparqlRemoteEndpoint Endpoint { get; }
Property Value
Type | Description |
---|---|
Sparql |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
IOBehaviour
Gets the IO Behaviour of SPARQL Connections.
Declaration
public virtual IOBehaviour IOBehaviour { get; }
Property Value
Type | Description |
---|---|
IOBehaviour |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
IsReadOnly
Returns that the Connection is read-only.
Declaration
public virtual bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
System. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
IsReady
Returns that the Connection is ready.
Declaration
public virtual bool IsReady { get; }
Property Value
Type | Description |
---|---|
System. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
ListGraphsSupported
Returns that listing graphs is supported.
Declaration
public virtual bool ListGraphsSupported { get; }
Property Value
Type | Description |
---|---|
System. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
ParentServer
Gets the parent server (if any).
Declaration
public IStorageServer ParentServer { get; }
Property Value
Type | Description |
---|---|
IStorage |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
QueryClient
Gets the underlying Sparql
Declaration
public SparqlQueryClient QueryClient { get; }
Property Value
Type | Description |
---|---|
Sparql |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
SkipLocalParsing
Controls whether the Query will be parsed locally to accurately determine its Query Type for processing the response.
Declaration
[Obsolete("This property is no longer supported as local query parsing is not supported by this implementation. Clients wishing to ensure that only valid SPARQL is sent to a remote server should apply query parsing before invoking this class.")]
public bool SkipLocalParsing { get; set; }
Property Value
Type | Description |
---|---|
System. |
Remarks
If the endpoint you are connecting to provides extensions to SPARQL syntax which are not permitted by the libraries parser then you may wish to enable this option as otherwise you will not be able to execute such queries.
Timeout
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 virtual int Timeout { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
This property is only used when using the obsolete Sparql
UpdateSupported
Returns that Updates are not supported since this connection is read-only.
Declaration
public virtual bool UpdateSupported { get; }
Property Value
Type | Description |
---|---|
System. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
Methods
| Improve this Doc View SourceDeleteGraph(string)
Throws an exception as this connector provides a read-only connection.
Declaration
public virtual void DeleteGraph(string graphUri)
Parameters
Type | Name | Description |
---|---|---|
string | graphUri | URI of this Graph to delete. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
Exceptions
Type | Condition |
---|---|
Rdf |
Thrown since this connection is read-only so you cannot delete graphs using it. |
DeleteGraph(Uri)
Throws an exception as this connector provides a read-only connection.
Declaration
public virtual void DeleteGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System. |
graphUri | URI of this Graph to delete. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
Exceptions
Type | Condition |
---|---|
Rdf |
Thrown since this connection is read-only so you cannot delete graphs using it. |
Dispose()
Disposes of the Connection.
Declaration
public void Dispose()
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
ListGraphNames()
Gets an enumeration of the names of the graphs in the store.
Declaration
public virtual IEnumerable<string> ListGraphNames()
Returns
Type | Description |
---|---|
System. |
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()
Lists the Graphs in the Store.
Declaration
[Obsolete("Replaced by ListGraphNames()")]
public virtual IEnumerable<Uri> ListGraphs()
Returns
Type | Description |
---|---|
System. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
LoadGraph(IGraph, string)
Loads a Graph from the SPARQL Endpoint.
Declaration
public virtual void LoadGraph(IGraph g, string graphUri)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to load into. |
string | graphUri | URI of the Graph to load. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
LoadGraph(IGraph, Uri)
Loads a Graph from the SPARQL Endpoint.
Declaration
public virtual void LoadGraph(IGraph g, Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to load into. |
System. |
graphUri | URI of the Graph to load. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
LoadGraph(IRdfHandler, string)
Loads a Graph from the SPARQL Endpoint.
Declaration
public virtual void LoadGraph(IRdfHandler handler, string graphUri)
Parameters
Type | Name | Description |
---|---|---|
IRdf |
handler | RDF Handler. |
string | graphUri | URI of the Graph to load. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
LoadGraph(IRdfHandler, Uri)
Loads a Graph from the SPARQL Endpoint.
Declaration
public virtual void LoadGraph(IRdfHandler handler, Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
IRdf |
handler | RDF Handler. |
System. |
graphUri | URI of the Graph to load. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
Query(string)
Makes a Query against the SPARQL Endpoint.
Declaration
public object Query(string sparqlQuery)
Parameters
Type | Name | Description |
---|---|---|
string | sparqlQuery | SPARQL Query. |
Returns
Type | Description |
---|---|
System. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
Query(IRdfHandler, ISparqlResultsHandler, string)
Makes a Query against the SPARQL Endpoint processing the results with an appropriate handler from those provided.
Declaration
public void Query(IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, string sparqlQuery)
Parameters
Type | Name | Description |
---|---|---|
IRdf |
rdfHandler | RDF Handler. |
ISparql |
resultsHandler | Results Handler. |
string | sparqlQuery | SPARQL Query. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
SaveGraph(IGraph)
Throws an error since this Manager is read-only.
Declaration
public virtual void SaveGraph(IGraph g)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to save. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
Exceptions
Type | Condition |
---|---|
Rdf |
Always thrown since this Manager provides a read-only connection. |
SerializeConfiguration(ConfigurationSerializationContext)
Serializes the connection's configuration.
Declaration
public virtual void SerializeConfiguration(ConfigurationSerializationContext context)
Parameters
Type | Name | Description |
---|---|---|
Configuration |
context | Configuration Serialization Context. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
ToString()
Gets a String which gives details of the Connection.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
UpdateGraph(string, IEnumerable<Triple>, IEnumerable<Triple>)
Throws an error since this Manager is read-only.
Declaration
public virtual void UpdateGraph(string graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals)
Parameters
Type | Name | Description |
---|---|---|
string | graphUri | Graph URI. |
System. |
additions | Triples to be added. |
System. |
removals | Triples to be removed. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
UpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>)
Throws an error since this Manager is read-only.
Declaration
public virtual void UpdateGraph(Uri graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals)
Parameters
Type | Name | Description |
---|---|---|
System. |
graphUri | Graph URI. |
System. |
additions | Triples to be added. |
System. |
removals | Triples to be removed. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base
UpdateGraph(IRefNode, IEnumerable<Triple>, IEnumerable<Triple>)
Throws an error since this Manager is read-only.
Declaration
public virtual void UpdateGraph(IRefNode graphName, IEnumerable<Triple> additions, IEnumerable<Triple> removals)
Parameters
Type | Name | Description |
---|---|---|
IRef |
graphName | Graph name. |
System. |
additions | Triples to be added. |
System. |
removals | Triples to be removed. |
Remarks
This class is effectively a read-only wrapper around a Sparql
Unlike other HTTP based connectors this connector does not derive from Base