Show / Hide Table of Contents

Class BaseStardogConnector

Abstract implementation of a connector for Stardog that connects using the HTTP protocol.

Inheritance
object
BaseHttpConnector
BaseAsyncHttpConnector
BaseStardogConnector
StardogV1Connector
Implements
IAsyncQueryableStorage
IAsyncStorageProvider
IAsyncTransactionalStorage
IConfigurationSerializable
IQueryableStorage
ITransactionalStorage
IReasoningQueryableStorage
IStorageProvider
IStorageCapabilities
IDisposable
Inherited Members
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()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: VDS.RDF.Storage
Assembly: dotNetRdf.dll
Syntax
public abstract class BaseStardogConnector : BaseAsyncHttpConnector, IAsyncQueryableStorage, IAsyncStorageProvider, IAsyncTransactionalStorage, IConfigurationSerializable, IQueryableStorage, ITransactionalStorage, IReasoningQueryableStorage, IStorageProvider, IStorageCapabilities, IDisposable
Remarks

Has full support for Stardog Transactions, connection is in auto-commit mode by default i.e. all write operations (Delete/Save/Update) will create and use a dedicated transaction for their operation, if the operation fails the transaction will automatically be rolled back. You can manage Transactions using the Begin(), Commit() and Rollback() methods.

The connector maintains a single transaction which is shared across all threads since Stardog is currently provides only MRSW (Multiple Reader Single Writer) concurrency and does not permit multiple transactions to occur simultaneously.

Constructors

| Edit this page View Source

BaseStardogConnector(string, string)

Creates a new connection to a Stardog Store.

Declaration
protected BaseStardogConnector(string baseUri, string kbID)
Parameters
Type Name Description
string baseUri

Base Uri of the Server.

string kbID

Knowledge Base (i.e. Database) ID.

| Edit this page View Source

BaseStardogConnector(string, string, IWebProxy)

Creates a new connection to a Stardog Store.

Declaration
protected BaseStardogConnector(string baseUri, string kbID, IWebProxy proxy)
Parameters
Type Name Description
string baseUri

Base Uri of the Server.

string kbID

Knowledge Base (i.e. Database) ID.

IWebProxy proxy

Proxy Server.

| Edit this page View Source

BaseStardogConnector(string, string, string, string)

Creates a new connection to a Stardog Store.

Declaration
protected BaseStardogConnector(string baseUri, string kbID, string username, string password)
Parameters
Type Name Description
string baseUri

Base Uri of the Server.

string kbID

Knowledge Base (i.e. Database) ID.

string username

Username.

string password

Password.

| Edit this page View Source

BaseStardogConnector(string, string, string, string, IWebProxy)

Creates a new connection to a Stardog Store.

Declaration
protected BaseStardogConnector(string baseUri, string kbID, string username, string password, IWebProxy proxy)
Parameters
Type Name Description
string baseUri

Base Uri of the Server.

string kbID

Knowledge Base (i.e. Database) ID.

string username

Username.

string password

Password.

IWebProxy proxy

Proxy Server.

| Edit this page View Source

BaseStardogConnector(string, string, StardogReasoningMode)

Creates a new connection to a Stardog Store.

Declaration
protected BaseStardogConnector(string baseUri, string kbID, StardogReasoningMode reasoning)
Parameters
Type Name Description
string baseUri

Base Uri of the Server.

string kbID

Knowledge Base (i.e. Database) ID.

StardogReasoningMode reasoning

Reasoning Mode.

| Edit this page View Source

BaseStardogConnector(string, string, StardogReasoningMode, HttpClientHandler)

Create a new connection to a Stardog store.

Declaration
protected BaseStardogConnector(string baseUri, string kbId, StardogReasoningMode reasoning, HttpClientHandler httpClientHandler)
Parameters
Type Name Description
string baseUri

Base URI of the server.

string kbId

Knowledge base ID.

StardogReasoningMode reasoning

Reasoning mode.

HttpClientHandler httpClientHandler

Handler to configure outgoing HTTP requests.

| Edit this page View Source

BaseStardogConnector(string, string, StardogReasoningMode, IWebProxy)

Creates a new connection to a Stardog Store.

Declaration
protected BaseStardogConnector(string baseUri, string kbID, StardogReasoningMode reasoning, IWebProxy proxy)
Parameters
Type Name Description
string baseUri

Base Uri of the Server.

string kbID

Knowledge Base (i.e. Database) ID.

StardogReasoningMode reasoning

Reasoning Mode.

IWebProxy proxy

Proxy Server.

| Edit this page View Source

BaseStardogConnector(string, string, StardogReasoningMode, string, string)

Creates a new connection to a Stardog Store.

Declaration
protected BaseStardogConnector(string baseUri, string kbID, StardogReasoningMode reasoning, string username, string password)
Parameters
Type Name Description
string baseUri

Base Uri of the Server.

string kbID

Knowledge Base (i.e. Database) ID.

StardogReasoningMode reasoning

Reasoning Mode.

string username

Username.

string password

Password.

| Edit this page View Source

BaseStardogConnector(string, string, StardogReasoningMode, string, string, IWebProxy)

Creates a new connection to a Stardog Store.

Declaration
protected BaseStardogConnector(string baseUri, string kbID, StardogReasoningMode reasoning, string username, string password, IWebProxy proxy)
Parameters
Type Name Description
string baseUri

Base Uri of the Server.

string kbID

Knowledge Base (i.e. Database) ID.

StardogReasoningMode reasoning

Reasoning Mode.

string username

Username.

string password

Password.

IWebProxy proxy

Proxy Server.

Fields

| Edit this page View Source

AnonymousUser

Constant for the default Anonymous user account and password used by Stardog if you have not supplied a shiro.ini file or otherwise disabled security.

Declaration
public const string AnonymousUser = "anonymous"
Field Value
Type Description
string
| Edit this page View Source

Server

The underlying server connection.

Declaration
protected BaseStardogServer Server
Field Value
Type Description
BaseStardogServer

Properties

| Edit this page View Source

AsyncParentServer

Gets the parent server.

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

BaseUri

Gets the Base URI of the Stardog server.

Declaration
public string BaseUri { get; }
Property Value
Type Description
string
| Edit this page View Source

DeleteSupported

Returns that deleting graphs from the Stardog store is not yet supported (due to a .Net specific issue).

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 Stardog.

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
Remarks

Returns true if the knowledge base specified in the class constructor is found on the server, false otherwise.

| Edit this page View Source

KbId

Gets the knowledge base ID being used by this connector.

Declaration
public string KbId { get; }
Property Value
Type Description
string
| 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

ParentServer

Gets the parent server.

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

Reasoning

Gets/Sets the reasoning mode to use for queries.

Declaration
public virtual StardogReasoningMode Reasoning { get; set; }
Property Value
Type Description
StardogReasoningMode
| Edit this page View Source

UpdateSupported

Returns that Updates are supported on Stardog Stores.

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

Methods

| Edit this page View Source

AddStardogHeaders(HttpRequestMessage)

Adds Stardog specific request headers; reasoning needed for < 2.2.

Declaration
protected virtual void AddStardogHeaders(HttpRequestMessage request)
Parameters
Type Name Description
HttpRequestMessage request
| Edit this page View Source

AddStardogHeaders(HttpWebRequest)

Adds Stardog specific request headers; reasoning needed for < 2.2.

Declaration
[Obsolete("This method is obsolete and will be removed in a future release. Replaced by AddStardogHeaders(HttpRequestMessage).")]
protected virtual void AddStardogHeaders(HttpWebRequest request)
Parameters
Type Name Description
HttpWebRequest request
| Edit this page View Source

Begin()

Begins a new Transaction.

Declaration
public virtual void Begin()
Remarks

A single transaction.

| Edit this page View Source

Begin(bool)

Begins a new Transaction.

Declaration
public virtual void Begin(bool enableReasoning)
Parameters
Type Name Description
bool enableReasoning

Opens the transaction with reasoning enabled.

Remarks

A single transaction.

| Edit this page View Source

Begin(AsyncStorageCallback, object)

Begins a transaction asynchronously.

Declaration
public virtual void Begin(AsyncStorageCallback callback, object state)
Parameters
Type Name Description
AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

BeginAsync(CancellationToken)

Begins a transaction asynchronously.

Declaration
public virtual Task BeginAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task
Exceptions
Type Condition
RdfStorageException

Raised if there is already an active transaction for this connector or if the Stardog server responds with an error status code or a null or empty response.

| Edit this page View Source

BeginTransaction(bool)

Start a transaction.

Declaration
protected virtual string BeginTransaction(bool enableReasoning = false)
Parameters
Type Name Description
bool enableReasoning

Opens the transaction with reasoning enabled (requires StarDog v5.3.0 or later).

Returns
Type Description
string

A transaction ID for the new transaction.

| Edit this page View Source

Commit()

Commits the active Transaction.

Declaration
public virtual void Commit()
Remarks

Transactions are scoped to Managed Threads.

Exceptions
Type Condition
RdfStorageException

Thrown if there is not an active Transaction on the current Thread.

| Edit this page View Source

Commit(AsyncStorageCallback, object)

Commits a transaction asynchronously.

Declaration
public virtual void Commit(AsyncStorageCallback callback, object state)
Parameters
Type Name Description
AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

CommitAsync(CancellationToken)

Commit a transaction asynchronously.

Declaration
public virtual Task CommitAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task
Exceptions
Type Condition
RdfStorageException

Raised if there is currently no open transaction for this connector, or if the Stardog server responds with an error status code.

| Edit this page View Source

CommitTransaction(string)

Commit an open transaction.

Declaration
protected virtual void CommitTransaction(string transactionId)
Parameters
Type Name Description
string transactionId

The ID of the transaction to commit.

| Edit this page View Source

CreateRequest(string, string, HttpMethod, Dictionary<string, string>)

Helper method for creating HTTP Requests to the Store.

Declaration
protected virtual HttpRequestMessage CreateRequest(string servicePath, string accept, HttpMethod method, Dictionary<string, string> requestParams)
Parameters
Type Name Description
string servicePath

Path to the Service requested.

string accept

Acceptable Content Types.

HttpMethod method

HTTP Method.

Dictionary<string, string> requestParams

Querystring Parameters.

Returns
Type Description
HttpRequestMessage
| Edit this page View Source

CreateRequest(string, string, string, Dictionary<string, string>)

Helper method for creating HTTP Requests to the Store.

Declaration
[Obsolete("This method has been replaced by CreateRequest(string, string, HttpMethod, Dictionary<string, string>.")]
protected virtual HttpWebRequest CreateRequest(string servicePath, string accept, string method, Dictionary<string, string> requestParams)
Parameters
Type Name Description
string servicePath

Path to the Service requested.

string accept

Acceptable Content Types.

string method

HTTP Method.

Dictionary<string, string> requestParams

Querystring Parameters.

Returns
Type Description
HttpWebRequest
| Edit this page View Source

DeleteGraph(string)

Deletes a Graph from the Stardog store.

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

URI of the 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 Stardog store.

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

URI of the Graph to delete.

| Edit this page View Source

DeleteGraphAsync(string, bool, string, AsyncStorageCallback, object)

Delete a graph as part of an open transaction.

Declaration
protected virtual void DeleteGraphAsync(string tID, bool autoCommit, string graphUri, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
string tID

The ID of the transaction to use.

bool autoCommit

True to commit the transaction at the end of the delete operation, false to leave the transaction open.

string graphUri

The URI of the graph to delete.

AsyncStorageCallback callback

Callback to invoked on completion of the operation.

object state

Additional state to pass into the callback.

| Edit this page View Source

DeleteGraphAsync(string, string, bool, CancellationToken)

Delete a graph asynchronously withing the context of a transaction.

Declaration
protected virtual Task DeleteGraphAsync(string transactionId, string graphName, bool autoCommit, CancellationToken cancellationToken)
Parameters
Type Name Description
string transactionId

The transaction to use.

string graphName

The name of the graph to be deleted.

bool autoCommit

Whether to automatically commit/rollback the transaction.

CancellationToken cancellationToken
Returns
Type Description
Task
Exceptions
Type Condition
RdfStorageException

Raised if the Stardog server responds with an error status code when deleting thre graph or commiting the transaction.

| 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

Dispose(bool)

Disposes of the Connector.

Declaration
protected override void Dispose(bool disposing)
Parameters
Type Name Description
bool disposing
Overrides
BaseHttpConnector.Dispose(bool)
| Edit this page View Source

GetReasoningParameter()

Get the query parameter string that specifies the current reasoning mode.

Declaration
protected virtual string GetReasoningParameter()
Returns
Type Description
string
| Edit this page View Source

ListGraphNames()

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

Declaration
public virtual 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()

Gets the list of Graphs in the Stardog store.

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

LoadGraph(IGraph, string)

Loads a Graph from the Store.

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

If an empty/null Uri is specified then the Default Graph of the Store will be loaded.

| Edit this page View Source

LoadGraph(IGraph, Uri)

Loads a Graph from the Store.

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

Graph to load into.

Uri graphUri

URI of the Graph to load.

Remarks

If an empty/null URI is specified then the Default Graph of the Store will be loaded.

| Edit this page View Source

LoadGraph(IRdfHandler, string)

Loads a Graph from the Store.

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

RDF Handler.

string graphUri

URI of the Graph to load.

Remarks

If an empty/null URI is specified then the Default Graph of the Store will be loaded.

| 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 Store.

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

RDF Handler.

Uri graphUri

URI of the Graph to load.

Remarks

If an empty/null URI is specified then the Default Graph of the Store will be loaded.

| 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

MakeAddTriplesRequestMessage(string, string, IEnumerable<Triple>)

Helper method to construct an HTTP request to add triples to a graph.

Declaration
protected virtual HttpRequestMessage MakeAddTriplesRequestMessage(string transactionId, string graphName, IEnumerable<Triple> additions)
Parameters
Type Name Description
string transactionId

The ID of the transaction to use for the update.

string graphName

The name of the graph to be updated.

IEnumerable<Triple> additions

The triples to add to the graph.

Returns
Type Description
HttpRequestMessage
| Edit this page View Source

MakeDeleteGraphRequestMessage(string, string)

Helper method that constructs the request message to send to the server to delete a graph.

Declaration
protected virtual HttpRequestMessage MakeDeleteGraphRequestMessage(string transactionId, string graphName)
Parameters
Type Name Description
string transactionId

The ID of the transaction within which the graph will be deleted.

string graphName

The name of the graph to be deleted.

Returns
Type Description
HttpRequestMessage

A configured HttpRequestMessage instance.

| Edit this page View Source

MakeRemoveTriplesRequestMessage(string, string, IEnumerable<Triple>)

Helper method to construct an HTTP request to remove triples from a graph.

Declaration
protected virtual HttpRequestMessage MakeRemoveTriplesRequestMessage(string transactionId, string graphName, IEnumerable<Triple> removals)
Parameters
Type Name Description
string transactionId

The ID of the transaction to use for the update.

string graphName

The name of the graph to be updated.

IEnumerable<Triple> removals

The triples to remove from the graph.

Returns
Type Description
HttpRequestMessage
| Edit this page View Source

Query(string)

Makes a SPARQL Query against the underlying Store using whatever reasoning mode is currently in-use.

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

Sparql Query.

Returns
Type Description
object
| Edit this page View Source

Query(string, bool)

Makes a SPARQL Query against the underlying Store using whatever reasoning mode is currently in-use, the reasoning can be set by query.

Declaration
public virtual object Query(string sparqlQuery, bool reasoning)
Parameters
Type Name Description
string sparqlQuery

Sparql Query.

bool reasoning
Returns
Type Description
object
| Edit this page View Source

Query(string, AsyncStorageCallback, object)

Queries the store asynchronously.

Declaration
public virtual void Query(string query, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
string query

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 Store using whatever reasoning mode is currently in-use processing the results using an appropriate handler from those provided.

Declaration
public virtual 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, bool)

Makes a SPARQL Query against the underlying Store using whatever reasoning mode is currently in-use processing the results using an appropriate handler from those provided, the reasoning can be set by query.

Declaration
public virtual void Query(IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, string sparqlQuery, bool reasoning)
Parameters
Type Name Description
IRdfHandler rdfHandler

RDF Handler.

ISparqlResultsHandler resultsHandler

Results Handler.

string sparqlQuery

SPARQL Query.

bool reasoning
| Edit this page View Source

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

Queries the store asynchronously.

Declaration
public virtual void Query(IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, string query, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
IRdfHandler rdfHandler

RDF Handler.

ISparqlResultsHandler resultsHandler

Results Handler.

string query

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 virtual Task<object> QueryAsync(string query, CancellationToken cancellationToken)
Parameters
Type Name Description
string query
CancellationToken cancellationToken
Returns
Type Description
Task<object>
| Edit this page View Source

QueryAsync(IRdfHandler, ISparqlResultsHandler, string, CancellationToken)

Queries the store asynchronously.

Declaration
public virtual Task QueryAsync(IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, string query, 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 query
CancellationToken cancellationToken
Returns
Type Description
Task
| Edit this page View Source

Rollback()

Rolls back the active Transaction.

Declaration
public virtual void Rollback()
Remarks

Transactions are scoped to Managed Threads.

Exceptions
Type Condition
RdfStorageException

Thrown if there is not an active Transaction on the current Thread.

| Edit this page View Source

Rollback(AsyncStorageCallback, object)

Rolls back a transaction asynchronously.

Declaration
public virtual void Rollback(AsyncStorageCallback callback, object state)
Parameters
Type Name Description
AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

RollbackAsync(CancellationToken)

Roll back the current transaction on this connector asynchronously.

Declaration
public virtual Task RollbackAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task
Exceptions
Type Condition
RdfStorageException

If there is no open transaction on the connector or if the Stardog server responds with an error status code.

| Edit this page View Source

RollbackTransaction(string)

Rollback an open transaction.

Declaration
protected virtual void RollbackTransaction(string transactionId)
Parameters
Type Name Description
string transactionId

The ID of the transaction to rollback.

| Edit this page View Source

SaveGraph(IGraph)

Saves a Graph into the Store (see remarks for notes on merge/overwrite behaviour).

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

Graph to save.

Remarks

If the Graph has no URI then the contents will be appended to the Store's Default Graph. If the Graph has a URI then existing Graph associated with that URI will be replaced. To append to a named Graph use the UpdateGraph() method instead.

| 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(string, bool, IGraph, CancellationToken)

Save a graph asynchronously within the scope of an open transaction.

Declaration
protected virtual Task SaveGraphAsync(string transactionId, bool autoCommit, IGraph g, CancellationToken cancellationToken)
Parameters
Type Name Description
string transactionId

The ID of the transaction.

bool autoCommit

Whether to commit/rollback the transaction when the operation is completed.

IGraph g

The graph to save.

CancellationToken cancellationToken
Returns
Type Description
Task
Exceptions
Type Condition
RdfStorageException

Raised if the Stardog server responds with an error status code.

| Edit this page View Source

SaveGraphAsync(string, bool, IGraph, AsyncStorageCallback, object)

Save a graph to the database asynchronously within the context of an open transaction.

Declaration
protected virtual void SaveGraphAsync(string tID, bool autoCommit, IGraph g, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
string tID

The ID of the transaction to use for the update.

bool autoCommit

True to commit the transaction on completion.

IGraph g

The graph to write.

AsyncStorageCallback callback

Callback invoked on completion.

object state

State parameter to pass to the callback.

| 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

SaveGraphAsync(IGraph, AsyncStorageCallback, object)

Saves a Graph to the Store asynchronously.

Declaration
protected virtual void SaveGraphAsync(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.

| Edit this page 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.

| 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

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

Updates a Graph in the Stardog store.

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

| 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 Stardog Store.

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

Removals happen before additions.

| 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 add to the Graph.

IEnumerable<Triple> removals

Triples to remove from the Graph.

Remarks

Note: Not all Stores are capable of supporting update at the individual Triple level and as such it is acceptable for such a Store to throw a NotSupportedException or an RdfStorageException if the Store cannot provide this functionality.

Behaviour of this method with regards to non-existent Graph is up to the implementor, it may create a new empty Graph and apply the updates to that or it may throw an error. Implementors should state in the XML comments for their implementation what behaviour is implemented.

Implementers MUST allow for either the additions or removals argument to be null.

Exceptions
Type Condition
NotSupportedException

May be thrown if the underlying Store is not capable of doing Updates at the Triple level.

RdfStorageException

May be thrown if the underlying Store is not capable of doing Updates at the Triple level or if some error occurs while attempting the Update.

| Edit this page View Source

UpdateGraphAsync(string, bool, string, IEnumerable<Triple>, IEnumerable<Triple>, CancellationToken)

Update a graph asynchronously within the context of a transaction.

Declaration
protected virtual Task UpdateGraphAsync(string transactionId, bool autoCommit, string graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals, CancellationToken cancellationToken)
Parameters
Type Name Description
string transactionId

The transaction to use.

bool autoCommit

Whether to automatically commit/rollback the transaction.

string graphUri

The name of the graph to be updated.

IEnumerable<Triple> additions

The triples to add to the graph.

IEnumerable<Triple> removals

The triples to remove from the graph.

CancellationToken cancellationToken
Returns
Type Description
Task
Exceptions
Type Condition
RdfStorageException
| Edit this page View Source

UpdateGraphAsync(string, bool, string, IEnumerable<Triple>, IEnumerable<Triple>, AsyncStorageCallback, object)

Apply an update to a graph as part of a transaction.

Declaration
protected virtual void UpdateGraphAsync(string tID, bool autoCommit, string graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
string tID

The ID of the open transaction to use.

bool autoCommit

True to commit the transaction at the end of the update, false otherwise.

string graphUri

The URI of the graph to be updated.

IEnumerable<Triple> additions

The triples to inser.

IEnumerable<Triple> removals

The triples to remove.

AsyncStorageCallback callback

A callback to be invoked on completion.

object state

Additional state to pass to the callback.

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

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

Apply an update to a graph.

Declaration
protected virtual void UpdateGraphAsync(string graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
string graphUri

The URI of the graph to be updated.

IEnumerable<Triple> additions

The triples to insert.

IEnumerable<Triple> removals

The triples to delete.

AsyncStorageCallback callback

Callback invoked on completion.

object state

Additional state passed to the callback.

Remarks

If a transaction is currently in progress, the update is applied as part of that transaction. Otherwise a new transaction is started and committed by this method.

Implements

IAsyncQueryableStorage
IAsyncStorageProvider
IAsyncTransactionalStorage
IConfigurationSerializable
IQueryableStorage
ITransactionalStorage
IReasoningQueryableStorage
IStorageProvider
IStorageCapabilities
IDisposable

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • BaseStardogConnector(string, string)
    • BaseStardogConnector(string, string, IWebProxy)
    • BaseStardogConnector(string, string, string, string)
    • BaseStardogConnector(string, string, string, string, IWebProxy)
    • BaseStardogConnector(string, string, StardogReasoningMode)
    • BaseStardogConnector(string, string, StardogReasoningMode, HttpClientHandler)
    • BaseStardogConnector(string, string, StardogReasoningMode, IWebProxy)
    • BaseStardogConnector(string, string, StardogReasoningMode, string, string)
    • BaseStardogConnector(string, string, StardogReasoningMode, string, string, IWebProxy)
  • Fields
    • AnonymousUser
    • Server
  • Properties
    • AsyncParentServer
    • BaseUri
    • DeleteSupported
    • IOBehaviour
    • IsReadOnly
    • IsReady
    • KbId
    • ListGraphsSupported
    • ParentServer
    • Reasoning
    • UpdateSupported
  • Methods
    • AddStardogHeaders(HttpRequestMessage)
    • AddStardogHeaders(HttpWebRequest)
    • Begin()
    • Begin(bool)
    • Begin(AsyncStorageCallback, object)
    • BeginAsync(CancellationToken)
    • BeginTransaction(bool)
    • Commit()
    • Commit(AsyncStorageCallback, object)
    • CommitAsync(CancellationToken)
    • CommitTransaction(string)
    • CreateRequest(string, string, HttpMethod, Dictionary<string, string>)
    • CreateRequest(string, string, string, Dictionary<string, string>)
    • DeleteGraph(string)
    • DeleteGraph(string, AsyncStorageCallback, object)
    • DeleteGraph(Uri)
    • DeleteGraphAsync(string, bool, string, AsyncStorageCallback, object)
    • DeleteGraphAsync(string, string, bool, CancellationToken)
    • DeleteGraphAsync(string, CancellationToken)
    • Dispose(bool)
    • GetReasoningParameter()
    • ListGraphNames()
    • ListGraphs()
    • LoadGraph(IGraph, string)
    • LoadGraph(IGraph, Uri)
    • LoadGraph(IRdfHandler, string)
    • LoadGraph(IRdfHandler, string, AsyncStorageCallback, object)
    • LoadGraph(IRdfHandler, Uri)
    • LoadGraphAsync(IRdfHandler, string, CancellationToken)
    • MakeAddTriplesRequestMessage(string, string, IEnumerable<Triple>)
    • MakeDeleteGraphRequestMessage(string, string)
    • MakeRemoveTriplesRequestMessage(string, string, IEnumerable<Triple>)
    • Query(string)
    • Query(string, bool)
    • Query(string, AsyncStorageCallback, object)
    • Query(IRdfHandler, ISparqlResultsHandler, string)
    • Query(IRdfHandler, ISparqlResultsHandler, string, bool)
    • Query(IRdfHandler, ISparqlResultsHandler, string, AsyncStorageCallback, object)
    • QueryAsync(string, CancellationToken)
    • QueryAsync(IRdfHandler, ISparqlResultsHandler, string, CancellationToken)
    • Rollback()
    • Rollback(AsyncStorageCallback, object)
    • RollbackAsync(CancellationToken)
    • RollbackTransaction(string)
    • SaveGraph(IGraph)
    • SaveGraph(IGraph, AsyncStorageCallback, object)
    • SaveGraphAsync(string, bool, IGraph, CancellationToken)
    • SaveGraphAsync(string, bool, IGraph, AsyncStorageCallback, object)
    • SaveGraphAsync(IGraph, CancellationToken)
    • SaveGraphAsync(IGraph, AsyncStorageCallback, object)
    • SerializeConfiguration(ConfigurationSerializationContext)
    • ToString()
    • 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, bool, string, IEnumerable<Triple>, IEnumerable<Triple>, CancellationToken)
    • UpdateGraphAsync(string, bool, string, IEnumerable<Triple>, IEnumerable<Triple>, AsyncStorageCallback, object)
    • UpdateGraphAsync(string, IEnumerable<Triple>, IEnumerable<Triple>, CancellationToken)
    • UpdateGraphAsync(string, IEnumerable<Triple>, IEnumerable<Triple>, AsyncStorageCallback, object)
  • Implements
  • Extension Methods
Back to top Generated by DocFX