Show / Hide Table of Contents

Class InMemoryManager

Provides a wrapper around an in-memory store.

Inheritance
System.Object
BaseAsyncSafeConnector
InMemoryManager
Implements
IUpdateableStorage
IQueryableStorage
IStorageProvider
IAsyncUpdateableStorage
IAsyncQueryableStorage
IAsyncStorageProvider
IStorageCapabilities
System.IDisposable
IConfigurationSerializable
Inherited Members
BaseAsyncSafeConnector.ParentServer
BaseAsyncSafeConnector.AsyncParentServer
BaseAsyncSafeConnector.UriFactory
BaseAsyncSafeConnector.LoadGraph(IGraph, Uri, AsyncStorageCallback, object)
BaseAsyncSafeConnector.LoadGraph(IGraph, string, AsyncStorageCallback, object)
BaseAsyncSafeConnector.LoadGraph(IRdfHandler, Uri, AsyncStorageCallback, object)
BaseAsyncSafeConnector.LoadGraph(IRdfHandler, string, AsyncStorageCallback, object)
BaseAsyncSafeConnector.LoadGraphAsync(IGraph, string, CancellationToken)
BaseAsyncSafeConnector.LoadGraphAsync(IRdfHandler, string, CancellationToken)
BaseAsyncSafeConnector.SaveGraph(IGraph, AsyncStorageCallback, object)
BaseAsyncSafeConnector.SaveGraphAsync(IGraph, CancellationToken)
BaseAsyncSafeConnector.UpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>, AsyncStorageCallback, object)
BaseAsyncSafeConnector.UpdateGraph(string, IEnumerable<Triple>, IEnumerable<Triple>, AsyncStorageCallback, object)
BaseAsyncSafeConnector.UpdateGraphAsync(string, IEnumerable<Triple>, IEnumerable<Triple>, CancellationToken)
BaseAsyncSafeConnector.DeleteGraph(Uri, AsyncStorageCallback, object)
BaseAsyncSafeConnector.DeleteGraph(string, AsyncStorageCallback, object)
BaseAsyncSafeConnector.DeleteGraphAsync(string, CancellationToken)
BaseAsyncSafeConnector.ListGraphs(AsyncStorageCallback, object)
BaseAsyncSafeConnector.ListGraphsAsync(CancellationToken)
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 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

| Improve this Doc View Source

InMemoryManager()

Creates a new In-Memory Manager which is a wrapper around a new empty in-memory store.

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

| Improve this Doc View Source

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.

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.

| Improve this Doc View Source

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.

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.

Properties

| Improve this Doc View Source

DeleteSupported

Returns that Graph Deletion is supported.

Declaration
public override bool DeleteSupported { get; }
Property Value
Type Description
System.Boolean
Overrides
BaseAsyncSafeConnector.DeleteSupported
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.

| Improve this Doc View Source

IOBehaviour

Gets the IO Behaviour for In-Memory stores.

Declaration
public override IOBehaviour IOBehaviour { get; }
Property Value
Type Description
IOBehaviour
Overrides
BaseAsyncSafeConnector.IOBehaviour
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.

| Improve this Doc View Source

IsReadOnly

Returns that the Store is not read-only.

Declaration
public override bool IsReadOnly { get; }
Property Value
Type Description
System.Boolean
Overrides
BaseAsyncSafeConnector.IsReadOnly
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.

| Improve this Doc View Source

IsReady

Returns that the Store is ready.

Declaration
public override bool IsReady { get; }
Property Value
Type Description
System.Boolean
Overrides
BaseAsyncSafeConnector.IsReady
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.

| Improve this Doc View Source

ListGraphsSupported

Returns that listing graphs is supported.

Declaration
public override bool ListGraphsSupported { get; }
Property Value
Type Description
System.Boolean
Overrides
BaseAsyncSafeConnector.ListGraphsSupported
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.

| Improve this Doc View Source

UpdateSupported

Returns that Triple level updates are supported.

Declaration
public override bool UpdateSupported { get; }
Property Value
Type Description
System.Boolean
Overrides
BaseAsyncSafeConnector.UpdateSupported
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.

Methods

| Improve this Doc View Source

DeleteGraph(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
BaseAsyncSafeConnector.DeleteGraph(string)
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.

| Improve this Doc View Source

DeleteGraph(Uri)

Deletes a Graph from the Store.

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

URI of the Graph to delete.

Overrides
BaseAsyncSafeConnector.DeleteGraph(Uri)
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.

| Improve this Doc View Source

Dispose()

Disposes of the Manager.

Declaration
public override void Dispose()
Overrides
BaseAsyncSafeConnector.Dispose()
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.

| Improve this Doc View Source

ListGraphNames()

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

Declaration
public override IEnumerable<string> ListGraphNames()
Returns
Type Description
System.Collections.Generic.IEnumerable<T><string>
Overrides
BaseAsyncSafeConnector.ListGraphNames()
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.

| Improve this Doc View Source

ListGraphs()

Lists the URIs of Graphs in the Store.

Declaration
[Obsolete("Replaced by ListGraphNames")]
public override IEnumerable<Uri> ListGraphs()
Returns
Type Description
System.Collections.Generic.IEnumerable<T><System.Uri>
Overrides
BaseAsyncSafeConnector.ListGraphs()
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.

| Improve this Doc View Source

LoadGraph(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
BaseAsyncSafeConnector.LoadGraph(IGraph, string)
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.

| Improve this Doc View Source

LoadGraph(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.

System.Uri graphUri

Graph URI to load.

Overrides
BaseAsyncSafeConnector.LoadGraph(IGraph, Uri)
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.

| Improve this Doc View Source

LoadGraph(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
BaseAsyncSafeConnector.LoadGraph(IRdfHandler, string)
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.

| Improve this Doc View Source

LoadGraph(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.

System.Uri graphUri

Graph URI to load.

Overrides
BaseAsyncSafeConnector.LoadGraph(IRdfHandler, Uri)
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.

| Improve this Doc 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.

System.Object state

State to pass to the callback.

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.

| Improve this Doc View Source

Query(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
System.Object
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.

| Improve this Doc 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.

System.Object state

State to pass to the callback.

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.

| Improve this Doc View Source

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.

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.

| Improve this Doc 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.

System.Threading.CancellationToken cancellationToken
Returns
Type Description
System.Threading.Tasks.Task<TResult><System.Object>
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.

| Improve this Doc 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.

System.Threading.CancellationToken cancellationToken
Returns
Type Description
System.Threading.Tasks.Task
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.

| Improve this Doc View Source

SaveGraph(IGraph)

Saves a Graph to the Store.

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

Graph.

Overrides
BaseAsyncSafeConnector.SaveGraph(IGraph)
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.

| Improve this Doc View Source

SerializeConfiguration(ConfigurationSerializationContext)

Serializes the Configuration of the Manager.

Declaration
public void SerializeConfiguration(ConfigurationSerializationContext context)
Parameters
Type Name Description
ConfigurationSerializationContext context

Configuration Serialization Context.

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.

| Improve this Doc View Source

ToString()

Gets a String representation of the Manager.

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()
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.

| Improve this Doc 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.

System.Object state

State to pass to the callback.

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.

| Improve this Doc View Source

Update(string)

Applies SPARQL Updates to the Store.

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

SPARQL Update.

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.

| Improve this Doc View Source

UpdateAsync(string, CancellationToken)

Updates the store asynchronously.

Declaration
public Task UpdateAsync(string sparqlUpdates, CancellationToken cancellationToken)
Parameters
Type Name Description
string sparqlUpdates
System.Threading.CancellationToken cancellationToken
Returns
Type Description
System.Threading.Tasks.Task
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.

| Improve this Doc View Source

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.

System.Collections.Generic.IEnumerable<T><Triple> additions

Triples to be added.

System.Collections.Generic.IEnumerable<T><Triple> removals

Triples to be removed.

Overrides
BaseAsyncSafeConnector.UpdateGraph(string, IEnumerable<Triple>, IEnumerable<Triple>)
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.

| Improve this Doc View Source

UpdateGraph(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
System.Uri graphUri

URI of the Graph to Update.

System.Collections.Generic.IEnumerable<T><Triple> additions

Triples to be added.

System.Collections.Generic.IEnumerable<T><Triple> removals

Triples to be removed.

Overrides
BaseAsyncSafeConnector.UpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>)
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.

| Improve this Doc View Source

UpdateGraph(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.

System.Collections.Generic.IEnumerable<T><Triple> additions

Triples to be added.

System.Collections.Generic.IEnumerable<T><Triple> removals

Triples to be removed.

Overrides
BaseAsyncSafeConnector.UpdateGraph(IRefNode, IEnumerable<Triple>, IEnumerable<Triple>)
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.

Implements

IUpdateableStorage
IQueryableStorage
IStorageProvider
IAsyncUpdateableStorage
IAsyncQueryableStorage
IAsyncStorageProvider
IStorageCapabilities
System.IDisposable
IConfigurationSerializable

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • InMemoryManager()
    • InMemoryManager(IInMemoryQueryableStore)
    • InMemoryManager(ISparqlDataset)
  • Properties
    • DeleteSupported
    • IOBehaviour
    • IsReadOnly
    • IsReady
    • ListGraphsSupported
    • UpdateSupported
  • Methods
    • DeleteGraph(string)
    • DeleteGraph(Uri)
    • Dispose()
    • ListGraphNames()
    • ListGraphs()
    • LoadGraph(IGraph, string)
    • LoadGraph(IGraph, Uri)
    • LoadGraph(IRdfHandler, string)
    • LoadGraph(IRdfHandler, Uri)
    • Query(string, AsyncStorageCallback, object)
    • Query(string)
    • Query(IRdfHandler, ISparqlResultsHandler, string, AsyncStorageCallback, object)
    • Query(IRdfHandler, ISparqlResultsHandler, string)
    • QueryAsync(string, CancellationToken)
    • QueryAsync(IRdfHandler, ISparqlResultsHandler, string, CancellationToken)
    • SaveGraph(IGraph)
    • SerializeConfiguration(ConfigurationSerializationContext)
    • ToString()
    • Update(string, AsyncStorageCallback, object)
    • Update(string)
    • UpdateAsync(string, CancellationToken)
    • UpdateGraph(string, IEnumerable<Triple>, IEnumerable<Triple>)
    • UpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>)
    • UpdateGraph(IRefNode, IEnumerable<Triple>, IEnumerable<Triple>)
  • Implements
  • Extension Methods
Back to top Generated by DocFX