Class DynamicSubjectCollection
Represents a read/write dynamic collection of subjects by predicate and object.
Inherited Members
Namespace: VDS.RDF.Dynamic
Assembly: dotNetRdf.Dynamic.dll
Syntax
public class DynamicSubjectCollection : ICollection<INode>, IEnumerable<INode>, IEnumerable, IDynamicMetaObjectProvider
Constructors
| Edit this page View SourceDynamicSubjectCollection(INode, DynamicNode)
Initializes a new instance of the DynamicSubjectCollection class.
Declaration
public DynamicSubjectCollection(INode predicate, DynamicNode @object)
Parameters
Type | Name | Description |
---|---|---|
INode | predicate | The predicate to use. |
DynamicNode | object | The object to use. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
Properties
| Edit this page View SourceCount
Gets the number of statements with given predicate and object.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
IsReadOnly
Gets a value indicating whether this collection is read only (always false).
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
bool |
Subjects
Gets subjects of statements with given predicate and object.
Declaration
protected IEnumerable<INode> Subjects { get; }
Property Value
Type | Description |
---|---|
IEnumerable<INode> |
Remarks
Nodes are wrapped in a DynamicNode.
Methods
| Edit this page View SourceAdd(INode)
Asserts a statement with subject
and given predicate and object.
Declaration
public void Add(INode subject)
Parameters
Type | Name | Description |
---|---|---|
INode | subject | The subject to assert. |
Clear()
Retracts statements with given predicate and object.
Declaration
public void Clear()
Contains(INode)
Checks whether a statement exists with subject
and given predicate and object.
Declaration
public bool Contains(INode subject)
Parameters
Type | Name | Description |
---|---|---|
INode | subject | The subject to check. |
Returns
Type | Description |
---|---|
bool | Whether a statement exists with |
CopyTo(INode[], int)
Copies subjects of statements with given predicate and object to array
starting at index
.
Declaration
public void CopyTo(INode[] array, int index)
Parameters
Type | Name | Description |
---|---|---|
INode[] | array | The destination of subjects copied. |
int | index | The index at which copying begins. |
Remarks
Nodes are wrapped in a DynamicNode.
GetEnumerator()
Returns an enumerator that iterates through subjects of statements with given predicate and object.
Declaration
public IEnumerator<INode> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<INode> | An enumerator that can be used to iterate through subjects of statements with given predicate and object. |
Remarks
Nodes are wrapped in a DynamicNode.
Remove(INode)
Retracts statements with subject
and given predicate and object.
Declaration
public bool Remove(INode subject)
Parameters
Type | Name | Description |
---|---|---|
INode | subject | The subject to retract. |
Returns
Type | Description |
---|---|
bool | Whether any statements were retracted. |