Show / Hide Table of Contents

Interface IStorageProvider

Interface for storage providers which provide the read/write functionality to some arbitrary storage layer.

Inherited Members
IStorageCapabilities.IsReady
IStorageCapabilities.IsReadOnly
IStorageCapabilities.IOBehaviour
IStorageCapabilities.UpdateSupported
IStorageCapabilities.DeleteSupported
IStorageCapabilities.ListGraphsSupported
IDisposable.Dispose()
Namespace: VDS.RDF.Storage
Assembly: dotNetRdf.dll
Syntax
public interface IStorageProvider : IStorageCapabilities, IDisposable
Remarks

Designed to allow for arbitrary Triple Stores to be plugged into the library as required by the end user.

Properties

| Edit this page View Source

ParentServer

Gets the Parent Server on which this store is hosted (if any).

Declaration
IStorageServer ParentServer { get; }
Property Value
Type Description
IStorageServer
Remarks

For storage back-ends which support multiple stores this is useful because it provides a way to access all the stores on that backend. For stores which are standalone they should simply return null.

Methods

| Edit this page View Source

DeleteGraph(string)

Deletes a Graph from the Store.

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

URI of the Graph to be deleted.

Remarks

Note: Not all Stores are capable of Deleting a Graph so it is acceptable for such a Store to throw a NotSupportedException or an RdfStorageException if the Store cannot provide this functionality.

Exceptions
Type Condition
NotSupportedException

May be thrown if the underlying Store is not capable of doing Deleting a Graph.

RdfStorageException

May be thrown if the underlying Store is not capable of Deleting a Graph or an error occurs while performing the delete.

| Edit this page View Source

DeleteGraph(Uri)

Deletes a Graph from the Store.

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

URI of the Graph to be deleted.

Remarks

Note: Not all Stores are capable of Deleting a Graph so it is acceptable for such a Store to throw a NotSupportedException or an RdfStorageException if the Store cannot provide this functionality.

Exceptions
Type Condition
NotSupportedException

May be thrown if the underlying Store is not capable of doing Deleting a Graph.

RdfStorageException

May be thrown if the underlying Store is not capable of Deleting a Graph or an error occurs while performing the delete.

| Edit this page View Source

ListGraphNames()

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

Declaration
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 a List of Graph URIs for the graphs in the store.

Declaration
[Obsolete("Replaced by ListGraphNames")]
IEnumerable<Uri> ListGraphs()
Returns
Type Description
IEnumerable<Uri>
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

LoadGraph(IGraph, string)

Loads a Graph from the Store.

Declaration
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 the Graph being loaded into is Empty then it's Base Uri should become the Uri of the Graph being loaded, otherwise it should be merged into the existing non-empty Graph whose Base Uri should be unaffected.

Behaviour of this method with regards to non-existent Graphs is up to the implementor, an empty Graph may be returned or an error thrown. Implementors should state in the XML comments for their implementation what behaviour is implemented.

| Edit this page View Source

LoadGraph(IGraph, Uri)

Loads a Graph from the Store.

Declaration
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 the Graph being loaded into is Empty then it's Base Uri should become the Uri of the Graph being loaded, otherwise it should be merged into the existing non-empty Graph whose Base Uri should be unaffected.

Behaviour of this method with regards to non-existent Graphs is up to the implementor, an empty Graph may be returned or an error thrown. Implementors should state in the XML comments for their implementation what behaviour is implemented.

| Edit this page View Source

LoadGraph(IRdfHandler, string)

Loads a Graph from the Store using the RDF Handler.

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

RDF Handler.

string graphUri

URI of the Graph to load.

Remarks

Behaviour of this method with regards to non-existent Graphs is up to the implementor, an empty Graph may be returned or an error thrown. Implementors should state in the XML comments for their implementation what behaviour is implemented.

| Edit this page View Source

LoadGraph(IRdfHandler, Uri)

Loads a Graph from the Store using the RDF Handler.

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

RDF Handler.

Uri graphUri

URI of the Graph to load.

Remarks

Behaviour of this method with regards to non-existent Graphs is up to the implementor, an empty Graph may be returned or an error thrown. Implementors should state in the XML comments for their implementation what behaviour is implemented.

| Edit this page View Source

SaveGraph(IGraph)

Saves a Graph to the Store.

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

Graph to Save.

Remarks

Graph name should be taken from the Name property

Behaviour of this method with regards to whether it overwrites/updates/merges with existing Graphs of the same name is up to the implementor and may be dependent on the underlying store. Implementors should state in the XML comments for their implementations what behaviour is implemented.

| Edit this page View Source

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

Updates a Graph in the Store.

Declaration
[Obsolete("Replaced by UpdateGraph(IRefNode, IEnumerable<Triple>, IEnumerable<Triple>)")]
void UpdateGraph(string graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals)
Parameters
Type Name Description
string graphUri

Uri of the Graph to update.

IEnumerable<Triple> additions

Triples to add 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

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

Updates a Graph in the Store.

Declaration
[Obsolete("Replaced by UpdateGraph(IRefNode, IEnumerable<Triple>, IEnumerable<Triple>)")]
void UpdateGraph(Uri graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals)
Parameters
Type Name Description
Uri graphUri

Uri of the Graph to update.

IEnumerable<Triple> additions

Triples to add 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 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

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

Updates a Graph in the Store.

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

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Properties
    • ParentServer
  • Methods
    • DeleteGraph(string)
    • DeleteGraph(Uri)
    • ListGraphNames()
    • ListGraphs()
    • LoadGraph(IGraph, string)
    • LoadGraph(IGraph, Uri)
    • LoadGraph(IRdfHandler, string)
    • LoadGraph(IRdfHandler, Uri)
    • SaveGraph(IGraph)
    • UpdateGraph(string, IEnumerable<Triple>, IEnumerable<Triple>)
    • UpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>)
    • UpdateGraph(IRefNode, IEnumerable<Triple>, IEnumerable<Triple>)
  • Extension Methods
Back to top Generated by DocFX