Show / Hide Table of Contents

Class BaseTransactionalDataset

Abstract Base Class for Mutable Datasets that support Transactions.
Inheritance
System.Object
BaseDataset
BaseTransactionalDataset
InMemoryDataset
Implements
ISparqlDataset
Inherited Members
BaseDataset.InternalDefaultGraph
BaseDataset.SetDefaultGraph(Uri)
BaseDataset.SetDefaultGraph(IEnumerable<Uri>)
BaseDataset.SetActiveGraph(Uri)
BaseDataset.SetActiveGraph(IEnumerable<Uri>)
BaseDataset.ResetActiveGraph()
BaseDataset.ResetDefaultGraph()
BaseDataset.DefaultGraphUris
BaseDataset.ActiveGraphUris
BaseDataset.UsesUnionDefaultGraph
BaseDataset.RemoveGraphInternal(Uri)
BaseDataset.HasGraph(Uri)
BaseDataset.HasGraphInternal(Uri)
BaseDataset.Graphs
BaseDataset.GraphUris
BaseDataset.GetGraphInternal(Uri)
BaseDataset.HasTriples
BaseDataset.ContainsTriple(Triple)
BaseDataset.ContainsTripleInternal(Triple)
BaseDataset.Triples
BaseDataset.GetAllTriples()
BaseDataset.GetTriplesWithSubject(INode)
BaseDataset.GetTriplesWithSubjectInternal(INode)
BaseDataset.GetTriplesWithPredicate(INode)
BaseDataset.GetTriplesWithPredicateInternal(INode)
BaseDataset.GetTriplesWithObject(INode)
BaseDataset.GetTriplesWithObjectInternal(INode)
BaseDataset.GetTriplesWithSubjectPredicate(INode, INode)
BaseDataset.GetTriplesWithSubjectPredicateInternal(INode, INode)
BaseDataset.GetTriplesWithSubjectObject(INode, INode)
BaseDataset.GetTriplesWithSubjectObjectInternal(INode, INode)
BaseDataset.GetTriplesWithPredicateObject(INode, INode)
BaseDataset.GetTriplesWithPredicateObjectInternal(INode, INode)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: VDS.RDF.Query.Datasets
Assembly: dotNetRDF.dll
Syntax
public abstract class BaseTransactionalDataset : BaseDataset, ISparqlDataset
Remarks

The Transaction implementation of dotNetRDF is based upon a MRSW concurrency model, since only one writer may be active changes are immediately pushed to the dataset and visible within the transaction and they are committed or rolled back when Flush() or Discard() are called.

So in practical terms it is perfectly OK for the storage to be updated during a transaction because if the transaction fails the changes will be rolled back because all changes are stored in-memory until the end of the transaction. This may not be an ideal transaction model for all scenarios so you may wish to implement your own version of transactions or code your implementations of the abstract methods accordingly to limit actual persistence to the end of a transaction.

Constructors

| Improve this Doc View Source

BaseTransactionalDataset()

Creates a new Transactional Dataset.
Declaration
public BaseTransactionalDataset()
| Improve this Doc View Source

BaseTransactionalDataset(Boolean)

Creates a new Transactional Dataset with the given Union Default Graph setting.
Declaration
public BaseTransactionalDataset(bool unionDefaultGraph)
Parameters
Type Name Description
System.Boolean unionDefaultGraph Whether to use a Union Default Graph.
| Improve this Doc View Source

BaseTransactionalDataset(Uri)

Creates a new Transactional Dataset with a fixed Default Graph and no Union Default Graph.
Declaration
public BaseTransactionalDataset(Uri defaultGraphUri)
Parameters
Type Name Description
System.Uri defaultGraphUri Default Graph URI.

Properties

| Improve this Doc View Source

Item[Uri]

Gets a Graph from the Dataset.
Declaration
public sealed override IGraph this[Uri graphUri] { get; }
Parameters
Type Name Description
System.Uri graphUri Graph URI.
Property Value
Type Description
IGraph
Overrides
BaseDataset.Item[Uri]
Remarks
If the Graph has been modified during the active Transaction the modified version is returned rather than the original version.

Methods

| Improve this Doc View Source

AddGraph(IGraph)

Adds a Graph to the Dataset.
Declaration
public sealed override bool AddGraph(IGraph g)
Parameters
Type Name Description
IGraph g Graph to add.
Returns
Type Description
System.Boolean
Overrides
BaseDataset.AddGraph(IGraph)
| Improve this Doc View Source

AddGraphInternal(IGraph)

Adds a Graph to the Dataset.
Declaration
protected abstract bool AddGraphInternal(IGraph g)
Parameters
Type Name Description
IGraph g Graph to add.
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Discard()

Ensures that any changes to the Dataset (if any) are discarded.
Declaration
public sealed override void Discard()
Overrides
BaseDataset.Discard()
Remarks
Rollsback the Active Transaction.
| Improve this Doc View Source

DiscardInternal()

Allows the derived dataset to take any post-Discard() actions required.
Declaration
protected virtual void DiscardInternal()
| Improve this Doc View Source

Flush()

Ensures that any changes to the Dataset (if any) are flushed to the underlying Storage.
Declaration
public sealed override void Flush()
Overrides
BaseDataset.Flush()
Remarks
Commits the Active Transaction.
| Improve this Doc View Source

FlushInternal()

Allows the derived dataset to take any post-Flush() actions required.
Declaration
protected virtual void FlushInternal()
| Improve this Doc View Source

GetModifiableGraph(Uri)

Gets a Graph from the Dataset that can be modified.
Declaration
public sealed override IGraph GetModifiableGraph(Uri graphUri)
Parameters
Type Name Description
System.Uri graphUri Graph URI.
Returns
Type Description
IGraph
Overrides
BaseDataset.GetModifiableGraph(Uri)
| Improve this Doc View Source

GetModifiableGraphInternal(Uri)

Gets a Graph from the Dataset that can be modified transactionally.
Declaration
protected abstract ITransactionalGraph GetModifiableGraphInternal(Uri graphUri)
Parameters
Type Name Description
System.Uri graphUri Graph URI.
Returns
Type Description
ITransactionalGraph
| Improve this Doc View Source

RemoveGraph(Uri)

Removes a Graph from the Dataset.
Declaration
public sealed override bool RemoveGraph(Uri graphUri)
Parameters
Type Name Description
System.Uri graphUri Graph URI.
Returns
Type Description
System.Boolean
Overrides
BaseDataset.RemoveGraph(Uri)

Implements

ISparqlDataset

Extension Methods

Extensions.AsEnumerable<T>(T)
  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • BaseTransactionalDataset()
    • BaseTransactionalDataset(Boolean)
    • BaseTransactionalDataset(Uri)
  • Properties
    • Item[Uri]
  • Methods
    • AddGraph(IGraph)
    • AddGraphInternal(IGraph)
    • Discard()
    • DiscardInternal()
    • Flush()
    • FlushInternal()
    • GetModifiableGraph(Uri)
    • GetModifiableGraphInternal(Uri)
    • RemoveGraph(Uri)
  • Implements
  • Extension Methods
Back to top Generated by DocFX