Show / Hide Table of Contents

Class ThreadSafeTripleCollection

Thread Safe decorator for triple collections.

Inheritance
object
BaseTripleCollection
WrapperTripleCollection
ThreadSafeTripleCollection
Implements
IEnumerable<Triple>
IEnumerable
IDisposable
Inherited Members
WrapperTripleCollection._triples
BaseTripleCollection.this[(INode s, INode p, INode o)]
BaseTripleCollection.QuotedWithSubject(INode)
BaseTripleCollection.QuotedWithPredicate(INode)
BaseTripleCollection.QuotedWithObject(INode)
BaseTripleCollection.QuotedWithSubjectPredicate(INode, INode)
BaseTripleCollection.QuotedWithPredicateObject(INode, INode)
BaseTripleCollection.QuotedWithSubjectObject(INode, INode)
BaseTripleCollection.TripleAdded
BaseTripleCollection.TripleRemoved
BaseTripleCollection.RaiseTripleAdded(Triple)
BaseTripleCollection.RaiseTripleRemoved(Triple)
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 ThreadSafeTripleCollection : WrapperTripleCollection, IEnumerable<Triple>, IEnumerable, IDisposable
Remarks

Depending on the platform this either uses ReaderWriterLockSlim to provide MRSW concurrency or it uses Monitor to provide exclusive access concurrency, either way usage is thread safe.

Constructors

| Edit this page View Source

ThreadSafeTripleCollection()

Creates a new thread safe triple collection which wraps a new instance of the default unindexed TripleCollection.

Declaration
public ThreadSafeTripleCollection()
| Edit this page View Source

ThreadSafeTripleCollection(BaseTripleCollection)

Creates a new thread safe triple collection which wraps the provided triple collection.

Declaration
public ThreadSafeTripleCollection(BaseTripleCollection tripleCollection)
Parameters
Type Name Description
BaseTripleCollection tripleCollection

Triple Collection.

Properties

| Edit this page View Source

Asserted

Gets the triples that are asserted in the collection.

Declaration
public override IEnumerable<Triple> Asserted { get; }
Property Value
Type Description
IEnumerable<Triple>
Overrides
BaseTripleCollection.Asserted
Remarks

This returns the same set of triples as the enumerator on this class, but as an IEnumerable<T> instance.

| Edit this page View Source

Count

Gets the Number of Triples in the Triple Collection.

Declaration
public override int Count { get; }
Property Value
Type Description
int
Overrides
WrapperTripleCollection.Count
| Edit this page View Source

this[Triple]

Gets the original instance of a specific Triple from the Triple Collection.

Declaration
public override Triple this[Triple t] { get; }
Parameters
Type Name Description
Triple t

Triple.

Property Value
Type Description
Triple
Overrides
WrapperTripleCollection.this[Triple]
| Edit this page View Source

ObjectNodes

Gets all the Nodes which are Objects of Triples in the Triple Collectio.

Declaration
public override IEnumerable<INode> ObjectNodes { get; }
Property Value
Type Description
IEnumerable<INode>
Overrides
WrapperTripleCollection.ObjectNodes
| Edit this page View Source

PredicateNodes

Gets all the Nodes which are Predicates of Triples in the Triple Collection.

Declaration
public override IEnumerable<INode> PredicateNodes { get; }
Property Value
Type Description
IEnumerable<INode>
Overrides
WrapperTripleCollection.PredicateNodes
| Edit this page View Source

Quoted

Gets the triples that are quoted in the collection.

Declaration
public override IEnumerable<Triple> Quoted { get; }
Property Value
Type Description
IEnumerable<Triple>
Overrides
BaseTripleCollection.Quoted
| Edit this page View Source

QuotedCount

Gets the number of quoted triples in the triple collection.

Declaration
public override int QuotedCount { get; }
Property Value
Type Description
int
Overrides
BaseTripleCollection.QuotedCount
| Edit this page View Source

QuotedObjectNodes

Gets all the nodes which are subjects of quoted triples in the triple collection.

Declaration
public override IEnumerable<INode> QuotedObjectNodes { get; }
Property Value
Type Description
IEnumerable<INode>
Overrides
BaseTripleCollection.QuotedObjectNodes
| Edit this page View Source

QuotedPredicateNodes

Gets all the nodes which are predicates of quoted triples in the triple collection.

Declaration
public override IEnumerable<INode> QuotedPredicateNodes { get; }
Property Value
Type Description
IEnumerable<INode>
Overrides
BaseTripleCollection.QuotedPredicateNodes
| Edit this page View Source

QuotedSubjectNodes

Gets all the nodes which are objects of quoted triples in the triple collection.

Declaration
public override IEnumerable<INode> QuotedSubjectNodes { get; }
Property Value
Type Description
IEnumerable<INode>
Overrides
BaseTripleCollection.QuotedSubjectNodes
| Edit this page View Source

SubjectNodes

Gets all the Nodes which are Subjects of Triples in the Triple Collection.

Declaration
public override IEnumerable<INode> SubjectNodes { get; }
Property Value
Type Description
IEnumerable<INode>
Overrides
WrapperTripleCollection.SubjectNodes

Methods

| Edit this page View Source

Add(Triple)

Adds a Triple to the Collection.

Declaration
protected override bool Add(Triple t)
Parameters
Type Name Description
Triple t

Triple to add.

Returns
Type Description
bool
Overrides
WrapperTripleCollection.Add(Triple)
| Edit this page View Source

Contains(Triple)

Determines whether a given Triple is in the Triple Collection.

Declaration
public override bool Contains(Triple t)
Parameters
Type Name Description
Triple t

The Triple to test.

Returns
Type Description
bool

True if the Triple already exists in the Triple Collection.

Overrides
WrapperTripleCollection.Contains(Triple)
| Edit this page View Source

ContainsQuoted(Triple)

Determines whether a given triple is quoted by a triple node of a triple in the collection.

Declaration
public override bool ContainsQuoted(Triple t)
Parameters
Type Name Description
Triple t

The triple to test.

Returns
Type Description
bool

True if the triple is quoted in the triple collection, false otherwise.

Overrides
BaseTripleCollection.ContainsQuoted(Triple)
| Edit this page View Source

Delete(Triple)

Deletes a Triple from the Collection.

Declaration
protected override bool Delete(Triple t)
Parameters
Type Name Description
Triple t

Triple to remove.

Returns
Type Description
bool
Overrides
WrapperTripleCollection.Delete(Triple)
Remarks

Deleting something that doesn't exist has no effect and gives no error.

| Edit this page View Source

Dispose()

Disposes of a Triple Collection.

Declaration
public override void Dispose()
Overrides
WrapperTripleCollection.Dispose()
| Edit this page View Source

EnterReadLock()

Enters the read lock.

Declaration
protected void EnterReadLock()
| Edit this page View Source

EnterWriteLock()

Enters the write lock.

Declaration
protected void EnterWriteLock()
| Edit this page View Source

ExitReadLock()

Exists the read lock.

Declaration
protected void ExitReadLock()
| Edit this page View Source

ExitWriteLock()

Exists the write lock.

Declaration
protected void ExitWriteLock()
| Edit this page View Source

GetEnumerator()

Gets the Enumerator for the Collection.

Declaration
public override IEnumerator<Triple> GetEnumerator()
Returns
Type Description
IEnumerator<Triple>
Overrides
WrapperTripleCollection.GetEnumerator()
| Edit this page View Source

WithObject(INode)

Gets all triples with the given Object.

Declaration
public override IEnumerable<Triple> WithObject(INode obj)
Parameters
Type Name Description
INode obj

Object.

Returns
Type Description
IEnumerable<Triple>
Overrides
WrapperTripleCollection.WithObject(INode)
| Edit this page View Source

WithPredicate(INode)

Gets all triples with the given predicate.

Declaration
public override IEnumerable<Triple> WithPredicate(INode pred)
Parameters
Type Name Description
INode pred

Predicate.

Returns
Type Description
IEnumerable<Triple>
Overrides
WrapperTripleCollection.WithPredicate(INode)
| Edit this page View Source

WithPredicateObject(INode, INode)

Gets all triples with the given predicate object.

Declaration
public override IEnumerable<Triple> WithPredicateObject(INode pred, INode obj)
Parameters
Type Name Description
INode pred

Predicate.

INode obj

Object.

Returns
Type Description
IEnumerable<Triple>
Overrides
WrapperTripleCollection.WithPredicateObject(INode, INode)
| Edit this page View Source

WithSubject(INode)

Gets all the triples with the given subject.

Declaration
public override IEnumerable<Triple> WithSubject(INode subj)
Parameters
Type Name Description
INode subj

Subject.

Returns
Type Description
IEnumerable<Triple>
Overrides
WrapperTripleCollection.WithSubject(INode)
| Edit this page View Source

WithSubjectObject(INode, INode)

Gets all the triples with the given subject and object.

Declaration
public override IEnumerable<Triple> WithSubjectObject(INode subj, INode obj)
Parameters
Type Name Description
INode subj

Subject.

INode obj

Object.

Returns
Type Description
IEnumerable<Triple>
Overrides
WrapperTripleCollection.WithSubjectObject(INode, INode)
| Edit this page View Source

WithSubjectPredicate(INode, INode)

Gets all triples with the given subject and predicate.

Declaration
public override IEnumerable<Triple> WithSubjectPredicate(INode subj, INode pred)
Parameters
Type Name Description
INode subj

Subject.

INode pred

Predicate.

Returns
Type Description
IEnumerable<Triple>
Overrides
WrapperTripleCollection.WithSubjectPredicate(INode, INode)

Implements

IEnumerable<T>
IEnumerable
IDisposable

Extension Methods

Extensions.ChunkBy<T>(IEnumerable<T>, int)
Extensions.IsDisjoint<T>(IEnumerable<T>, IEnumerable<T>)
Extensions.WithObject(IEnumerable<Triple>, INode)
Extensions.WithPredicate(IEnumerable<Triple>, INode)
Extensions.WithSubject(IEnumerable<Triple>, INode)
LiteralExtensions.ToTripleCollection(IEnumerable<Triple>, bool)
Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • ThreadSafeTripleCollection()
    • ThreadSafeTripleCollection(BaseTripleCollection)
  • Properties
    • Asserted
    • Count
    • this[Triple]
    • ObjectNodes
    • PredicateNodes
    • Quoted
    • QuotedCount
    • QuotedObjectNodes
    • QuotedPredicateNodes
    • QuotedSubjectNodes
    • SubjectNodes
  • Methods
    • Add(Triple)
    • Contains(Triple)
    • ContainsQuoted(Triple)
    • Delete(Triple)
    • Dispose()
    • EnterReadLock()
    • EnterWriteLock()
    • ExitReadLock()
    • ExitWriteLock()
    • GetEnumerator()
    • WithObject(INode)
    • WithPredicate(INode)
    • WithPredicateObject(INode, INode)
    • WithSubject(INode)
    • WithSubjectObject(INode, INode)
    • WithSubjectPredicate(INode, INode)
  • Implements
  • Extension Methods
Back to top Generated by DocFX