Class DynamicGraph
A wrapper that provides read/write dictionary and dynamic functionality.
Implements
Inherited Members
Namespace: VDS.RDF.Dynamic
Assembly: dotNetRdf.Dynamic.dll
Syntax
public class DynamicGraph : WrapperGraph, IGraph, INodeFactory, IDisposable, ITripleIndex, IEquatable<IGraph>, 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 SourceDynamicGraph(IGraph, Uri, Uri)
Initializes a new instance of the DynamicGraph class.
Declaration
public DynamicGraph(IGraph graph = null, Uri subjectBaseUri = null, Uri predicateBaseUri = null)
Parameters
Type | Name | Description |
---|---|---|
IGraph | graph | The IGraph to wrap. |
Uri | subjectBaseUri | The Uri used for resolving relative subject references. |
Uri | predicateBaseUri | The Uri used for resolving relative predicate references. |
Properties
| Edit this page View SourceCount
Gets the number of URI nodes in this graph.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
IsReadOnly
Gets a value indicating whether this graph dictionary is read only (always false).
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
bool |
this[string]
Gets nodes equivalent to node
or sets statements with subject equivalent to node
and predicate and objects equivalent to value
.
Declaration
public object this[string node] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
string | node | The node to wrap dynamically. |
Property Value
Type | Description |
---|---|
object | A DynamicNode wrapped around the |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
this[Uri]
Gets nodes equivalent to node
or sets statements with subject equivalent to node
and predicate and objects equivalent to value
.
Declaration
public object this[Uri node] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Uri | node | The node to wrap dynamically. |
Property Value
Type | Description |
---|---|
object | A DynamicNode wrapped around the |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
this[INode]
Gets nodes equal to node
or sets statements with subject equal to node
and predicate and objects equivalent to value
.
Declaration
public object this[INode node] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
INode | node | The node to wrap dynamically. |
Property Value
Type | Description |
---|---|
object | A DynamicNode wrapped around the |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
Keys
Gets an ICollection<T> containing Uri subject node names shortened as much as possible.
Declaration
public ICollection<string> Keys { get; }
Property Value
Type | Description |
---|---|
ICollection<string> |
PredicateBaseUri
Gets the URI used for resolving relative predicate references.
Declaration
public Uri PredicateBaseUri { get; }
Property Value
Type | Description |
---|---|
Uri |
SubjectBaseUri
Gets the Uri used for resolving relative subject references.
Declaration
public Uri SubjectBaseUri { get; }
Property Value
Type | Description |
---|---|
Uri |
Values
Gets a collection of DynamicNodes representing URI nodes in this graph.
Declaration
public ICollection<object> Values { get; }
Property Value
Type | Description |
---|---|
ICollection<object> |
Methods
| Edit this page View SourceAdd(string, object)
Asserts statements equivalent to the parameters.
Declaration
public void Add(string subject, object predicateAndObjects)
Parameters
Type | Name | Description |
---|---|---|
string | subject | The subject to assert. |
object | predicateAndObjects | An object with public properties or a dictionary representing predicates and objects to assert. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
Add(Uri, object)
Asserts statements equivalent to the parameters.
Declaration
public void Add(Uri subject, object predicateAndObjects)
Parameters
Type | Name | Description |
---|---|---|
Uri | subject | The subject to assert. |
object | predicateAndObjects | An object with public properties or a dictionary representing predicates and objects to assert. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
Add(INode, object)
Asserts statements equivalent to the parameters.
Declaration
public void Add(INode subject, object predicateAndObjects)
Parameters
Type | Name | Description |
---|---|---|
INode | subject | The subject to assert. |
object | predicateAndObjects | An object with public properties or a dictionary representing predicates and objects to assert. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
InvalidOperationException | When |
Contains(string, object)
Checks whether statements exist equivalent to the parameters.
Declaration
public bool Contains(string subject, object predicateAndObjects)
Parameters
Type | Name | Description |
---|---|---|
string | subject | The subject to check. |
object | predicateAndObjects | An object with public properties or a dictionary representing predicates and objects to check. |
Returns
Type | Description |
---|---|
bool | Whether statements exist equivalent to the parameters. |
Contains(Uri, object)
Checks whether statements exist equivalent to the parameters.
Declaration
public bool Contains(Uri subject, object predicateAndObjects)
Parameters
Type | Name | Description |
---|---|---|
Uri | subject | The subject to check. |
object | predicateAndObjects | An object with public properties or a dictionary representing predicates and objects to check. |
Returns
Type | Description |
---|---|
bool | Whether statements exist equivalent to the parameters. |
Contains(INode, object)
Checks whether statements exist equivalent to the parameters.
Declaration
public bool Contains(INode subject, object predicateAndObjects)
Parameters
Type | Name | Description |
---|---|---|
INode | subject | The subject to check. |
object | predicateAndObjects | An object with public properties or a dictionary representing predicates and objects to check. |
Returns
Type | Description |
---|---|
bool | Whether statements exist equivalent to the parameters. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | When |
ContainsKey(string)
Checks whether a URI node equivalent to key
exists.
Declaration
public bool ContainsKey(string key)
Parameters
Type | Name | Description |
---|---|---|
string | key | The node to check. |
Returns
Type | Description |
---|---|
bool | Whether a URI node equivalent to |
ContainsKey(Uri)
Checks whether a URI node equivalent to key
exists.
Declaration
public bool ContainsKey(Uri key)
Parameters
Type | Name | Description |
---|---|---|
Uri | key | The node to check. |
Returns
Type | Description |
---|---|
bool | Whether a URI node equivalent to |
ContainsKey(INode)
Checks whether a URI node equal to key
exists.
Declaration
public bool ContainsKey(INode key)
Parameters
Type | Name | Description |
---|---|---|
INode | key | The node to check. |
Returns
Type | Description |
---|---|
bool | Whether a URI node equal to |
Remove(string)
Retracts statements with subject
.
Declaration
public bool Remove(string subject)
Parameters
Type | Name | Description |
---|---|---|
string | subject | The subject to retract. |
Returns
Type | Description |
---|---|
bool | Whether any statements were retracted. |
Remove(string, object)
Retracts statements equivalent to the parameters.
Declaration
public bool Remove(string subject, object predicateAndObjects)
Parameters
Type | Name | Description |
---|---|---|
string | subject | The subject to retract. |
object | predicateAndObjects | 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 subject
.
Declaration
public bool Remove(Uri subject)
Parameters
Type | Name | Description |
---|---|---|
Uri | subject | The subject to retract. |
Returns
Type | Description |
---|---|
bool | Whether any statements were retracted. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
Remove(Uri, object)
Retracts statements equivalent to parameters.
Declaration
public bool Remove(Uri subject, object predicateAndObjects)
Parameters
Type | Name | Description |
---|---|---|
Uri | subject | The subject to retract. |
object | predicateAndObjects | 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 subject
.
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. |
Remove(INode, object)
Retracts statements equivalent to the parameters.
Declaration
public bool Remove(INode subject, object predicateAndObjects)
Parameters
Type | Name | Description |
---|---|---|
INode | subject | The subject to retract. |
object | predicateAndObjects | 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 a node from the graph.
Declaration
public bool TryGetValue(string node, out object value)
Parameters
Type | Name | Description |
---|---|---|
string | node | The node to try. |
object | value | A DynamicNode wrapped around the |
Returns
Type | Description |
---|---|
bool | A value representing whether a |
TryGetValue(Uri, out object)
Tries to get a node from the graph.
Declaration
public bool TryGetValue(Uri node, out object value)
Parameters
Type | Name | Description |
---|---|---|
Uri | node | The node to try. |
object | value | A DynamicNode wrapped around the |
Returns
Type | Description |
---|---|
bool | A value representing whether a |
TryGetValue(INode, out object)
Tries to get a node from the graph.
Declaration
public bool TryGetValue(INode node, out object value)
Parameters
Type | Name | Description |
---|---|---|
INode | node | The node to try. |
object | value | A DynamicNode wrapped around the |
Returns
Type | Description |
---|---|
bool | A value representing whether a |