Class DynamicNode
A wrapper that provides read/write dictionary and dynamic functionality.
Implements
Inherited Members
Namespace: VDS.RDF.Dynamic
Assembly: dotNetRdf.Dynamic.dll
Syntax
public class DynamicNode : WrapperNode, ILiteralNode, IUriNode, IBlankNode, IRefNode, INode, IComparable<INode>, IComparable<IBlankNode>, IComparable<IGraphLiteralNode>, IComparable<ILiteralNode>, IComparable<IUriNode>, IComparable<IVariableNode>, IComparable<IRefNode>, IComparable<ITripleNode>, IEquatable<INode>, IEquatable<IBlankNode>, IEquatable<IGraphLiteralNode>, IEquatable<ILiteralNode>, IEquatable<IUriNode>, IEquatable<IVariableNode>, IEquatable<IRefNode>, IEquatable<ITripleNode>, IDynamicMetaObjectProvider, IDictionary<INode, object>, ICollection<KeyValuePair<INode, object>>, IEnumerable<KeyValuePair<INode, object>>, IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IDictionary<Uri, object>, ICollection<KeyValuePair<Uri, object>>, IEnumerable<KeyValuePair<Uri, object>>, IEnumerable
Constructors
| Edit this page View SourceDynamicNode(INode, IGraph, Uri)
Initializes a new instance of the DynamicNode class.
Declaration
public DynamicNode(INode node, IGraph graph, Uri baseUri = null)
Parameters
Type | Name | Description |
---|---|---|
INode | node | The node to wrap. |
IGraph | graph | The graph context of the dynamic node. |
Uri | baseUri | The URI used to resolve relative predicate references. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | When |
Properties
| Edit this page View SourceBaseUri
Gets the URI used to resolve relative predicate references.
Declaration
public Uri BaseUri { get; }
Property Value
Type | Description |
---|---|
Uri |
Count
Gets the number of distinct outgoing predicates from this node.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
Graph
Get the graph context for this dynamic node.
Declaration
public IGraph Graph { get; }
Property Value
Type | Description |
---|---|
IGraph |
IsReadOnly
Gets a value indicating whether this node is read only (always false).
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
bool |
this[string]
Gets statement objects with this subject and predicate equivalent to predicate
or sets staements with this subject, predicate equivalent to predicate
and objects equivalent to value
.
Declaration
public object this[string predicate] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
string | predicate | The predicate to use. |
Property Value
Type | Description |
---|---|
object | A DynamicObjectCollection with this subject and |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
this[Uri]
Gets statement objects with this subject and predicate equivalent to predicate
or sets staements with this subject, predicate equivalent to predicate
and objects equivalent to value
.
Declaration
public object this[Uri predicate] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Uri | predicate | The predicate to use. |
Property Value
Type | Description |
---|---|
object | A DynamicObjectCollection with this subject and |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
this[INode]
Gets statement objects with this subject and predicate
or sets staements with this subject, predicate
and objects equivalent to value
.
Declaration
public object this[INode predicate] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
INode | predicate | The predicate to use. |
Property Value
Type | Description |
---|---|
object | A DynamicObjectCollection with this subject and |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
Keys
Gets an ICollection<T> containing outgoing predicate node names shortened as much as possible.
Declaration
public ICollection<string> Keys { get; }
Property Value
Type | Description |
---|---|
ICollection<string> |
Values
Gets a collection of dynamic object collections, one per distinct outgoing predicate from this node.
Declaration
public ICollection<object> Values { get; }
Property Value
Type | Description |
---|---|
ICollection<object> |
Methods
| Edit this page View SourceAdd(string, object)
Asserts statements with this subject and predicate and objects equivalent to parameters.
Declaration
public void Add(string predicate, object objects)
Parameters
Type | Name | Description |
---|---|---|
string | predicate | The predicate to assert. |
object | objects | An object or enumerable representing objects to assert. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
Add(Uri, object)
Asserts statements with this subject and predicate and objects equivalent to parameters.
Declaration
public void Add(Uri predicate, object objects)
Parameters
Type | Name | Description |
---|---|---|
Uri | predicate | The predicate to assert. |
object | objects | An object or enumerable representing objects to assert. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
Add(INode, object)
Asserts statements with this subject, predicate
and equivalent to objects
.
Declaration
public void Add(INode predicate, object objects)
Parameters
Type | Name | Description |
---|---|---|
INode | predicate | The predicate to assert. |
object | objects | An object or enumerable representing objects to assert. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
Clear()
Retracts statements with this subject.
Declaration
public void Clear()
Contains(string, object)
Checks whether statements exist with this subject, predicate equivalent to predicate
and objects equivalent to objects
.
Declaration
public bool Contains(string predicate, object objects)
Parameters
Type | Name | Description |
---|---|---|
string | predicate | The predicate to assert. |
object | objects | An object or enumerable representing objects to assert. |
Returns
Type | Description |
---|---|
bool | Whether statements exist with this subject, predicate equivalent to |
Contains(Uri, object)
Checks whether statements exist with this subject, predicate equivalent to predicate
and objects equivalent to objects
.
Declaration
public bool Contains(Uri predicate, object objects)
Parameters
Type | Name | Description |
---|---|---|
Uri | predicate | The predicate to assert. |
object | objects | An object or enumerable representing objects to assert. |
Returns
Type | Description |
---|---|
bool | Whether statements exist with this subject, predicate equivalent to |
Contains(INode, object)
Checks whether statements exist with this subject, predicate
and objects equivalent to objects
.
Declaration
public bool Contains(INode predicate, object objects)
Parameters
Type | Name | Description |
---|---|---|
INode | predicate | The predicate to assert. |
object | objects | An object or enumerable representing objects to assert. |
Returns
Type | Description |
---|---|
bool | Whether statements exist with this subject, |
ContainsKey(string)
Checks whether this node has an outgoing predicate equivalent to key
.
Declaration
public bool ContainsKey(string key)
Parameters
Type | Name | Description |
---|---|---|
string | key | The node to check. |
Returns
Type | Description |
---|---|
bool | Whether this node has an outgoing predicate equivalent to |
ContainsKey(Uri)
Checks whether this node has an outgoing predicate equivalent to key
.
Declaration
public bool ContainsKey(Uri key)
Parameters
Type | Name | Description |
---|---|---|
Uri | key | The node to check. |
Returns
Type | Description |
---|---|
bool | Whether this node has an outgoing predicate equivalent to |
ContainsKey(INode)
Checks whether this node has an outgoing predicate equal to key
.
Declaration
public bool ContainsKey(INode key)
Parameters
Type | Name | Description |
---|---|---|
INode | key | The node to check. |
Returns
Type | Description |
---|---|
bool | Whether this node has an outgoing predicate equal to |
Remove(string)
Retracts statements with this subject and equivalent to predicate
.
Declaration
public bool Remove(string predicate)
Parameters
Type | Name | Description |
---|---|---|
string | predicate | The predicate to retract. |
Returns
Type | Description |
---|---|
bool | Whether any statements were retracted. |
Remove(string, object)
Retracts statements with this subject, predicate equivalent to predicate
and objects equivalent to objects
.
Declaration
public bool Remove(string predicate, object objects)
Parameters
Type | Name | Description |
---|---|---|
string | predicate | The predicate to retract. |
object | objects | An object with public properties or a dictionary representing predicates and objects to retract. |
Returns
Type | Description |
---|---|
bool | Whether any statements were retracted. |
Remove(Uri)
Retracts statements with this subject and equivalent to predicate
.
Declaration
public bool Remove(Uri predicate)
Parameters
Type | Name | Description |
---|---|---|
Uri | predicate | The predicate to retract. |
Returns
Type | Description |
---|---|
bool | Whether any statements were retracted. |
Remove(Uri, object)
Retracts statements with this subject, predicate equivalent to predicate
and objects equivalent to objects
.
Declaration
public bool Remove(Uri predicate, object objects)
Parameters
Type | Name | Description |
---|---|---|
Uri | predicate | The predicate to retract. |
object | objects | An object with public properties or a dictionary representing predicates and objects to retract. |
Returns
Type | Description |
---|---|
bool | Whether any statements were retracted. |
Remove(INode)
Retracts statements with this subject and predicate
.
Declaration
public bool Remove(INode predicate)
Parameters
Type | Name | Description |
---|---|---|
INode | predicate | The predicate to retract. |
Returns
Type | Description |
---|---|
bool | Whether any statements were retracted. |
Remove(INode, object)
Retracts statements with this subject, predicate
and objects equivalent to objects
.
Declaration
public bool Remove(INode predicate, object objects)
Parameters
Type | Name | Description |
---|---|---|
INode | predicate | The predicate to retract. |
object | objects | An object with public properties or a dictionary representing predicates and objects to retract. |
Returns
Type | Description |
---|---|
bool | Whether any statements were retracted. |
TryGetValue(string, out object)
Tries to get an object collection.
Declaration
public bool TryGetValue(string predicate, out object value)
Parameters
Type | Name | Description |
---|---|---|
string | predicate | The predicate to try. |
object | value |
Returns
Type | Description |
---|---|
bool | A value representing whether a |
TryGetValue(Uri, out object)
Tries to get an object collection.
Declaration
public bool TryGetValue(Uri predicate, out object value)
Parameters
Type | Name | Description |
---|---|---|
Uri | predicate | The predicate to try. |
object | value |
Returns
Type | Description |
---|---|
bool | A value representing whether a |
TryGetValue(INode, out object)
Tries to get an object collection.
Declaration
public bool TryGetValue(INode predicate, out object value)
Parameters
Type | Name | Description |
---|---|---|
INode | predicate | The predicate to try. |
object | value |
Returns
Type | Description |
---|---|
bool | A value representing whether a |