Class AbstractIndexedTripleCollection
An abstract base class for triple collections with a lookup index.
Inheritance
Inherited Members
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public abstract class AbstractIndexedTripleCollection : BaseTripleCollection, IEnumerable<Triple>, IEnumerable, IDisposable
Fields
| Edit this page View SourceTriples
The triples asserted and quoted in 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 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
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. |
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page 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 |
---|---|
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. |
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceGetEnumerator()
Gets the typed Enumerator for the Triple Collection.
Declaration
public override IEnumerator<Triple> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<Triple> | An enumerator over the asserted triples in the triple collection. |
Overrides
| Edit this page 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 |