Show / Hide Table of Contents

Class ThreadSafeGraphCollection

Thread Safe decorator around a Graph collection.

Inheritance
System.Object
BaseGraphCollection
WrapperGraphCollection
ThreadSafeGraphCollection
Implements
System.Collections.Generic.IEnumerable<T><IGraph>
System.Collections.IEnumerable
System.IDisposable
Inherited Members
WrapperGraphCollection._graphs
BaseGraphCollection.GraphAdded
BaseGraphCollection.GraphRemoved
BaseGraphCollection.RaiseGraphAdded(IGraph)
BaseGraphCollection.RaiseGraphRemoved(IGraph)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public class ThreadSafeGraphCollection : WrapperGraphCollection, IEnumerable<IGraph>, IEnumerable, IDisposable
Remarks

Provides concurrency via a System.Threading.ReaderWriterLockSlim.

Constructors

| Improve this Doc View Source

ThreadSafeGraphCollection()

Creates a new Thread Safe decorator around the default GraphCollection.

Declaration
public ThreadSafeGraphCollection()
Remarks

Provides concurrency via a System.Threading.ReaderWriterLockSlim.

| Improve this Doc View Source

ThreadSafeGraphCollection(BaseGraphCollection)

Creates a new Thread Safe decorator around the supplied graph collection.

Declaration
public ThreadSafeGraphCollection(BaseGraphCollection graphCollection)
Parameters
Type Name Description
BaseGraphCollection graphCollection

Graph Collection.

Remarks

Provides concurrency via a System.Threading.ReaderWriterLockSlim.

Properties

| Improve this Doc View Source

Count

Gets the number of Graphs in the Collection.

Declaration
public override int Count { get; }
Property Value
Type Description
int
Overrides
WrapperGraphCollection.Count
Remarks

Provides concurrency via a System.Threading.ReaderWriterLockSlim.

| Improve this Doc View Source

GraphNames

Provides an enumeration of the names of all of teh graphs in the collection.

Declaration
public override IEnumerable<IRefNode> GraphNames { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<T><IRefNode>
Overrides
WrapperGraphCollection.GraphNames
Remarks

Provides concurrency via a System.Threading.ReaderWriterLockSlim.

| Improve this Doc View Source

GraphUris

Provides access to the Graph URIs of Graphs in the Collection.

Declaration
[Obsolete]
public override IEnumerable<Uri> GraphUris { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<T><System.Uri>
Overrides
WrapperGraphCollection.GraphUris
Remarks

Provides concurrency via a System.Threading.ReaderWriterLockSlim.

| Improve this Doc View Source

this[Uri]

Gets a Graph from the Collection.

Declaration
[Obsolete]
public override IGraph this[Uri graphUri] { get; }
Parameters
Type Name Description
System.Uri graphUri

Graph Uri.

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

Provides concurrency via a System.Threading.ReaderWriterLockSlim.

| Improve this Doc View Source

this[IRefNode]

Gets a graph from the collection.

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

The name of the graph to retrieve.

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

The null value is used to reference the default graph.

Methods

| Improve this Doc View Source

Add(IGraph, bool)

Adds a Graph to the Collection.

Declaration
public override bool Add(IGraph g, bool mergeIfExists)
Parameters
Type Name Description
IGraph g

Graph to add.

System.Boolean mergeIfExists

Sets whether the Graph should be merged with an existing Graph of the same Uri if present.

Returns
Type Description
System.Boolean
Overrides
WrapperGraphCollection.Add(IGraph, bool)
Remarks

Provides concurrency via a System.Threading.ReaderWriterLockSlim.

Exceptions
Type Condition
RdfException

Throws an RDF Exception if the Graph has no Base Uri or if the Graph already exists in the Collection and the mergeIfExists parameter was not set to true.

| Improve this Doc View Source

Contains(Uri)

Checks whether the Graph with the given Uri exists in this Graph Collection.

Declaration
[Obsolete]
public override bool Contains(Uri graphUri)
Parameters
Type Name Description
System.Uri graphUri

Graph Uri to test.

Returns
Type Description
System.Boolean
Overrides
WrapperGraphCollection.Contains(Uri)
Remarks

Provides concurrency via a System.Threading.ReaderWriterLockSlim.

| Improve this Doc View Source

Contains(IRefNode)

Checks whether the graph with the given name exists in this graph collection.

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

Graph name to test for.

Returns
Type Description
System.Boolean

True if a graph with the specified name is in the collection, false otherwise.

Overrides
WrapperGraphCollection.Contains(IRefNode)
Remarks

The null value is used to reference the default (unnamed) graph.

| Improve this Doc View Source

Dispose()

Disposes of the Graph Collection.

Declaration
public override void Dispose()
Overrides
WrapperGraphCollection.Dispose()
Remarks

Invokes the Dispose() method of all Graphs contained in the Collection.

| Improve this Doc View Source

EnterReadLock()

Enters the read lock.

Declaration
protected void EnterReadLock()
Remarks

Provides concurrency via a System.Threading.ReaderWriterLockSlim.

| Improve this Doc View Source

EnterWriteLock()

Enters the write lock.

Declaration
protected void EnterWriteLock()
Remarks

Provides concurrency via a System.Threading.ReaderWriterLockSlim.

| Improve this Doc View Source

ExitReadLock()

Exits the read lock.

Declaration
protected void ExitReadLock()
Remarks

Provides concurrency via a System.Threading.ReaderWriterLockSlim.

| Improve this Doc View Source

ExitWriteLock()

Exits the write lock.

Declaration
protected void ExitWriteLock()
Remarks

Provides concurrency via a System.Threading.ReaderWriterLockSlim.

| Improve this Doc View Source

GetEnumerator()

Gets the Enumerator for the Collection.

Declaration
public override IEnumerator<IGraph> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<T><IGraph>
Overrides
WrapperGraphCollection.GetEnumerator()
Remarks

Provides concurrency via a System.Threading.ReaderWriterLockSlim.

| Improve this Doc View Source

Remove(Uri)

Removes a Graph from the Collection.

Declaration
[Obsolete]
public override bool Remove(Uri graphUri)
Parameters
Type Name Description
System.Uri graphUri

Uri of the Graph to remove.

Returns
Type Description
System.Boolean
Overrides
WrapperGraphCollection.Remove(Uri)
Remarks

Provides concurrency via a System.Threading.ReaderWriterLockSlim.

| Improve this Doc View Source

Remove(IRefNode)

Removes a graph from the collection.

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

Name of the Graph to remove.

Returns
Type Description
System.Boolean
Overrides
WrapperGraphCollection.Remove(IRefNode)
Remarks

The null value is used to reference the Default Graph.

Implements

System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
System.IDisposable

Extension Methods

Extensions.ChunkBy<T>(IEnumerable<T>, int)
Extensions.IsDisjoint<T>(IEnumerable<T>, IEnumerable<T>)
Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • ThreadSafeGraphCollection()
    • ThreadSafeGraphCollection(BaseGraphCollection)
  • Properties
    • Count
    • GraphNames
    • GraphUris
    • this[Uri]
    • this[IRefNode]
  • Methods
    • Add(IGraph, bool)
    • Contains(Uri)
    • Contains(IRefNode)
    • Dispose()
    • EnterReadLock()
    • EnterWriteLock()
    • ExitReadLock()
    • ExitWriteLock()
    • GetEnumerator()
    • Remove(Uri)
    • Remove(IRefNode)
  • Implements
  • Extension Methods
Back to top Generated by DocFX