Show / Hide Table of Contents

Class SparqlConnector

Class for connecting to any SPARQL Endpoint as a read-only Store.
Inheritance
System.Object
SparqlConnector
ReadWriteSparqlConnector
Implements
IQueryableStorage
IStorageProvider
IStorageCapabilities
System.IDisposable
IConfigurationSerializable
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 SparqlConnector : IQueryableStorage, IStorageProvider, IStorageCapabilities, IDisposable, IConfigurationSerializable
Remarks

This class is effectively a read-only wrapper around a SparqlRemoteEndpoint using it with it's default settings, if you only need to query an endpoint and require more control over the settings used to access the endpoint you should use that class directly or use the constructors which allow you to provide your own pre-configure SparqlRemoteEndpoint instance.

Unlike other HTTP based connectors this connector does not derive from BaseAsyncHttpConnector - if you need to specify proxy information you should do so on the SPARQL Endpoint you are wrapping either by providing a SparqlRemoteEndpoint instance pre-configured with the proxy settings or by accessing the endpoint via the Endpoint property and programmatically adding the settings.

Constructors

| Improve this Doc View Source

SparqlConnector(Uri)

Creates a new SPARQL Connector which uses the given SPARQL Endpoint.
Declaration
public SparqlConnector(Uri endpointUri)
Parameters
Type Name Description
System.Uri endpointUri Endpoint URI.
| Improve this Doc View Source

SparqlConnector(Uri, SparqlConnectorLoadMethod)

Creates a new SPARQL Connector which uses the given SPARQL Endpoint.
Declaration
public SparqlConnector(Uri endpointUri, SparqlConnectorLoadMethod mode)
Parameters
Type Name Description
System.Uri endpointUri Endpoint URI.
SparqlConnectorLoadMethod mode Load Method to use.
| Improve this Doc View Source

SparqlConnector(SparqlRemoteEndpoint)

Creates a new SPARQL Connector which uses the given SPARQL Endpoint.
Declaration
public SparqlConnector(SparqlRemoteEndpoint endpoint)
Parameters
Type Name Description
SparqlRemoteEndpoint endpoint Endpoint.
| Improve this Doc View Source

SparqlConnector(SparqlRemoteEndpoint, SparqlConnectorLoadMethod)

Creates a new SPARQL Connector which uses the given SPARQL Endpoint.
Declaration
public SparqlConnector(SparqlRemoteEndpoint endpoint, SparqlConnectorLoadMethod mode)
Parameters
Type Name Description
SparqlRemoteEndpoint endpoint Endpoint.
SparqlConnectorLoadMethod mode Load Method to use.

Fields

| Improve this Doc View Source

_endpoint

Underlying SPARQL query endpoint.
Declaration
protected SparqlRemoteEndpoint _endpoint
Field Value
Type Description
SparqlRemoteEndpoint
| Improve this Doc View Source

_mode

Method for loading graphs.
Declaration
protected SparqlConnectorLoadMethod _mode
Field Value
Type Description
SparqlConnectorLoadMethod
| Improve this Doc View Source

_skipLocalParsing

Whether to skip local parsing.
Declaration
protected bool _skipLocalParsing
Field Value
Type Description
System.Boolean
| Improve this Doc View Source

_timeout

Timeout for endpoints.
Declaration
protected int _timeout
Field Value
Type Description
System.Int32

Properties

| Improve this Doc View Source

DeleteSupported

Returns that deleting graphs is not supported.
Declaration
public virtual bool DeleteSupported { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Endpoint

Gets the underlying SparqlRemoteEndpoint which this class is a wrapper around.
Declaration
[TypeConverter(typeof(ExpandableObjectConverter))]
public SparqlRemoteEndpoint Endpoint { get; }
Property Value
Type Description
SparqlRemoteEndpoint
| Improve this Doc View Source

IOBehaviour

Gets the IO Behaviour of SPARQL Connections.
Declaration
public virtual IOBehaviour IOBehaviour { get; }
Property Value
Type Description
IOBehaviour
| Improve this Doc View Source

IsReadOnly

Returns that the Connection is read-only.
Declaration
public virtual bool IsReadOnly { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsReady

Returns that the Connection is ready.
Declaration
public virtual bool IsReady { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ListGraphsSupported

Returns that listing graphs is supported.
Declaration
public virtual bool ListGraphsSupported { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ParentServer

Gets the parent server (if any).
Declaration
public IStorageServer ParentServer { get; }
Property Value
Type Description
IStorageServer
| Improve this Doc View Source

SkipLocalParsing

Controls whether the Query will be parsed locally to accurately determine its Query Type for processing the response.
Declaration
public bool SkipLocalParsing { get; set; }
Property Value
Type Description
System.Boolean
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.
| Improve this Doc View Source

Timeout

Gets/Sets the HTTP Timeout in milliseconds used for communicating with the SPARQL Endpoint.
Declaration
public virtual int Timeout { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

UpdateSupported

Returns that Updates are not supported since this connection is read-only.
Declaration
public virtual bool UpdateSupported { get; }
Property Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

DeleteGraph(String)

Throws an exception as this connector provides a read-only connection.
Declaration
public virtual void DeleteGraph(string graphUri)
Parameters
Type Name Description
System.String graphUri URI of this Graph to delete.
Exceptions
Type Condition
RdfStorageException Thrown since this connection is read-only so you cannot delete graphs using it.
| Improve this Doc View Source

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.Uri graphUri URI of this Graph to delete.
Exceptions
Type Condition
RdfStorageException Thrown since this connection is read-only so you cannot delete graphs using it.
| Improve this Doc View Source

Dispose()

Disposes of the Connection.
Declaration
public void Dispose()
| Improve this Doc View Source

ListGraphs()

Lists the Graphs in the Store.
Declaration
public virtual IEnumerable<Uri> ListGraphs()
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Uri>
| Improve this Doc View Source

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.
System.String graphUri URI of the Graph to load.
| Improve this Doc View Source

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.Uri graphUri URI of the Graph to load.
| Improve this Doc View Source

LoadGraph(IRdfHandler, String)

Loads a Graph from the SPARQL Endpoint.
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.
| Improve this Doc View Source

LoadGraph(IRdfHandler, Uri)

Loads a Graph from the SPARQL Endpoint.
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.
| Improve this Doc View Source

Query(String)

Makes a Query against the SPARQL Endpoint.
Declaration
public object Query(string sparqlQuery)
Parameters
Type Name Description
System.String sparqlQuery SPARQL Query.
Returns
Type Description
System.Object
| Improve this Doc View Source

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
IRdfHandler rdfHandler RDF Handler.
ISparqlResultsHandler resultsHandler Results Handler.
System.String sparqlQuery SPARQL Query.
| Improve this Doc View Source

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.
Exceptions
Type Condition
RdfStorageException Always thrown since this Manager provides a read-only connection.
| Improve this Doc View Source

SerializeConfiguration(ConfigurationSerializationContext)

Serializes the connection's configuration.
Declaration
public virtual void SerializeConfiguration(ConfigurationSerializationContext context)
Parameters
Type Name Description
ConfigurationSerializationContext context Configuration Serialization Context.
| Improve this Doc View Source

ToString()

Gets a String which gives details 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>)

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
System.String graphUri Graph URI.
System.Collections.Generic.IEnumerable<Triple> additions Triples to be added.
System.Collections.Generic.IEnumerable<Triple> removals Triples to be removed.
| Improve this Doc View Source

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.Uri graphUri Graph URI.
System.Collections.Generic.IEnumerable<Triple> additions Triples to be added.
System.Collections.Generic.IEnumerable<Triple> removals Triples to be removed.

Implements

IQueryableStorage
IStorageProvider
IStorageCapabilities
System.IDisposable
IConfigurationSerializable

Extension Methods

Extensions.AsEnumerable<T>(T)
  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • SparqlConnector(Uri)
    • SparqlConnector(Uri, SparqlConnectorLoadMethod)
    • SparqlConnector(SparqlRemoteEndpoint)
    • SparqlConnector(SparqlRemoteEndpoint, SparqlConnectorLoadMethod)
  • Fields
    • _endpoint
    • _mode
    • _skipLocalParsing
    • _timeout
  • Properties
    • DeleteSupported
    • Endpoint
    • IOBehaviour
    • IsReadOnly
    • IsReady
    • ListGraphsSupported
    • ParentServer
    • SkipLocalParsing
    • Timeout
    • UpdateSupported
  • Methods
    • DeleteGraph(String)
    • DeleteGraph(Uri)
    • Dispose()
    • ListGraphs()
    • LoadGraph(IGraph, String)
    • LoadGraph(IGraph, Uri)
    • LoadGraph(IRdfHandler, String)
    • LoadGraph(IRdfHandler, Uri)
    • Query(String)
    • Query(IRdfHandler, ISparqlResultsHandler, String)
    • SaveGraph(IGraph)
    • SerializeConfiguration(ConfigurationSerializationContext)
    • ToString()
    • UpdateGraph(String, IEnumerable<Triple>, IEnumerable<Triple>)
    • UpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>)
  • Implements
  • Extension Methods
Back to top Generated by DocFX