Class TripleCollection
Basic Triple Collection which is not indexed.
Inherited Members
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public class TripleCollection : BaseTripleCollection, IDisposable, IEnumerable<Triple>, IEnumerable
Fields
| Edit this page View SourceTriples
Underlying Storage of the Triple Collection.
Declaration
protected readonly MultiDictionary<Triple, TripleRefs> Triples
Field Value
| Type | Description |
|---|---|
| MultiDictionary<Triple, TripleRefs> |
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 asserted 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 given Triple.
Declaration
public override Triple this[Triple t] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| Triple | t | Triple to retrieve. |
Property Value
| Type | Description |
|---|---|
| Triple |
Overrides
Exceptions
| Type | Condition |
|---|---|
| KeyNotFoundException | Thrown if the given Triple does not exist in the Triple Collection. |
ObjectNodes
Gets all the nodes which are objects of asserted triples in the triple collection.
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 asserted 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 asserted 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
Remarks
Adding a Triple that already exists should be permitted though it is not necessary to persist the duplicate to underlying storage.
AddQuoted(ITripleNode)
Adds a quotation of a triple to the collection.
Declaration
protected void AddQuoted(ITripleNode tripleNode)
Parameters
| Type | Name | Description |
|---|---|---|
| ITripleNode | tripleNode | The triple node that quotes the triple to be added to the collection. |
Contains(Triple)
Determines whether a given Triple is asserted 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 exists as an asserted triple in the 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
Only asserted triples can be deleted. Deleting something that doesn't exist, or a triple that is only quoted 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 SourceGetEnumerator()
Gets the Enumerator for the Collection.
Declaration
public override IEnumerator<Triple> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<Triple> |
Overrides
| Edit this page View SourceRemoveQuoted(ITripleNode)
Removes a quote reference to a triple from the collection.
Declaration
protected void RemoveQuoted(ITripleNode tripleNode)
Parameters
| Type | Name | Description |
|---|---|---|
| ITripleNode | tripleNode | The node containing the triple to be 'unquoted'. |
Remarks
This method decreases the quote reference count for the triple. If the reference count drops to 0 and the triple is not also asserted in the graph, then it will be removed from the collection. If the triple itself quotes other triples, then this process is applied out recursively.