Show / Hide Table of Contents

Class BaseTripleCollection

Abstract Base Class for Triple Collections.

Inheritance
object
BaseTripleCollection
AbstractIndexedTripleCollection
QuadDatasetTripleCollection
TripleCollection
UnionTripleCollection
WrapperTripleCollection
Implements
IEnumerable<Triple>
IEnumerable
IDisposable
Inherited Members
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 abstract class BaseTripleCollection : IEnumerable<Triple>, IEnumerable, IDisposable
Remarks

Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.

Properties

| Edit this page View Source

Asserted

Gets the triples that are asserted in the collection.

Declaration
public abstract IEnumerable<Triple> Asserted { get; }
Property Value
Type Description
IEnumerable<Triple>
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 abstract int Count { get; }
Property Value
Type Description
int
| Edit this page View Source

this[(INode s, INode p, INode o)]

Gets the triples that match the provided pattern.

Declaration
public virtual IEnumerable<Triple> this[(INode s, INode p, INode o) pattern] { get; }
Parameters
Type Name Description
(INode s, INode p, INode o) pattern

A tuple of subject, predicate and object node. Each item in the tuple is nullable, with a null value indicating a wildcard for matching in that position.

Property Value
Type Description
IEnumerable<Triple>
| Edit this page View Source

this[Triple]

Gets the given triple.

Declaration
public abstract Triple this[Triple t] { get; }
Parameters
Type Name Description
Triple t

Triple to retrieve.

Property Value
Type Description
Triple
Exceptions
Type Condition
KeyNotFoundException

Thrown if the given Triple doesn't exist.

| Edit this page View Source

ObjectNodes

Gets all the nodes which are objects of asserted triples in the triple collection.

Declaration
public abstract IEnumerable<INode> ObjectNodes { get; }
Property Value
Type Description
IEnumerable<INode>
| Edit this page View Source

PredicateNodes

Gets all the nodes which are predicates of asserted triples in the triple collection.

Declaration
public abstract IEnumerable<INode> PredicateNodes { get; }
Property Value
Type Description
IEnumerable<INode>
| Edit this page View Source

Quoted

Gets the triples that are quoted in the collection.

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

QuotedCount

Gets the number of quoted triples in the triple collection.

Declaration
public abstract int QuotedCount { get; }
Property Value
Type Description
int
| Edit this page View Source

QuotedObjectNodes

Gets all the nodes which are subjects of quoted triples in the triple collection.

Declaration
public abstract IEnumerable<INode> QuotedObjectNodes { get; }
Property Value
Type Description
IEnumerable<INode>
| Edit this page View Source

QuotedPredicateNodes

Gets all the nodes which are predicates of quoted triples in the triple collection.

Declaration
public abstract IEnumerable<INode> QuotedPredicateNodes { get; }
Property Value
Type Description
IEnumerable<INode>
| Edit this page View Source

QuotedSubjectNodes

Gets all the nodes which are objects of quoted triples in the triple collection.

Declaration
public abstract IEnumerable<INode> QuotedSubjectNodes { get; }
Property Value
Type Description
IEnumerable<INode>
| Edit this page View Source

SubjectNodes

Gets all the nodes which are subjects of asserted triples in the triple collection.

Declaration
public abstract IEnumerable<INode> SubjectNodes { get; }
Property Value
Type Description
IEnumerable<INode>

Methods

| Edit this page View Source

Add(Triple)

Adds a Triple to the Collection.

Declaration
protected abstract bool Add(Triple t)
Parameters
Type Name Description
Triple t

Triple to add.

Returns
Type Description
bool
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

Contains(Triple)

Determines whether a given Triple is asserted in the Triple Collection.

Declaration
public abstract 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.

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

| Edit this page View Source

Delete(Triple)

Deletes an asserted triple from the collection.

Declaration
protected abstract bool Delete(Triple t)
Parameters
Type Name Description
Triple t

Triple to remove.

Returns
Type Description
bool

True if the operation removed an asserted triple from the collection, false otherwise.

Remarks

Deleting a triple that is not asserted in the collection should have no effect and give no error. Quoted triples cannot be removed from the collection via this method - instead they should be automatically removed when all asserted triples that reference them are removed. Deleting a triple that is both asserted and quoted will remove the assertion of the triple (and return true), but the triple will remain in the collection as a quoted triples.

| Edit this page View Source

Dispose()

Disposes of a Triple Collection.

Declaration
public abstract void Dispose()
| Edit this page View Source

GetEnumerator()

Gets the typed Enumerator for the Triple Collection.

Declaration
public abstract IEnumerator<Triple> GetEnumerator()
Returns
Type Description
IEnumerator<Triple>

An enumerator over the asserted triples in the triple collection.

| Edit this page View Source

QuotedWithObject(INode)

Gets all the quoted triples with the given Object.

Declaration
public virtual IEnumerable<Triple> QuotedWithObject(INode obj)
Parameters
Type Name Description
INode obj

Object to lookup.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

QuotedWithPredicate(INode)

Gets all the quoted triples with the given Predicate.

Declaration
public virtual IEnumerable<Triple> QuotedWithPredicate(INode pred)
Parameters
Type Name Description
INode pred

Predicate to lookup.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

QuotedWithPredicateObject(INode, INode)

Gets all the quoted triples with the given Predicate Object pair.

Declaration
public virtual IEnumerable<Triple> QuotedWithPredicateObject(INode pred, INode obj)
Parameters
Type Name Description
INode pred

Predicate to lookup.

INode obj

Object to lookup.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

QuotedWithSubject(INode)

Gets all quoted triples with the given subject.

Declaration
public virtual IEnumerable<Triple> QuotedWithSubject(INode subj)
Parameters
Type Name Description
INode subj

Subject to lookup.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

QuotedWithSubjectObject(INode, INode)

Gets all the quoted triples with the given Subject Object pair.

Declaration
public virtual IEnumerable<Triple> QuotedWithSubjectObject(INode subj, INode obj)
Parameters
Type Name Description
INode subj

Subject to lookup.

INode obj

Object to lookup.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

QuotedWithSubjectPredicate(INode, INode)

Gets all the quoted triples with the given Subject Predicate pair.

Declaration
public virtual IEnumerable<Triple> QuotedWithSubjectPredicate(INode subj, INode pred)
Parameters
Type Name Description
INode subj

Subject to lookup.

INode pred

Predicate to lookup.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

RaiseTripleAdded(Triple)

Helper method for raising the Triple Added event.

Declaration
protected void RaiseTripleAdded(Triple t)
Parameters
Type Name Description
Triple t

Triple.

| Edit this page View Source

RaiseTripleRemoved(Triple)

Helper method for raising the Triple Removed event.

Declaration
protected void RaiseTripleRemoved(Triple t)
Parameters
Type Name Description
Triple t

Triple.

| Edit this page View Source

WithObject(INode)

Gets all the asserted triples with the given object.

Declaration
public virtual IEnumerable<Triple> WithObject(INode obj)
Parameters
Type Name Description
INode obj

Object to lookup.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

WithPredicate(INode)

Gets all the asserted triples with the given predicate.

Declaration
public virtual IEnumerable<Triple> WithPredicate(INode pred)
Parameters
Type Name Description
INode pred

Predicate to lookup.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

WithPredicateObject(INode, INode)

Gets all the Triples with the given Predicate Object pair.

Declaration
public virtual IEnumerable<Triple> WithPredicateObject(INode pred, INode obj)
Parameters
Type Name Description
INode pred

Predicate to lookup.

INode obj

Object to lookup.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

WithSubject(INode)

Gets all the asserted triples with the given subject.

Declaration
public virtual IEnumerable<Triple> WithSubject(INode subj)
Parameters
Type Name Description
INode subj

Subject to lookup.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

WithSubjectObject(INode, INode)

Gets all the Triples with the given Subject Object pair.

Declaration
public virtual IEnumerable<Triple> WithSubjectObject(INode subj, INode obj)
Parameters
Type Name Description
INode subj

Subject to lookup.

INode obj

Object to lookup.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

WithSubjectPredicate(INode, INode)

Gets all the asserted triples with the given subject/predicate pair.

Declaration
public virtual IEnumerable<Triple> WithSubjectPredicate(INode subj, INode pred)
Parameters
Type Name Description
INode subj

Subject to lookup.

INode pred

Predicate to lookup.

Returns
Type Description
IEnumerable<Triple>

Events

| Edit this page View Source

TripleAdded

Event which occurs when a triple is added to the collection as an asserted triple.

Declaration
public event TripleEventHandler TripleAdded
Event Type
Type Description
TripleEventHandler
| Edit this page View Source

TripleRemoved

Event which occurs when a triple is un-asserted from the collection.

Declaration
public event TripleEventHandler TripleRemoved
Event Type
Type Description
TripleEventHandler

Implements

IEnumerable<T>
IEnumerable
IDisposable

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
  • Properties
    • Asserted
    • Count
    • this[(INode s, INode p, INode o)]
    • this[Triple]
    • ObjectNodes
    • PredicateNodes
    • Quoted
    • QuotedCount
    • QuotedObjectNodes
    • QuotedPredicateNodes
    • QuotedSubjectNodes
    • SubjectNodes
  • Methods
    • Add(Triple)
    • Contains(Triple)
    • ContainsQuoted(Triple)
    • Delete(Triple)
    • Dispose()
    • GetEnumerator()
    • QuotedWithObject(INode)
    • QuotedWithPredicate(INode)
    • QuotedWithPredicateObject(INode, INode)
    • QuotedWithSubject(INode)
    • QuotedWithSubjectObject(INode, INode)
    • QuotedWithSubjectPredicate(INode, INode)
    • RaiseTripleAdded(Triple)
    • RaiseTripleRemoved(Triple)
    • WithObject(INode)
    • WithPredicate(INode)
    • WithPredicateObject(INode, INode)
    • WithSubject(INode)
    • WithSubjectObject(INode, INode)
    • WithSubjectPredicate(INode, INode)
  • Events
    • TripleAdded
    • TripleRemoved
  • Implements
  • Extension Methods
Back to top Generated by DocFX