Class TripleCollection
Basic Triple Collection which is not indexed.
Implements
Inherited Members
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public class TripleCollection : BaseTripleCollection, IDisposable, IEnumerable<Triple>, IEnumerable
Fields
| Improve this Doc View SourceTriples
Underlying Storage of the Triple Collection.
Declaration
protected readonly MultiDictionary<Triple, TripleRefs> Triples
Field Value
Type | Description |
---|---|
VDS.Common.Collections.MultiDictionary<TKey, TValue><Triple, TripleRefs> |
Properties
| Improve this Doc View SourceAsserted
Gets the triples that are asserted in the collection.
Declaration
public override IEnumerable<Triple> Asserted { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
Overrides
Remarks
This returns the same set of triples as the enumerator on this class, but as an System.Collections.Generic.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
| Improve this Doc 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 |
---|---|
System.Collections.Generic.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 |
---|---|
System.Collections.Generic.IEnumerable<T><INode> |
Overrides
| Improve this Doc 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 |
---|---|
System.Collections.Generic.IEnumerable<T><INode> |
Overrides
| Improve this Doc View SourceQuoted
Gets the triples that are quoted in the collection.
Declaration
public override IEnumerable<Triple> Quoted { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
Overrides
| Improve this Doc View SourceQuotedCount
Gets the number of quoted triples in the triple collection.
Declaration
public override int QuotedCount { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
| Improve this Doc 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 |
---|---|
System.Collections.Generic.IEnumerable<T><INode> |
Overrides
| Improve this Doc 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 |
---|---|
System.Collections.Generic.IEnumerable<T><INode> |
Overrides
| Improve this Doc 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 |
---|---|
System.Collections.Generic.IEnumerable<T><INode> |
Overrides
| Improve this Doc 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 |
---|---|
System.Collections.Generic.IEnumerable<T><INode> |
Overrides
Methods
| Improve this Doc 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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean | True if the triple exists as an asserted triple in the collection. |
Overrides
| Improve this Doc 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 |
---|---|
System.Boolean | True if the triple is quoted in the triple collection, false otherwise. |
Overrides
| Improve this Doc 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 |
---|---|
System.Boolean |
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()
Disposes of a Triple Collection.
Declaration
public override void Dispose()
Overrides
| Improve this Doc View SourceGetEnumerator()
Gets the Enumerator for the Collection.
Declaration
public override IEnumerator<Triple> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<T><Triple> |
Overrides
| Improve this Doc 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.