Interface IStorageProvider
Interface for storage providers which provide the read/write functionality to some arbitrary storage layer.
Inherited Members
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
| Improve this Doc View SourceParentServer
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
| Improve this Doc View SourceDeleteGraph(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 |
---|---|
System.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. |
DeleteGraph(Uri)
Deletes a Graph from the Store.
Declaration
void DeleteGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System.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 |
---|---|
System.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. |
ListGraphNames()
Gets an enumeration of the names of the graphs in the store.
Declaration
IEnumerable<string> ListGraphNames()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><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.
ListGraphs()
Gets a List of Graph URIs for the graphs in the store.
Declaration
[Obsolete("Replaced by ListGraphNames")]
IEnumerable<Uri> ListGraphs()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><System.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.
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.
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. |
System.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.
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.
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. |
System.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.
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.
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. |
System.Collections.Generic.IEnumerable<T><Triple> | additions | Triples to add to the Graph. |
System.Collections.Generic.IEnumerable<T><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 |
---|---|
System.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. |
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 |
---|---|---|
System.Uri | graphUri | Uri of the Graph to update. |
System.Collections.Generic.IEnumerable<T><Triple> | additions | Triples to add to the Graph. |
System.Collections.Generic.IEnumerable<T><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 |
---|---|
System.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. |
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. |
System.Collections.Generic.IEnumerable<T><Triple> | additions | Triples to add to the Graph. |
System.Collections.Generic.IEnumerable<T><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 |
---|---|
System.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. |