Class InMemoryDataset
Represents an in-memory dataset (i.e. a InMemoryQueryableStore) for querying and updating using SPARQL.
Inherited Members
Namespace: VDS.RDF.Query.Datasets
Assembly: dotNetRdf.dll
Syntax
public class InMemoryDataset : BaseTransactionalDataset, IThreadSafeDataset, ISparqlDataset, ITripleIndex
Constructors
| Edit this page View SourceInMemoryDataset()
Creates a new in-memory dataset using the default in-memory TripleStore as the underlying storage.
Declaration
public InMemoryDataset()
InMemoryDataset(bool)
Creates a new in-memory dataset using the default in-memory TripleStore as the underlying storage.
Declaration
public InMemoryDataset(bool unionDefaultGraph)
Parameters
Type | Name | Description |
---|---|---|
bool | unionDefaultGraph | Whether the Default Graph when no Active/Default Graph is explicitly set should be the union of all Graphs in the Dataset. |
InMemoryDataset(IGraph)
Creates a new in-memory dataset containing initially just the given graph and treating the given graph as the default graph of the dataset.
Declaration
public InMemoryDataset(IGraph g)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph. |
InMemoryDataset(IInMemoryQueryableStore)
Creates a new In-Memory dataset.
Declaration
public InMemoryDataset(IInMemoryQueryableStore store)
Parameters
Type | Name | Description |
---|---|---|
IInMemoryQueryableStore | store | In-Memory queryable store. |
InMemoryDataset(IInMemoryQueryableStore, bool)
Creates a new In-Memory dataset.
Declaration
public InMemoryDataset(IInMemoryQueryableStore store, bool unionDefaultGraph)
Parameters
Type | Name | Description |
---|---|---|
IInMemoryQueryableStore | store | In-Memory queryable store. |
bool | unionDefaultGraph | Whether the Default Graph when no Active/Default Graph is explicitly set should be the union of all Graphs in the Dataset. |
InMemoryDataset(IInMemoryQueryableStore, IRefNode)
Creates a new In-Memory dataset.
Declaration
public InMemoryDataset(IInMemoryQueryableStore store, IRefNode defaultGraphName)
Parameters
Type | Name | Description |
---|---|---|
IInMemoryQueryableStore | store | In-Memory queryable store. |
IRefNode | defaultGraphName | Default Graph URI. |
Properties
| Edit this page View SourceGraphNames
Gets an enumeration of the names of all graphs in the dataset.
Declaration
public override IEnumerable<IRefNode> GraphNames { get; }
Property Value
Type | Description |
---|---|
IEnumerable<IRefNode> |
Overrides
| Edit this page View SourceGraphUris
Gets all the URIs of Graphs in the Dataset.
Declaration
[Obsolete("Replaced by GraphNames")]
public override IEnumerable<Uri> GraphUris { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Uri> |
Overrides
| Edit this page View SourceGraphs
Gets all the Graphs in the Dataset.
Declaration
public override IEnumerable<IGraph> Graphs { get; }
Property Value
Type | Description |
---|---|
IEnumerable<IGraph> |
Overrides
| Edit this page View SourceLock
Gets the Lock used to ensure MRSW concurrency on the dataset when available.
Declaration
public ReaderWriterLockSlim Lock { get; }
Property Value
Type | Description |
---|---|
ReaderWriterLockSlim |
Methods
| Edit this page View SourceAddGraphInternal(IGraph)
Adds a Graph to the Dataset merging it with any existing Graph with the same URI.
Declaration
protected override bool AddGraphInternal(IGraph g)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph. |
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceContainsQuotedTripleInternal(Triple)
Gets whether the specified triple is quoted in any graph in the dataset.
Declaration
protected override bool ContainsQuotedTripleInternal(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t |
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceContainsTripleInternal(Triple)
Gets whether the Dataset contains a specific Triple.
Declaration
protected override bool ContainsTripleInternal(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple. |
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceFlushInternal()
If there have been changes made to the Dataset and the underlying in-memory store is a ITransactionalStore ensures the underlying store is notified to flush those changes.
Declaration
protected override void FlushInternal()
Overrides
| Edit this page View SourceGetAllQuotedTriples()
Gets all the quoted triples in the underlying in-memory store.
Declaration
protected override IEnumerable<Triple> GetAllQuotedTriples()
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
Overrides
| Edit this page View SourceGetAllTriples()
Gets all the Triples in the underlying in-memory store.
Declaration
protected override IEnumerable<Triple> GetAllTriples()
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
Overrides
| Edit this page View SourceGetGraphInternal(IRefNode)
Gets the Graph with the given URI from the Dataset.
Declaration
protected override IGraph GetGraphInternal(IRefNode graphName)
Parameters
Type | Name | Description |
---|---|---|
IRefNode | graphName | Graph URI. |
Returns
Type | Description |
---|---|
IGraph |
Overrides
Remarks
For In-Memory datasets the Graph returned from this property is no different from the Graph returned by the GetModifiableGraphInternal() method.
GetModifiableGraphInternal(IRefNode)
Gets a Modifiable wrapper around a Graph in the Dataset.
Declaration
protected override ITransactionalGraph GetModifiableGraphInternal(IRefNode graphName)
Parameters
Type | Name | Description |
---|---|---|
IRefNode | graphName | Graph URI. |
Returns
Type | Description |
---|---|
ITransactionalGraph |
Overrides
| Edit this page View SourceGetQuotedWithObjectInternal(INode)
Gets all the quoted triples in the dataset with the given object.
Declaration
protected override IEnumerable<Triple> GetQuotedWithObjectInternal(INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | obj | Object. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
Overrides
| Edit this page View SourceGetQuotedWithPredicateInternal(INode)
Get all the quoted triples in the dataset with the given predicate.
Declaration
protected override IEnumerable<Triple> GetQuotedWithPredicateInternal(INode predicate)
Parameters
Type | Name | Description |
---|---|---|
INode | predicate |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
Overrides
| Edit this page View SourceGetQuotedWithPredicateObjectInternal(INode, INode)
Gets all the quoted triples in the dataset with the given predicate and object.
Declaration
protected override IEnumerable<Triple> GetQuotedWithPredicateObjectInternal(INode pred, INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | pred | Predicate. |
INode | obj | Object. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
Overrides
| Edit this page View SourceGetQuotedWithSubjectInternal(INode)
Get all the quoted triples in the dataset with the given subject.
Declaration
protected override IEnumerable<Triple> GetQuotedWithSubjectInternal(INode subj)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
Overrides
| Edit this page View SourceGetQuotedWithSubjectObjectInternal(INode, INode)
Gets all the quoted triples in the dataset with the given subject and object.
Declaration
protected override IEnumerable<Triple> GetQuotedWithSubjectObjectInternal(INode subj, INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
INode | obj | Object. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
Overrides
| Edit this page View SourceGetQuotedWithSubjectPredicateInternal(INode, INode)
Gets all the quoted triples in the dataset with the given subject and predicate.
Declaration
protected override IEnumerable<Triple> GetQuotedWithSubjectPredicateInternal(INode subj, INode predicate)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
INode | predicate | Predicate. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
Overrides
| Edit this page View SourceGetTriplesWithObjectInternal(INode)
Gets all the Triples in the Dataset with the given Object.
Declaration
protected override IEnumerable<Triple> GetTriplesWithObjectInternal(INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | obj | Object. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
Overrides
| Edit this page View SourceGetTriplesWithPredicateInternal(INode)
Gets all the Triples in the Dataset with the given Predicate.
Declaration
protected override IEnumerable<Triple> GetTriplesWithPredicateInternal(INode predicate)
Parameters
Type | Name | Description |
---|---|---|
INode | predicate | Predicate. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
Overrides
| Edit this page View SourceGetTriplesWithPredicateObjectInternal(INode, INode)
Gets all the Triples in the Dataset with the given Predicate and Object.
Declaration
protected override IEnumerable<Triple> GetTriplesWithPredicateObjectInternal(INode pred, INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | pred | Predicate. |
INode | obj | Object. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
Overrides
| Edit this page View SourceGetTriplesWithSubjectInternal(INode)
Gets all the Triples in the Dataset with the given Subject.
Declaration
protected override IEnumerable<Triple> GetTriplesWithSubjectInternal(INode subj)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
Overrides
| Edit this page View SourceGetTriplesWithSubjectObjectInternal(INode, INode)
Gets all the Triples in the Dataset with the given Subject and Object.
Declaration
protected override IEnumerable<Triple> GetTriplesWithSubjectObjectInternal(INode subj, INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
INode | obj | Object. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
Overrides
| Edit this page View SourceGetTriplesWithSubjectPredicateInternal(INode, INode)
Gets all the Triples in the Dataset with the given Subject and Predicate.
Declaration
protected override IEnumerable<Triple> GetTriplesWithSubjectPredicateInternal(INode subj, INode predicate)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
INode | predicate | Predicate. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
Overrides
| Edit this page View SourceHasGraphInternal(IRefNode)
Gets whether a Graph with the given URI is the Dataset.
Declaration
protected override bool HasGraphInternal(IRefNode graphName)
Parameters
Type | Name | Description |
---|---|---|
IRefNode | graphName | Graph name. |
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceRemoveGraphInternal(IRefNode)
Removes a Graph from the Dataset.
Declaration
protected override bool RemoveGraphInternal(IRefNode graphName)
Parameters
Type | Name | Description |
---|---|---|
IRefNode | graphName | Graph name. |
Returns
Type | Description |
---|---|
bool |