Class ThreadSafeTripleCollection
Thread Safe decorator for triple collections.
Inherited Members
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 SourceThreadSafeTripleCollection()
Creates a new thread safe triple collection which wraps a new instance of the default unindexed TripleCollection.
Declaration
public ThreadSafeTripleCollection()
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 SourceAsserted
Gets the triples that are asserted in the collection.
Declaration
public override IEnumerable<Triple> Asserted { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<Triple> |
Overrides
Remarks
This returns the same set of triples as the enumerator on this class, but as an IEnumerable<T> instance.
Count
Gets the Number of Triples in the Triple Collection.
Declaration
public override int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
| Edit this page View Sourcethis[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
| Edit this page View SourceObjectNodes
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
| Edit this page View SourcePredicateNodes
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
| Edit this page View SourceQuoted
Gets the triples that are quoted in the collection.
Declaration
public override IEnumerable<Triple> Quoted { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<Triple> |
Overrides
| Edit this page View SourceQuotedCount
Gets the number of quoted triples in the triple collection.
Declaration
public override int QuotedCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
| Edit this page View SourceQuotedObjectNodes
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
| Edit this page View SourceQuotedPredicateNodes
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
| Edit this page View SourceQuotedSubjectNodes
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
| Edit this page View SourceSubjectNodes
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
Methods
| Edit this page View SourceAdd(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
| Edit this page View SourceContains(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
| Edit this page View SourceContainsQuoted(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
| Edit this page View SourceDelete(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
Remarks
Deleting something that doesn't exist has no effect and gives no error.
Dispose(bool)
Disposes of a Triple Collection.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
Overrides
| Edit this page View SourceEnterReadLock()
Enters the read lock.
Declaration
protected void EnterReadLock()
EnterWriteLock()
Enters the write lock.
Declaration
protected void EnterWriteLock()
ExitReadLock()
Exists the read lock.
Declaration
protected void ExitReadLock()
ExitWriteLock()
Exists the write lock.
Declaration
protected void ExitWriteLock()
GetEnumerator()
Gets the Enumerator for the Collection.
Declaration
public override IEnumerator<Triple> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<Triple> |
Overrides
| Edit this page View SourceWithObject(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
| Edit this page View SourceWithPredicate(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
| Edit this page View SourceWithPredicateObject(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
| Edit this page View SourceWithSubject(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
| Edit this page View SourceWithSubjectObject(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
| Edit this page View SourceWithSubjectPredicate(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> |