Class BaseTripleCollection
Abstract Base Class for Triple Collections.
Inheritance
System.Object
BaseTripleCollection
Implements
System.Collections.Generic.IEnumerable<Triple>
System.Collections.IEnumerable
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.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
| Improve this Doc View SourceCount
Gets the Number of Triples in the Triple Collection.
Declaration
public abstract int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Item[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 |
---|---|
System.Collections.Generic.KeyNotFoundException | Thrown if the given Triple doesn't exist. |
ObjectNodes
Gets all the Nodes which are Objects of Triples in the Triple Collection.
Declaration
public abstract IEnumerable<INode> ObjectNodes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<INode> |
PredicateNodes
Gets all the Nodes which are Predicates of Triples in the Triple Collection.
Declaration
public abstract IEnumerable<INode> PredicateNodes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<INode> |
SubjectNodes
Gets all the Nodes which are Subjects of Triples in the Triple Collection.
Declaration
public abstract IEnumerable<INode> SubjectNodes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<INode> |
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.Boolean |
Remarks
Adding a Triple that already exists should be permitted though it is not necessary to persist the duplicate to underlying storage.
|
Improve this Doc
View Source
Contains(Triple)
Determines whether a given Triple is 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.Boolean | True if the Triple already exists in the Triple Collection. |
Delete(Triple)
Deletes a Triple from the Collection.
Declaration
protected abstract bool Delete(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple to remove. |
Returns
Type | Description |
---|---|
System.Boolean |
Remarks
Deleting something that doesn't exist should have no effect and give no error.
|
Improve this Doc
View Source
Dispose()
Diposes of a Triple Collection.
Declaration
public abstract void Dispose()
GetEnumerator()
Gets the typed Enumerator for the Triple Collection.
Declaration
public abstract IEnumerator<Triple> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<Triple> |
RaiseTripleAdded(Triple)
Helper method for raising the TripleAdded event.
Declaration
protected void RaiseTripleAdded(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple. |
RaiseTripleRemoved(Triple)
Helper method for raising the TripleRemoved event.
Declaration
protected void RaiseTripleRemoved(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple. |
WithObject(INode)
Gets all the 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.Collections.Generic.IEnumerable<Triple> |
WithPredicate(INode)
Gets all the 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.Collections.Generic.IEnumerable<Triple> |
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 |
---|---|
System.Collections.Generic.IEnumerable<Triple> |
WithSubject(INode)
Gets all the Triples with the given Subject.
Declaration
public virtual IEnumerable<Triple> WithSubject(INode subj)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | ubject to lookup. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Triple> |
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 |
---|---|
System.Collections.Generic.IEnumerable<Triple> |
WithSubjectPredicate(INode, INode)
Gets all the 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 |
---|---|
System.Collections.Generic.IEnumerable<Triple> |
Events
| Improve this Doc View SourceTripleAdded
Event which occurs when a Triple is added to the Collection
Declaration
public event TripleEventHandler TripleAdded
Event Type
Type | Description |
---|---|
TripleEventHandler |
TripleRemoved
Event which occurs when a Triple is removed from the Collection
Declaration
public event TripleEventHandler TripleRemoved
Event Type
Type | Description |
---|---|
TripleEventHandler |
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Gets the non-generic Enumerator for the Triple Collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
System.IDisposable