Click or drag to resize

BaseTransactionalDataset Class

Abstract Base Class for Mutable Datasets that support Transactions.
Inheritance Hierarchy

Namespace:  VDS.RDF.Query.Datasets
Assembly:  dotNetRDF (in dotNetRDF.dll) Version:
Syntax
public abstract class BaseTransactionalDataset : BaseDataset

The BaseTransactionalDataset type exposes the following members.

Constructors
  NameDescription
Public methodBaseTransactionalDataset
Creates a new Transactional Dataset.
Public methodBaseTransactionalDataset(Boolean)
Creates a new Transactional Dataset with the given Union Default Graph setting.
Public methodBaseTransactionalDataset(Uri)
Creates a new Transactional Dataset with a fixed Default Graph and no Union Default Graph.
Top
Properties
  NameDescription
Public propertyActiveGraphUris
Gets the Active Graph URIs.
(Inherited from BaseDataset.)
Public propertyDefaultGraphUris
Gets the Default Graph URIs.
(Inherited from BaseDataset.)
Public propertyGraphs
Gets all the Graphs in the Dataset.
(Inherited from BaseDataset.)
Public propertyGraphUris
Gets all the URIs of Graphs in the Dataset.
(Inherited from BaseDataset.)
Public propertyHasTriples
Gets whether the Dataset has any Triples.
(Inherited from BaseDataset.)
Protected propertyInternalDefaultGraph
Gets a reference to the actual IGraph that is currently treated as the default graph.
(Inherited from BaseDataset.)
Public propertyItem
Gets a Graph from the Dataset.
(Overrides BaseDatasetItemUri.)
Public propertyTriples
Gets all the Triples in the Dataset.
(Inherited from BaseDataset.)
Public propertyUsesUnionDefaultGraph
Gets whether the Default Graph is treated as being the union of all Graphs in the dataset when no Default Graph is otherwise set.
(Inherited from BaseDataset.)
Top
Methods
  NameDescription
Public methodAddGraph
Adds a Graph to the Dataset.
(Overrides BaseDatasetAddGraph(IGraph).)
Protected methodAddGraphInternal
Adds a Graph to the Dataset.
Public methodContainsTriple
Gets whether the Dataset contains a specific Triple.
(Inherited from BaseDataset.)
Protected methodContainsTripleInternal
Determines whether the Dataset contains a specific Triple.
(Inherited from BaseDataset.)
Public methodDiscard
Ensures that any changes to the Dataset (if any) are discarded.
(Overrides BaseDatasetDiscard.)
Protected methodDiscardInternal
Allows the derived dataset to take any post-Discard() actions required.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFlush
Ensures that any changes to the Dataset (if any) are flushed to the underlying Storage.
(Overrides BaseDatasetFlush.)
Protected methodFlushInternal
Allows the derived dataset to take any post-Flush() actions required.
Protected methodGetAllTriples
Abstract method that concrete implementations must implement to return an enumerable of all the Triples in the Dataset.
(Inherited from BaseDataset.)
Protected methodGetGraphInternal
Gets the given Graph from the Dataset.
(Inherited from BaseDataset.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetModifiableGraph
Gets a Graph from the Dataset that can be modified.
(Overrides BaseDatasetGetModifiableGraph(Uri).)
Protected methodGetModifiableGraphInternal
Gets a Graph from the Dataset that can be modified transactionally.
Public methodGetTriplesWithObject
Gets all the Triples in the Dataset with the given Object.
(Inherited from BaseDataset.)
Protected methodGetTriplesWithObjectInternal
Gets all the Triples in the Dataset with the given Object.
(Inherited from BaseDataset.)
Public methodGetTriplesWithPredicate
Gets all the Triples in the Dataset with the given Predicate.
(Inherited from BaseDataset.)
Protected methodGetTriplesWithPredicateInternal
Gets all the Triples in the Dataset with the given Predicate.
(Inherited from BaseDataset.)
Public methodGetTriplesWithPredicateObject
Gets all the Triples in the Dataset with the given Predicate and Object.
(Inherited from BaseDataset.)
Protected methodGetTriplesWithPredicateObjectInternal
Gets all the Triples in the Dataset with the given Predicate and Object.
(Inherited from BaseDataset.)
Public methodGetTriplesWithSubject
Gets all the Triples in the Dataset with the given Subject.
(Inherited from BaseDataset.)
Protected methodGetTriplesWithSubjectInternal
Gets all the Triples in the Dataset with the given Subject.
(Inherited from BaseDataset.)
Public methodGetTriplesWithSubjectObject
Gets all the Triples in the Dataset with the given Subject and Object.
(Inherited from BaseDataset.)
Protected methodGetTriplesWithSubjectObjectInternal
Gets all the Triples in the Dataset with the given Subject and Object.
(Inherited from BaseDataset.)
Public methodGetTriplesWithSubjectPredicate
Gets all the Triples in the Dataset with the given Subject and Predicate.
(Inherited from BaseDataset.)
Protected methodGetTriplesWithSubjectPredicateInternal
Gets all the Triples in the Dataset with the given Subject and Predicate.
(Inherited from BaseDataset.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHasGraph
Gets whether a Graph with the given URI is the Dataset.
(Inherited from BaseDataset.)
Protected methodHasGraphInternal
Determines whether a given Graph exists in the Dataset.
(Inherited from BaseDataset.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemoveGraph
Removes a Graph from the Dataset.
(Overrides BaseDatasetRemoveGraph(Uri).)
Protected methodRemoveGraphInternal
Removes a Graph from the Dataset.
(Inherited from BaseDataset.)
Public methodResetActiveGraph
Sets the Active Graph for the SPARQL query to be the previous Active Graph.
(Inherited from BaseDataset.)
Public methodResetDefaultGraph
Sets the Default Graph for the SPARQL Query to be the previous Default Graph.
(Inherited from BaseDataset.)
Public methodSetActiveGraph(IEnumerableUri)
Sets the Active Graph for the SPARQL query.
(Inherited from BaseDataset.)
Public methodSetActiveGraph(Uri)
Sets the Active Graph for the SPARQL query.
(Inherited from BaseDataset.)
Public methodSetDefaultGraph(IEnumerableUri)
Sets the Default Graph.
(Inherited from BaseDataset.)
Public methodSetDefaultGraph(Uri)
Sets the Default Graph.
(Inherited from BaseDataset.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
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.

See Also