Class InMemoryManager
Provides a wrapper around an in-memory store.
Implements
Inherited Members
Namespace: VDS.RDF.Storage
Assembly: dotNetRdf.dll
Syntax
public class InMemoryManager : BaseAsyncSafeConnector, IUpdateableStorage, IQueryableStorage, IStorageProvider, IAsyncUpdateableStorage, IAsyncQueryableStorage, IAsyncStorageProvider, IStorageCapabilities, IDisposable, IConfigurationSerializable
Remarks
Useful if you want to test out some code using temporary in-memory data before you run the code against a real store or if you are using some code that requires an IStorageProvider interface but you need the results of that code to be available directly in-memory.
Constructors
| Edit this page View SourceInMemoryManager()
Creates a new In-Memory Manager which is a wrapper around a new empty in-memory store.
Declaration
public InMemoryManager()
InMemoryManager(IInMemoryQueryableStore)
Creates a new In-Memory Manager which is a wrapper around an in-memory store.
Declaration
public InMemoryManager(IInMemoryQueryableStore store)
Parameters
Type | Name | Description |
---|---|---|
IInMemoryQueryableStore | store | Triple Store. |
InMemoryManager(ISparqlDataset)
Creates a new In-Memory Manager which is a wrapper around a SPARQL Dataset.
Declaration
public InMemoryManager(ISparqlDataset dataset)
Parameters
Type | Name | Description |
---|---|---|
ISparqlDataset | dataset | Dataset. |
Properties
| Edit this page View SourceDeleteSupported
Returns that Graph Deletion is supported.
Declaration
public override bool DeleteSupported { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceIOBehaviour
Gets the IO Behaviour for In-Memory stores.
Declaration
public override IOBehaviour IOBehaviour { get; }
Property Value
Type | Description |
---|---|
IOBehaviour |
Overrides
| Edit this page View SourceIsReadOnly
Returns that the Store is not read-only.
Declaration
public override bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceIsReady
Returns that the Store is ready.
Declaration
public override bool IsReady { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceListGraphsSupported
Returns that listing graphs is supported.
Declaration
public override bool ListGraphsSupported { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceUpdateSupported
Returns that Triple level updates are supported.
Declaration
public override bool UpdateSupported { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
Methods
| Edit this page View SourceDeleteGraph(string)
Deletes a Graph from the Store.
Declaration
public override void DeleteGraph(string graphUri)
Parameters
Type | Name | Description |
---|---|---|
string | graphUri | URI of the Graph to delete. |
Overrides
| Edit this page View SourceDeleteGraph(Uri)
Deletes a Graph from the Store.
Declaration
public override void DeleteGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
Uri | graphUri | URI of the Graph to delete. |
Overrides
| Edit this page View SourceDispose()
Disposes of the Manager.
Declaration
public override void Dispose()
Overrides
| Edit this page View SourceListGraphNames()
Gets an enumeration of the names of the graphs in the store.
Declaration
public override IEnumerable<string> ListGraphNames()
Returns
Type | Description |
---|---|
IEnumerable<string> |
Overrides
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()
Lists the URIs of Graphs in the Store.
Declaration
[Obsolete("Replaced by ListGraphNames")]
public override IEnumerable<Uri> ListGraphs()
Returns
Type | Description |
---|---|
IEnumerable<Uri> |
Overrides
| Edit this page View SourceLoadGraph(IGraph, string)
Loads a Graph from the Store.
Declaration
public override void LoadGraph(IGraph g, string graphUri)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to load into. |
string | graphUri | Graph URI to load. |
Overrides
| Edit this page View SourceLoadGraph(IGraph, Uri)
Loads a Graph from the Store.
Declaration
public override void LoadGraph(IGraph g, Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to load into. |
Uri | graphUri | Graph URI to load. |
Overrides
| Edit this page View SourceLoadGraph(IRdfHandler, string)
Loads a Graph from the Store.
Declaration
public override void LoadGraph(IRdfHandler handler, string graphUri)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler. |
string | graphUri | Graph URI to load. |
Overrides
| Edit this page View SourceLoadGraph(IRdfHandler, Uri)
Loads a Graph from the Store.
Declaration
public override void LoadGraph(IRdfHandler handler, Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler. |
Uri | graphUri | Graph URI to load. |
Overrides
| Edit this page View SourceQuery(string)
Makes a SPARQL Query against the Store.
Declaration
public object Query(string sparqlQuery)
Parameters
Type | Name | Description |
---|---|---|
string | sparqlQuery | SPARQL Query. |
Returns
Type | Description |
---|---|
object |
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. |
Query(IRdfHandler, ISparqlResultsHandler, string)
Makes a SPARQL Query against the Store processing the results with the appropriate processor from those given.
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. |
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. |
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> |
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 |
SaveGraph(IGraph)
Saves a Graph to the Store.
Declaration
public override void SaveGraph(IGraph g)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph. |
Overrides
| Edit this page View SourceSerializeConfiguration(ConfigurationSerializationContext)
Serializes the Configuration of the Manager.
Declaration
public void SerializeConfiguration(ConfigurationSerializationContext context)
Parameters
Type | Name | Description |
---|---|---|
ConfigurationSerializationContext | context | Configuration Serialization Context. |
ToString()
Gets a String representation of the Manager.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
| Edit this page View SourceUpdate(string)
Applies SPARQL Updates to the Store.
Declaration
public void Update(string sparqlUpdate)
Parameters
Type | Name | Description |
---|---|---|
string | sparqlUpdate | SPARQL Update. |
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. |
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 |
UpdateGraph(string, IEnumerable<Triple>, IEnumerable<Triple>)
Updates a Graph in the Store.
Declaration
public override 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. |
Overrides
| Edit this page View SourceUpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>)
Updates a Graph in the Store.
Declaration
public override 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. |
Overrides
| Edit this page View SourceUpdateGraph(IRefNode, IEnumerable<Triple>, IEnumerable<Triple>)
Updates a Graph in the Store.
Declaration
public override 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. |