Show / Hide Table of Contents

Class BaseTransactionalDataset

Abstract Base Class for Mutable Datasets that support Transactions.

Inheritance
object
BaseDataset
BaseTransactionalDataset
InMemoryDataset
Implements
ISparqlDataset
ITripleIndex
Inherited Members
BaseDataset.InternalDefaultGraph
BaseDataset.SetDefaultGraph(Uri)
BaseDataset.SetDefaultGraph(IRefNode)
BaseDataset.SetDefaultGraph(IEnumerable<Uri>)
BaseDataset.SetDefaultGraph(IList<IRefNode>)
BaseDataset.SetActiveGraph(Uri)
BaseDataset.SetActiveGraph(IRefNode)
BaseDataset.SetActiveGraph(IEnumerable<Uri>)
BaseDataset.SetActiveGraph(IList<IRefNode>)
BaseDataset.ResetActiveGraph()
BaseDataset.ResetDefaultGraph()
BaseDataset.DefaultGraphUris
BaseDataset.DefaultGraphNames
BaseDataset.ActiveGraphUris
BaseDataset.ActiveGraphNames
BaseDataset.UsesUnionDefaultGraph
BaseDataset.RemoveGraphInternal(IRefNode)
BaseDataset.HasGraph(Uri)
BaseDataset.HasGraph(IRefNode)
BaseDataset.HasGraphInternal(IRefNode)
BaseDataset.Graphs
BaseDataset.GraphUris
BaseDataset.GraphNames
BaseDataset.GetGraphInternal(IRefNode)
BaseDataset.GetModifiableGraph(Uri)
BaseDataset.HasTriples
BaseDataset.ContainsTriple(Triple)
BaseDataset.ContainsTripleInternal(Triple)
BaseDataset.ContainsQuotedTriple(Triple)
BaseDataset.ContainsQuotedTripleInternal(Triple)
BaseDataset.Triples
BaseDataset.QuotedTriples
BaseDataset.GetAllTriples()
BaseDataset.GetAllQuotedTriples()
BaseDataset.GetTriplesWithPredicate(Uri)
BaseDataset.GetTriplesWithSubject(INode)
BaseDataset.GetTriplesWithSubject(Uri)
BaseDataset.GetQuotedWithSubject(Uri)
BaseDataset.GetQuotedWithSubject(INode)
BaseDataset.GetTriplesWithSubjectInternal(INode)
BaseDataset.GetQuotedWithSubjectInternal(INode)
BaseDataset.GetTriplesWithPredicate(INode)
BaseDataset.GetQuotedWithPredicate(Uri)
BaseDataset.GetQuotedWithPredicate(INode)
BaseDataset.GetTriplesWithPredicateInternal(INode)
BaseDataset.GetQuotedWithPredicateInternal(INode)
BaseDataset.GetTriples(Uri)
BaseDataset.GetTriples(INode)
BaseDataset.GetQuoted(Uri)
BaseDataset.GetQuoted(INode)
BaseDataset.GetTriplesWithObject(Uri)
BaseDataset.GetTriplesWithObject(INode)
BaseDataset.GetQuotedWithObject(Uri)
BaseDataset.GetQuotedWithObject(INode)
BaseDataset.GetTriplesWithObjectInternal(INode)
BaseDataset.GetQuotedWithObjectInternal(INode)
BaseDataset.GetTriplesWithSubjectPredicate(INode, INode)
BaseDataset.GetQuotedWithSubjectPredicate(INode, INode)
BaseDataset.GetTriplesWithSubjectPredicateInternal(INode, INode)
BaseDataset.GetQuotedWithSubjectPredicateInternal(INode, INode)
BaseDataset.GetTriplesWithSubjectObject(INode, INode)
BaseDataset.GetQuotedWithSubjectObject(INode, INode)
BaseDataset.GetTriplesWithSubjectObjectInternal(INode, INode)
BaseDataset.GetQuotedWithSubjectObjectInternal(INode, INode)
BaseDataset.GetTriplesWithPredicateObject(INode, INode)
BaseDataset.GetQuotedWithPredicateObject(INode, INode)
BaseDataset.GetTriplesWithPredicateObjectInternal(INode, INode)
BaseDataset.GetQuotedWithPredicateObjectInternal(INode, INode)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF.Query.Datasets
Assembly: dotNetRdf.dll
Syntax
public abstract class BaseTransactionalDataset : BaseDataset, ISparqlDataset, ITripleIndex
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

| Edit this page View Source

BaseTransactionalDataset()

Creates a new Transactional Dataset.

Declaration
public BaseTransactionalDataset()
| Edit this page View Source

BaseTransactionalDataset(bool)

Creates a new Transactional Dataset with the given Union Default Graph setting.

Declaration
public BaseTransactionalDataset(bool unionDefaultGraph)
Parameters
Type Name Description
bool unionDefaultGraph

Whether to use a Union Default Graph.

| Edit this page View Source

BaseTransactionalDataset(Uri)

Creates a new Transactional Dataset with a fixed Default Graph and no Union Default Graph.

Declaration
[Obsolete("Replaced by BaseTransactionalDataset(IRefNode)")]
public BaseTransactionalDataset(Uri defaultGraphUri)
Parameters
Type Name Description
Uri defaultGraphUri

Default Graph URI.

| Edit this page View Source

BaseTransactionalDataset(IRefNode)

Creates a new transactional dataset with a fixed default graph and no union default graph.

Declaration
public BaseTransactionalDataset(IRefNode defaultGraphName)
Parameters
Type Name Description
IRefNode defaultGraphName

Default graph name.

Properties

| Edit this page View Source

this[Uri]

Gets a Graph from the Dataset.

Declaration
[Obsolete("Replaced by this[IRefNode]")]
public override sealed IGraph this[Uri graphUri] { get; }
Parameters
Type Name Description
Uri graphUri

Graph URI.

Property Value
Type Description
IGraph
Overrides
BaseDataset.this[Uri]
Remarks

If the Graph has been modified during the active Transaction the modified version is returned rather than the original version.

| Edit this page View Source

this[IRefNode]

Gets the graph with the given name from the dataset.

Declaration
public override sealed IGraph this[IRefNode graphName] { get; }
Parameters
Type Name Description
IRefNode graphName

Graph name.

Property Value
Type Description
IGraph
Overrides
BaseDataset.this[IRefNode]
Remarks

This property need only return a read-only view of the Graph, code which wishes to modify Graphs should use the GetModifiableGraph() method to guarantee a Graph they can modify and will be persisted to the underlying storage.

Methods

| Edit this page View Source

AddGraph(IGraph)

Adds a Graph to the Dataset.

Declaration
public override sealed bool AddGraph(IGraph g)
Parameters
Type Name Description
IGraph g

Graph to add.

Returns
Type Description
bool
Overrides
BaseDataset.AddGraph(IGraph)
| Edit this page 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
bool
| Edit this page View Source

Discard()

Ensures that any changes to the Dataset (if any) are discarded.

Declaration
public override sealed void Discard()
Overrides
BaseDataset.Discard()
Remarks

Rollback the Active Transaction.

| Edit this page View Source

DiscardInternal()

Allows the derived dataset to take any post-Discard() actions required.

Declaration
protected virtual void DiscardInternal()
| Edit this page View Source

Flush()

Ensures that any changes to the Dataset (if any) are flushed to the underlying Storage.

Declaration
public override sealed void Flush()
Overrides
BaseDataset.Flush()
Remarks

Commits the Active Transaction.

| Edit this page View Source

FlushInternal()

Allows the derived dataset to take any post-Flush() actions required.

Declaration
protected virtual void FlushInternal()
| Edit this page View Source

GetModifiableGraph(IRefNode)

Gets the Graph with the given URI from the Dataset.

Declaration
public override sealed IGraph GetModifiableGraph(IRefNode graphName)
Parameters
Type Name Description
IRefNode graphName

Graph URI.

Returns
Type Description
IGraph
Overrides
BaseDataset.GetModifiableGraph(IRefNode)
Remarks

Graphs returned from this method must be modifiable and the Dataset must guarantee that when it is Flushed or Disposed of that any changes to the Graph are persisted.

| Edit this page View Source

GetModifiableGraphInternal(IRefNode)

Gets a Graph from the Dataset that can be modified transactionally.

Declaration
protected abstract ITransactionalGraph GetModifiableGraphInternal(IRefNode graphName)
Parameters
Type Name Description
IRefNode graphName

Graph URI.

Returns
Type Description
ITransactionalGraph
| Edit this page View Source

RemoveGraph(Uri)

Removes a Graph from the Dataset.

Declaration
[Obsolete("Replaced by RemoveGraph(IRefNode)")]
public override sealed bool RemoveGraph(Uri graphUri)
Parameters
Type Name Description
Uri graphUri

Graph URI.

Returns
Type Description
bool
Overrides
BaseDataset.RemoveGraph(Uri)
| Edit this page View Source

RemoveGraph(IRefNode)

Removes a Graph from the Dataset.

Declaration
public override bool RemoveGraph(IRefNode graphName)
Parameters
Type Name Description
IRefNode graphName

Graph name.

Returns
Type Description
bool
Overrides
BaseDataset.RemoveGraph(IRefNode)
Exceptions
Type Condition
NotSupportedException

May be thrown if the Dataset is immutable i.e. Updates not supported.

Implements

ISparqlDataset
ITripleIndex

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • BaseTransactionalDataset()
    • BaseTransactionalDataset(bool)
    • BaseTransactionalDataset(Uri)
    • BaseTransactionalDataset(IRefNode)
  • Properties
    • this[Uri]
    • this[IRefNode]
  • Methods
    • AddGraph(IGraph)
    • AddGraphInternal(IGraph)
    • Discard()
    • DiscardInternal()
    • Flush()
    • FlushInternal()
    • GetModifiableGraph(IRefNode)
    • GetModifiableGraphInternal(IRefNode)
    • RemoveGraph(Uri)
    • RemoveGraph(IRefNode)
  • Implements
  • Extension Methods
Back to top Generated by DocFX