Class BaseTripleCollection
Abstract Base Class for Triple Collections.
Inheritance
Implements
Inherited Members
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
| Improve this Doc View SourceAsserted
Gets the triples that are asserted in the collection.
Declaration
public abstract IEnumerable<Triple> Asserted { get; }
Property Value
Type | Description |
---|---|
System. |
Remarks
This returns the same set of triples as the enumerator on this class, but as an System.
Count
Gets the number of asserted triples in the triple collection.
Declaration
public abstract int Count { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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 |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
Exceptions
Type | Condition |
---|---|
System. |
Thrown if the given Triple doesn't exist. |
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 |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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 |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
Quoted
Gets the triples that are quoted in the collection.
Declaration
public abstract IEnumerable<Triple> Quoted { get; }
Property Value
Type | Description |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
QuotedCount
Gets the number of quoted triples in the triple collection.
Declaration
public abstract int QuotedCount { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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 |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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 |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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 |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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 |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
Methods
| Improve this Doc View SourceAdd(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 |
---|---|
System. |
Remarks
Adding a Triple that already exists should be permitted though it is not necessary to persist the duplicate to underlying storage.
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 |
---|---|
System. |
True if the triple exists as an asserted triple in the collection. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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 |
---|---|
System. |
True if the triple is quoted in the triple collection, false otherwise. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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 |
---|---|
System. |
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.
Dispose()
Disposes of a Triple Collection.
Declaration
public abstract void Dispose()
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
GetEnumerator()
Gets the typed Enumerator for the Triple Collection.
Declaration
public abstract IEnumerator<Triple> GetEnumerator()
Returns
Type | Description |
---|---|
System. |
An enumerator over the asserted triples in the triple collection. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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 |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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 |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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
Returns
Type | Description |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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 |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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
Returns
Type | Description |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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
Returns
Type | Description |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
RaiseTripleAdded(Triple)
Helper method for raising the Triple Added event.
Declaration
protected void RaiseTripleAdded(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
RaiseTripleRemoved(Triple)
Helper method for raising the Triple Removed event.
Declaration
protected void RaiseTripleRemoved(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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 |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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 |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
WithPredicateObject(INode, INode)
Gets all the Triples with the given Predicate Object pair.
Declaration
public virtual IEnumerable<Triple> WithPredicateObject(INode pred, INode obj)
Parameters
Returns
Type | Description |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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 |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
WithSubjectObject(INode, INode)
Gets all the Triples with the given Subject Object pair.
Declaration
public virtual IEnumerable<Triple> WithSubjectObject(INode subj, INode obj)
Parameters
Returns
Type | Description |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
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
Returns
Type | Description |
---|---|
System. |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
Events
| Improve this Doc View SourceTripleAdded
Event which occurs when a triple is added to the collection as an asserted triple.
Declaration
public event TripleEventHandler TripleAdded
Event Type
Type | Description |
---|---|
Triple |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.
TripleRemoved
Event which occurs when a triple is un-asserted from the collection.
Declaration
public event TripleEventHandler TripleRemoved
Event Type
Type | Description |
---|---|
Triple |
Remarks
Designed to allow the underlying storage of a Triple Collection to be changed at a later date without affecting classes that use it.