Show / Hide Table of Contents

Class FourStoreConnector

Class for connecting to 4store.

Inheritance
object
BaseHttpConnector
BaseAsyncHttpConnector
FourStoreConnector
Implements
IAsyncUpdateableStorage
IAsyncQueryableStorage
IAsyncStorageProvider
IConfigurationSerializable
IUpdateableStorage
IQueryableStorage
IStorageProvider
IStorageCapabilities
IDisposable
Inherited Members
BaseAsyncHttpConnector.ParentServer
BaseAsyncHttpConnector.AsyncParentServer
BaseAsyncHttpConnector.LoadGraph(IGraph, Uri, AsyncStorageCallback, object)
BaseAsyncHttpConnector.LoadGraph(IGraph, string, AsyncStorageCallback, object)
BaseAsyncHttpConnector.LoadGraph(IRdfHandler, Uri, AsyncStorageCallback, object)
BaseAsyncHttpConnector.LoadGraphAsync(IGraph, string, CancellationToken)
BaseAsyncHttpConnector.LoadGraphAsync(HttpRequestMessage, IRdfHandler, AsyncStorageCallback, object)
BaseAsyncHttpConnector.LoadGraphAsync(HttpRequestMessage, IRdfHandler, CancellationToken)
BaseAsyncHttpConnector.SaveGraphAsync(HttpRequestMessage, IRdfWriter, IGraph, AsyncStorageCallback, object)
BaseAsyncHttpConnector.SaveGraphAsync(HttpRequestMessage, IGraph, AsyncStorageCallback, object)
BaseAsyncHttpConnector.SaveGraphAsync(HttpRequestMessage, CancellationToken)
BaseAsyncHttpConnector.SaveGraphAsync(HttpWebRequest, IRdfWriter, IGraph, AsyncStorageCallback, object)
BaseAsyncHttpConnector.UpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>, AsyncStorageCallback, object)
BaseAsyncHttpConnector.UpdateGraphAsync(HttpWebRequest, IRdfWriter, Uri, IEnumerable<Triple>, AsyncStorageCallback, object)
BaseAsyncHttpConnector.UpdateGraphAsync(HttpRequestMessage, IRdfWriter, Uri, IEnumerable<Triple>, AsyncStorageCallback, object)
BaseAsyncHttpConnector.UpdateGraphAsync(HttpRequestMessage, IRdfWriter, IEnumerable<Triple>, CancellationToken)
BaseAsyncHttpConnector.DeleteGraph(Uri, AsyncStorageCallback, object)
BaseAsyncHttpConnector.DeleteGraphAsync(HttpWebRequest, bool, string, AsyncStorageCallback, object)
BaseAsyncHttpConnector.DeleteGraphAsync(HttpRequestMessage, bool, string, AsyncStorageCallback, object)
BaseAsyncHttpConnector.DeleteGraphAsync(HttpRequestMessage, bool, CancellationToken)
BaseAsyncHttpConnector.ListGraphs(AsyncStorageCallback, object)
BaseAsyncHttpConnector.ListGraphsAsync(CancellationToken)
BaseAsyncHttpConnector.UriFactory
BaseAsyncHttpConnector.MakeRequestSequence(IEnumerable<HttpRequestMessage>, AsyncStorageCallback, object)
BaseHttpConnector.HttpClient
BaseHttpConnector.HttpClientHandler
BaseHttpConnector.SetProxy(string)
BaseHttpConnector.SetProxy(Uri)
BaseHttpConnector.Proxy
BaseHttpConnector.ClearProxy()
BaseHttpConnector.SetProxyCredentials(string, string)
BaseHttpConnector.SetProxyCredentials(string, string, string)
BaseHttpConnector.ProxyCredentials
BaseHttpConnector.ClearProxyCredentials()
BaseHttpConnector.Timeout
BaseHttpConnector.SerializeStandardConfig(INode, ConfigurationSerializationContext)
BaseHttpConnector.SetCredentials(string, string)
BaseHttpConnector.Dispose()
BaseHttpConnector.Dispose(bool)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: VDS.RDF.Storage
Assembly: dotNetRdf.Client.dll
Syntax
public class FourStoreConnector : BaseAsyncHttpConnector, IAsyncUpdateableStorage, IAsyncQueryableStorage, IAsyncStorageProvider, IConfigurationSerializable, IUpdateableStorage, IQueryableStorage, IStorageProvider, IStorageCapabilities, IDisposable
Remarks

Depending on the version of RASQAL used for your 4store instance and the options it was built with some kinds of queries may not suceed or return unexpected results.

Prior to the 1.x releases 4store did not permit the saving of unamed Graphs to the Store or Triple level updates. There was a branch of 4store that supports Triple level updates and you could tell the connector if your 4store instance supports this when you instantiate it. From the 0.4.0 release of the library onwards this support was enabled by default since the 1.x builds of 4store have this feature integrated into them by default.

Constructors

| Edit this page View Source

FourStoreConnector(string)

Creates a new 4store connector which manages access to the services provided by a 4store server.

Declaration
public FourStoreConnector(string baseUri)
Parameters
Type Name Description
string baseUri

Base Uri of the 4store.

Remarks

Note: As of the 0.4.0 release 4store support defaults to Triple Level updates enabled as all recent 4store releases have supported this. You can still optionally disable this with the two argument version of the constructor.

| Edit this page View Source

FourStoreConnector(string, bool)

Creates a new 4store connector which manages access to the services provided by a 4store server.

Declaration
public FourStoreConnector(string baseUri, bool enableUpdateSupport)
Parameters
Type Name Description
string baseUri

Base Uri of the 4store.

bool enableUpdateSupport

Indicates to the connector that you are using a 4store instance that supports Triple level updates.

Remarks

If you enable Update support but are using a 4store instance that does not support Triple level updates then you will almost certainly experience errors while using the connector.

| Edit this page View Source

FourStoreConnector(string, bool, IWebProxy)

Creates a new 4store connector which manages access to the services provided by a 4store server.

Declaration
public FourStoreConnector(string baseUri, bool enableUpdateSupport, IWebProxy proxy)
Parameters
Type Name Description
string baseUri

Base Uri of the 4store.

bool enableUpdateSupport

Indicates to the connector that you are using a 4store instance that supports Triple level updates.

IWebProxy proxy

Proxy Server.

Remarks

If you enable Update support but are using a 4store instance that does not support Triple level updates then you will almost certainly experience errors while using the connector.

| Edit this page View Source

FourStoreConnector(string, IWebProxy)

Creates a new 4store connector which manages access to the services provided by a 4store server.

Declaration
public FourStoreConnector(string baseUri, IWebProxy proxy)
Parameters
Type Name Description
string baseUri

Base Uri of the 4store.

IWebProxy proxy

Proxy Server.

Remarks

Note: As of the 0.4.0 release 4store support defaults to Triple Level updates enabled as all recent 4store releases have supported this. You can still optionally disable this with the two argument version of the constructor.

Properties

| Edit this page View Source

DeleteSupported

Returns that deleting Graph is supported.

Declaration
public override bool DeleteSupported { get; }
Property Value
Type Description
bool
Overrides
BaseAsyncHttpConnector.DeleteSupported
| Edit this page View Source

IOBehaviour

Gets the IO Behaviour of 4store.

Declaration
public override IOBehaviour IOBehaviour { get; }
Property Value
Type Description
IOBehaviour
Overrides
BaseAsyncHttpConnector.IOBehaviour
| Edit this page View Source

IsReadOnly

Returns that the Connection is not read-only.

Declaration
public override bool IsReadOnly { get; }
Property Value
Type Description
bool
Overrides
BaseAsyncHttpConnector.IsReadOnly
| Edit this page View Source

IsReady

Returns that the Connection is ready.

Declaration
public override bool IsReady { get; }
Property Value
Type Description
bool
Overrides
BaseAsyncHttpConnector.IsReady
| Edit this page View Source

ListGraphsSupported

Returns that Listing Graphs is supported.

Declaration
public override bool ListGraphsSupported { get; }
Property Value
Type Description
bool
Overrides
BaseAsyncHttpConnector.ListGraphsSupported
| Edit this page View Source

UpdateSupported

Returns whether this connector has been instantiated with update support or not.

Declaration
public override bool UpdateSupported { get; }
Property Value
Type Description
bool
Overrides
BaseAsyncHttpConnector.UpdateSupported
Remarks

If this property returns true it does not guarantee that the 4store instance actually supports updates it simply indicates that the user has enabled updates on the connector. If Updates are enabled and the 4store server being connected to does not support updates then errors will occur.

Methods

| Edit this page View Source

DeleteGraph(string)

Deletes a Graph from the 4store server.

Declaration
public void DeleteGraph(string graphUri)
Parameters
Type Name Description
string graphUri

Uri of Graph to delete.

| Edit this page View Source

DeleteGraph(string, AsyncStorageCallback, object)

Deletes a Graph from the Store.

Declaration
public override void DeleteGraph(string graphUri, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
string graphUri

URI of the Graph to delete.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

Overrides
BaseAsyncHttpConnector.DeleteGraph(string, AsyncStorageCallback, object)
| Edit this page View Source

DeleteGraph(Uri)

Deletes a Graph from the 4store server.

Declaration
public void DeleteGraph(Uri graphUri)
Parameters
Type Name Description
Uri graphUri

Uri of Graph to delete.

| Edit this page View Source

DeleteGraphAsync(string, CancellationToken)

Deletes a graph from the store asynchronously.

Declaration
public override Task DeleteGraphAsync(string graphName, CancellationToken cancellationToken)
Parameters
Type Name Description
string graphName

Name of the graph to delete.

CancellationToken cancellationToken
Returns
Type Description
Task
Overrides
BaseAsyncHttpConnector.DeleteGraphAsync(string, CancellationToken)
| Edit this page View Source

ListGraphNames()

Gets an enumeration of the names of the graphs in the store.

Declaration
public IEnumerable<string> ListGraphNames()
Returns
Type Description
IEnumerable<string>
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.

| Edit this page View Source

ListGraphs()

Lists the Graphs in the Store.

Declaration
public IEnumerable<Uri> ListGraphs()
Returns
Type Description
IEnumerable<Uri>
| Edit this page View Source

LoadGraph(IGraph, string)

Loads a Graph from the 4store instance.

Declaration
public void LoadGraph(IGraph g, string graphUri)
Parameters
Type Name Description
IGraph g

Graph to load into.

string graphUri

URI of the Graph to load.

| Edit this page View Source

LoadGraph(IGraph, Uri)

Loads a Graph from the 4store instance.

Declaration
public void LoadGraph(IGraph g, Uri graphUri)
Parameters
Type Name Description
IGraph g

Graph to load into.

Uri graphUri

Uri of the Graph to load.

| Edit this page View Source

LoadGraph(IRdfHandler, string)

Loads a Graph from the 4store instance.

Declaration
public void LoadGraph(IRdfHandler handler, string graphUri)
Parameters
Type Name Description
IRdfHandler handler

RDF Handler.

string graphUri

URI of the Graph to load.

| Edit this page View Source

LoadGraph(IRdfHandler, string, AsyncStorageCallback, object)

Loads a Graph from the Store asynchronously.

Declaration
public override void LoadGraph(IRdfHandler handler, string graphUri, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
IRdfHandler handler

Handler to load with.

string graphUri

URI of the Graph to load.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

Overrides
BaseAsyncHttpConnector.LoadGraph(IRdfHandler, string, AsyncStorageCallback, object)
| Edit this page View Source

LoadGraph(IRdfHandler, Uri)

Loads a Graph from the 4store instance using an RDF Handler.

Declaration
public void LoadGraph(IRdfHandler handler, Uri graphUri)
Parameters
Type Name Description
IRdfHandler handler

RDF Handler.

Uri graphUri

URI of the Graph to load.

| Edit this page View Source

LoadGraphAsync(IRdfHandler, string, CancellationToken)

Loads a graph from the store asynchronously.

Declaration
public override Task LoadGraphAsync(IRdfHandler handler, string graphName, CancellationToken cancellationToken)
Parameters
Type Name Description
IRdfHandler handler

The handler to receive the loaded triples.

string graphName

Name of the graph to load.

CancellationToken cancellationToken
Returns
Type Description
Task
Overrides
BaseAsyncHttpConnector.LoadGraphAsync(IRdfHandler, string, CancellationToken)
| Edit this page View Source

Query(string)

Makes a SPARQL Query against the underlying 4store Instance.

Declaration
public object Query(string sparqlQuery)
Parameters
Type Name Description
string sparqlQuery

SPARQL Query.

Returns
Type Description
object

A Graph or a SparqlResultSet.

Remarks

Depending on the version of RASQAL used and the options it was built with some kinds of queries may not suceed or return unexpected results.

| Edit this page View Source

Query(string, AsyncStorageCallback, object)

Queries the store asynchronously.

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.

| Edit this page View Source

Query(IRdfHandler, ISparqlResultsHandler, string)

Makes a SPARQL Query against the underlying 4store Instance processing the results with the 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.

| Edit this page View Source

Query(IRdfHandler, ISparqlResultsHandler, string, AsyncStorageCallback, object)

Queries the store asynchronously.

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.

| Edit this page View Source

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>
| Edit this page View Source

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
| Edit this page View Source

SaveGraph(IGraph)

Saves a Graph to a 4store instance (Warning: Completely replaces any existing Graph with the same URI).

Declaration
public void SaveGraph(IGraph g)
Parameters
Type Name Description
IGraph g

Graph to save.

Remarks

Completely replaces any existing Graph with the same Uri in the store.

Attempting to save a Graph which doesn't have a Base Uri will result in an error.

Exceptions
Type Condition
RdfStorageException

Thrown if you try and save a Graph without a Base Uri or if there is an error communicating with the 4store instance.

| Edit this page View Source

SaveGraph(IGraph, AsyncStorageCallback, object)

Saves a Graph to the Store asynchronously.

Declaration
public override void SaveGraph(IGraph g, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
IGraph g

Graph to save.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

Overrides
BaseAsyncHttpConnector.SaveGraph(IGraph, AsyncStorageCallback, object)
| Edit this page View Source

SaveGraphAsync(IGraph, CancellationToken)

Saves a Graph to the Store asynchronously.

Declaration
public override Task SaveGraphAsync(IGraph g, CancellationToken cancellationToken)
Parameters
Type Name Description
IGraph g

Graph to save.

CancellationToken cancellationToken
Returns
Type Description
Task
Overrides
BaseAsyncHttpConnector.SaveGraphAsync(IGraph, CancellationToken)
| Edit this page View Source

SerializeConfiguration(ConfigurationSerializationContext)

Serializes the connection's configuration.

Declaration
public void SerializeConfiguration(ConfigurationSerializationContext context)
Parameters
Type Name Description
ConfigurationSerializationContext context
| Edit this page View Source

ToString()

Gets a String which gives details of the Connection.

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()
| Edit this page View Source

Update(string)

Applies a SPARQL Update against 4store.

Declaration
public void Update(string sparqlUpdate)
Parameters
Type Name Description
string sparqlUpdate

SPARQL Update.

Remarks

Note: Please be aware that some valid SPARQL Updates may not be accepted by 4store since the SPARQL parser used by 4store does not support some of the latest editors draft syntax changes.

| Edit this page View Source

Update(string, AsyncStorageCallback, object)

Updates the store asynchronously.

Declaration
public void Update(string sparqlUpdates, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
string sparqlUpdates

SPARQL Update.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

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
| Edit this page View Source

UpdateGraph(string, IEnumerable<Triple>, IEnumerable<Triple>)

Updates a Graph in the store.

Declaration
public 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.

Remarks

May throw an error since the default builds of 4store don't support Triple level updates. There are builds that do support this and the user can instantiate the connector with support for this enabled if they wish, if they do so and the underlying 4store doesn't support updates errors will occur when updates are attempted.

| Edit this page View Source

UpdateGraph(string, IEnumerable<Triple>, IEnumerable<Triple>, AsyncStorageCallback, object)

Updates a Graph in the Store asynchronously.

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
BaseAsyncHttpConnector.UpdateGraph(string, IEnumerable<Triple>, IEnumerable<Triple>, AsyncStorageCallback, object)
| Edit this page View Source

UpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>)

Updates a Graph in the store.

Declaration
public 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.

Remarks

May throw an error since the default builds of 4store don't support Triple level updates. There are builds that do support this and the user can instantiate the connector with support for this enabled if they wish, if they do so and the underlying 4store doesn't support updates errors will occur when updates are attempted.

| Edit this page View Source

UpdateGraph(IRefNode, IEnumerable<Triple>, IEnumerable<Triple>)

Updates a graph in the store.

Declaration
public void UpdateGraph(IRefNode graphName, IEnumerable<Triple> additions, IEnumerable<Triple> removals)
Parameters
Type Name Description
IRefNode graphName

Name of the graph to update.

IEnumerable<Triple> additions

Triples to be added.

IEnumerable<Triple> removals

Triples to be removed.

Remarks

May throw an error since the default builds of 4store don't support Triple level updates. There are builds that do support this and the user can instantiate the connector with support for this enabled if they wish, if they do so and the underlying 4store doesn't support updates errors will occur when updates are attempted.

| Edit this page View Source

UpdateGraphAsync(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
Overrides
BaseAsyncHttpConnector.UpdateGraphAsync(string, IEnumerable<Triple>, IEnumerable<Triple>, CancellationToken)

Implements

IAsyncUpdateableStorage
IAsyncQueryableStorage
IAsyncStorageProvider
IConfigurationSerializable
IUpdateableStorage
IQueryableStorage
IStorageProvider
IStorageCapabilities
IDisposable

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • FourStoreConnector(string)
    • FourStoreConnector(string, bool)
    • FourStoreConnector(string, bool, IWebProxy)
    • FourStoreConnector(string, IWebProxy)
  • Properties
    • DeleteSupported
    • IOBehaviour
    • IsReadOnly
    • IsReady
    • ListGraphsSupported
    • UpdateSupported
  • Methods
    • DeleteGraph(string)
    • DeleteGraph(string, AsyncStorageCallback, object)
    • DeleteGraph(Uri)
    • DeleteGraphAsync(string, CancellationToken)
    • ListGraphNames()
    • ListGraphs()
    • LoadGraph(IGraph, string)
    • LoadGraph(IGraph, Uri)
    • LoadGraph(IRdfHandler, string)
    • LoadGraph(IRdfHandler, string, AsyncStorageCallback, object)
    • LoadGraph(IRdfHandler, Uri)
    • LoadGraphAsync(IRdfHandler, string, CancellationToken)
    • Query(string)
    • Query(string, AsyncStorageCallback, object)
    • Query(IRdfHandler, ISparqlResultsHandler, string)
    • Query(IRdfHandler, ISparqlResultsHandler, string, AsyncStorageCallback, object)
    • QueryAsync(string, CancellationToken)
    • QueryAsync(IRdfHandler, ISparqlResultsHandler, string, CancellationToken)
    • SaveGraph(IGraph)
    • SaveGraph(IGraph, AsyncStorageCallback, object)
    • SaveGraphAsync(IGraph, CancellationToken)
    • SerializeConfiguration(ConfigurationSerializationContext)
    • ToString()
    • Update(string)
    • Update(string, AsyncStorageCallback, object)
    • UpdateAsync(string, CancellationToken)
    • UpdateGraph(string, IEnumerable<Triple>, IEnumerable<Triple>)
    • UpdateGraph(string, IEnumerable<Triple>, IEnumerable<Triple>, AsyncStorageCallback, object)
    • UpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>)
    • UpdateGraph(IRefNode, IEnumerable<Triple>, IEnumerable<Triple>)
    • UpdateGraphAsync(string, IEnumerable<Triple>, IEnumerable<Triple>, CancellationToken)
  • Implements
  • Extension Methods
Back to top Generated by DocFX