• User Guide
  • API Documentation
  • Developer Guide
  • Support
  • API Documentation
Show / Hide Table of Contents

Class TripleCollection

Basic Triple Collection which is not indexed.

Inheritance
object
BaseTripleCollection
TripleCollection
Implements
IDisposable
IEnumerable<Triple>
IEnumerable
Inherited Members
BaseTripleCollection.this[(INode s, INode p, INode o)]
BaseTripleCollection.WithSubject(INode)
BaseTripleCollection.QuotedWithSubject(INode)
BaseTripleCollection.WithPredicate(INode)
BaseTripleCollection.QuotedWithPredicate(INode)
BaseTripleCollection.WithObject(INode)
BaseTripleCollection.QuotedWithObject(INode)
BaseTripleCollection.WithSubjectPredicate(INode, INode)
BaseTripleCollection.QuotedWithSubjectPredicate(INode, INode)
BaseTripleCollection.WithPredicateObject(INode, INode)
BaseTripleCollection.QuotedWithPredicateObject(INode, INode)
BaseTripleCollection.WithSubjectObject(INode, INode)
BaseTripleCollection.QuotedWithSubjectObject(INode, INode)
BaseTripleCollection.TripleAdded
BaseTripleCollection.TripleRemoved
BaseTripleCollection.RaiseTripleAdded(Triple)
BaseTripleCollection.RaiseTripleRemoved(Triple)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public class TripleCollection : BaseTripleCollection, IDisposable, IEnumerable<Triple>, IEnumerable

Fields

| Edit this page View Source

Triples

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 Source

Asserted

Gets the triples that are asserted in the collection.

Declaration
public override IEnumerable<Triple> Asserted { get; }
Property Value
Type Description
IEnumerable<Triple>
Overrides
BaseTripleCollection.Asserted
Remarks

This returns the same set of triples as the enumerator on this class, but as an IEnumerable<T> instance.

| Edit this page View Source

Count

Gets the number of asserted triples in the triple collection.

Declaration
public override int Count { get; }
Property Value
Type Description
int
Overrides
BaseTripleCollection.Count
| Edit this page View Source

this[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
BaseTripleCollection.this[Triple]
Exceptions
Type Condition
KeyNotFoundException

Thrown if the given Triple does not exist in the Triple Collection.

| Edit this page View Source

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
BaseTripleCollection.ObjectNodes
| Edit this page View Source

PredicateNodes

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
BaseTripleCollection.PredicateNodes
| Edit this page View Source

Quoted

Gets the triples that are quoted in the collection.

Declaration
public override IEnumerable<Triple> Quoted { get; }
Property Value
Type Description
IEnumerable<Triple>
Overrides
BaseTripleCollection.Quoted
| Edit this page View Source

QuotedCount

Gets the number of quoted triples in the triple collection.

Declaration
public override int QuotedCount { get; }
Property Value
Type Description
int
Overrides
BaseTripleCollection.QuotedCount
| Edit this page View Source

QuotedObjectNodes

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
BaseTripleCollection.QuotedObjectNodes
| Edit this page View Source

QuotedPredicateNodes

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
BaseTripleCollection.QuotedPredicateNodes
| Edit this page View Source

QuotedSubjectNodes

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
BaseTripleCollection.QuotedSubjectNodes
| Edit this page View Source

SubjectNodes

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
BaseTripleCollection.SubjectNodes

Methods

| Edit this page View Source

Add(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
BaseTripleCollection.Add(Triple)
Remarks

Adding a Triple that already exists should be permitted though it is not necessary to persist the duplicate to underlying storage.

| Edit this page View Source

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.

| Edit this page View Source

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
BaseTripleCollection.Contains(Triple)
| Edit this page View Source

ContainsQuoted(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
BaseTripleCollection.ContainsQuoted(Triple)
| Edit this page View Source

Delete(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
BaseTripleCollection.Delete(Triple)
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.

| Edit this page View Source

Dispose()

Disposes of a Triple Collection.

Declaration
public override void Dispose()
Overrides
BaseTripleCollection.Dispose()
| Edit this page View Source

GetEnumerator()

Gets the Enumerator for the Collection.

Declaration
public override IEnumerator<Triple> GetEnumerator()
Returns
Type Description
IEnumerator<Triple>
Overrides
BaseTripleCollection.GetEnumerator()
| Edit this page View Source

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 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.

Implements

IDisposable
IEnumerable<T>
IEnumerable

Extension Methods

Extensions.ChunkBy<T>(IEnumerable<T>, int)
Extensions.IsDisjoint<T>(IEnumerable<T>, IEnumerable<T>)
Extensions.WithObject(IEnumerable<Triple>, INode)
Extensions.WithPredicate(IEnumerable<Triple>, INode)
Extensions.WithSubject(IEnumerable<Triple>, INode)
LiteralExtensions.ToTripleCollection(IEnumerable<Triple>, bool)
Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Fields
    • Triples
  • Properties
    • Asserted
    • Count
    • this[Triple]
    • ObjectNodes
    • PredicateNodes
    • Quoted
    • QuotedCount
    • QuotedObjectNodes
    • QuotedPredicateNodes
    • QuotedSubjectNodes
    • SubjectNodes
  • Methods
    • Add(Triple)
    • AddQuoted(ITripleNode)
    • Contains(Triple)
    • ContainsQuoted(Triple)
    • Delete(Triple)
    • Dispose()
    • GetEnumerator()
    • RemoveQuoted(ITripleNode)
  • Implements
  • Extension Methods
Back to top Generated by DocFX