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
| Improve this Doc 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. |
System.Uri | baseUri | The URI used to resolve relative predicate references. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | When |
Properties
| Improve this Doc View SourceBaseUri
Gets the URI used to resolve relative predicate references.
Declaration
public Uri BaseUri { get; }
Property Value
Type | Description |
---|---|
System.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 |
---|---|
System.Boolean |
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 |
---|---|
System.Object | A DynamicObjectCollection with this subject and |
Exceptions
Type | Condition |
---|---|
System.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 |
---|---|---|
System.Uri | predicate | The predicate to use. |
Property Value
Type | Description |
---|---|
System.Object | A DynamicObjectCollection with this subject and |
Exceptions
Type | Condition |
---|---|
System.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 |
---|---|
System.Object | A DynamicObjectCollection with this subject and |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | When |
Keys
Gets an System.Collections.Generic.ICollection<T> containing outgoing predicate node names shortened as much as possible.
Declaration
public ICollection<string> Keys { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<T><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 |
---|---|
System.Collections.Generic.ICollection<T><System.Object> |
Methods
| Improve this Doc 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. |
System.Object | objects | An object or enumerable representing objects to assert. |
Exceptions
Type | Condition |
---|---|
System.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 |
---|---|---|
System.Uri | predicate | The predicate to assert. |
System.Object | objects | An object or enumerable representing objects to assert. |
Exceptions
Type | Condition |
---|---|
System.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. |
System.Object | objects | An object or enumerable representing objects to assert. |
Exceptions
Type | Condition |
---|---|
System.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. |
System.Object | objects | An object or enumerable representing objects to assert. |
Returns
Type | Description |
---|---|
System.Boolean | 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 |
---|---|---|
System.Uri | predicate | The predicate to assert. |
System.Object | objects | An object or enumerable representing objects to assert. |
Returns
Type | Description |
---|---|
System.Boolean | 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. |
System.Object | objects | An object or enumerable representing objects to assert. |
Returns
Type | Description |
---|---|
System.Boolean | 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 |
---|---|
System.Boolean | 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 |
---|---|---|
System.Uri | key | The node to check. |
Returns
Type | Description |
---|---|
System.Boolean | 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 |
---|---|
System.Boolean | Whether this node has an outgoing predicate equal to |
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. |
System.Object | objects | An object with public properties or a dictionary representing predicates and objects to retract. |
Returns
Type | Description |
---|---|
System.Boolean | Whether any statements were retracted. |
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 |
---|---|
System.Boolean | 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 |
---|---|---|
System.Uri | predicate | The predicate to retract. |
System.Object | objects | An object with public properties or a dictionary representing predicates and objects to retract. |
Returns
Type | Description |
---|---|
System.Boolean | 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 |
---|---|---|
System.Uri | predicate | The predicate to retract. |
Returns
Type | Description |
---|---|
System.Boolean | 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. |
System.Object | objects | An object with public properties or a dictionary representing predicates and objects to retract. |
Returns
Type | Description |
---|---|
System.Boolean | 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 |
---|---|
System.Boolean | 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. |
System.Object | value |
Returns
Type | Description |
---|---|
System.Boolean | 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 |
---|---|---|
System.Uri | predicate | The predicate to try. |
System.Object | value |
Returns
Type | Description |
---|---|
System.Boolean | 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. |
System.Object | value |
Returns
Type | Description |
---|---|
System.Boolean | A value representing whether a |