Class AbstractIndexedTripleCollection
An abstract base class for triple collections with a lookup index.
Inheritance
Implements
Inherited Members
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public abstract class AbstractIndexedTripleCollection : BaseTripleCollection, IEnumerable<Triple>, IEnumerable, IDisposable
Fields
| Improve this Doc View SourceTriples
The triples asserted and quoted in 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 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
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. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceAddQuoted(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. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceGetEnumerator()
Gets the typed Enumerator for the Triple Collection.
Declaration
public override IEnumerator<Triple> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<T><Triple> | An enumerator over the asserted triples in the triple collection. |
Overrides
| Improve this Doc View SourceIndexAsserted(Triple)
Override in derived classes to add an asserted triple to the index.
Declaration
protected abstract void IndexAsserted(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple to add. |
IndexQuoted(Triple)
Override in derived classes to add a quoted triple to the index.
Declaration
protected abstract void IndexQuoted(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple to add. |
RemoveQuoted(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, the triple is removed from the quoted triples index. If the reference count drops to 0 and the triple is not asserted in the graph, it will be removed from the collection count. If the triple itself quotes other triples, then this process is applied out recursively.
UnindexAsserted(Triple)
Override in derived classes to remove an asserted triple from the index.
Declaration
protected abstract void UnindexAsserted(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple to remove. |
UnindexQuoted(Triple)
Override in derived classes to remove a quoted triple from the index.
Declaration
protected abstract void UnindexQuoted(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t |