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
| Improve this Doc 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. |
System.Uri | subjectBaseUri | The System.Uri used for resolving relative subject references. |
System.Uri | predicateBaseUri | The System.Uri used for resolving relative predicate references. |
Properties
| Improve this Doc 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 |
---|---|
System.Boolean |
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 |
---|---|
System.Object | A DynamicNode wrapped around the |
Exceptions
Type | Condition |
---|---|
System.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 |
---|---|---|
System.Uri | node | The node to wrap dynamically. |
Property Value
Type | Description |
---|---|
System.Object | A DynamicNode wrapped around the |
Exceptions
Type | Condition |
---|---|
System.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 |
---|---|
System.Object | A DynamicNode wrapped around the |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | When |
Keys
Gets an System.Collections.Generic.ICollection<T> containing Uri subject node names shortened as much as possible.
Declaration
public ICollection<string> Keys { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<T><string> |
PredicateBaseUri
Gets the URI used for resolving relative predicate references.
Declaration
public Uri PredicateBaseUri { get; }
Property Value
Type | Description |
---|---|
System.Uri |
SubjectBaseUri
Gets the System.Uri used for resolving relative subject references.
Declaration
public Uri SubjectBaseUri { get; }
Property Value
Type | Description |
---|---|
System.Uri |
Values
Gets a collection of DynamicNodes representing URI nodes in this graph.
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 equivalent to the parameters.
Declaration
public void Add(string subject, object predicateAndObjects)
Parameters
Type | Name | Description |
---|---|---|
string | subject | The subject to assert. |
System.Object | predicateAndObjects | An object with public properties or a dictionary representing predicates and objects to assert. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | When |
Add(Uri, object)
Asserts statements equivalent to the parameters.
Declaration
public void Add(Uri subject, object predicateAndObjects)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | subject | The subject to assert. |
System.Object | predicateAndObjects | An object with public properties or a dictionary representing predicates and objects to assert. |
Exceptions
Type | Condition |
---|---|
System.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. |
System.Object | predicateAndObjects | An object with public properties or a dictionary representing predicates and objects to assert. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | When |
System.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. |
System.Object | predicateAndObjects | An object with public properties or a dictionary representing predicates and objects to check. |
Returns
Type | Description |
---|---|
System.Boolean | 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 |
---|---|---|
System.Uri | subject | The subject to check. |
System.Object | predicateAndObjects | An object with public properties or a dictionary representing predicates and objects to check. |
Returns
Type | Description |
---|---|
System.Boolean | 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. |
System.Object | predicateAndObjects | An object with public properties or a dictionary representing predicates and objects to check. |
Returns
Type | Description |
---|---|
System.Boolean | Whether statements exist equivalent to the parameters. |
Exceptions
Type | Condition |
---|---|
System.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 |
---|---|
System.Boolean | 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 |
---|---|---|
System.Uri | key | The node to check. |
Returns
Type | Description |
---|---|
System.Boolean | 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 |
---|---|
System.Boolean | Whether a URI node equal to |
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. |
System.Object | predicateAndObjects | 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 subject
.
Declaration
public bool Remove(string subject)
Parameters
Type | Name | Description |
---|---|---|
string | subject | The subject to retract. |
Returns
Type | Description |
---|---|
System.Boolean | Whether any statements were retracted. |
Remove(Uri, object)
Retracts statements equivalent to parameters.
Declaration
public bool Remove(Uri subject, object predicateAndObjects)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | subject | The subject to retract. |
System.Object | predicateAndObjects | 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 subject
.
Declaration
public bool Remove(Uri subject)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | subject | The subject to retract. |
Returns
Type | Description |
---|---|
System.Boolean | Whether any statements were retracted. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | When |
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. |
System.Object | predicateAndObjects | 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 subject
.
Declaration
public bool Remove(INode subject)
Parameters
Type | Name | Description |
---|---|---|
INode | subject | The subject to retract. |
Returns
Type | Description |
---|---|
System.Boolean | 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. |
System.Object | value | A DynamicNode wrapped around the |
Returns
Type | Description |
---|---|
System.Boolean | 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 |
---|---|---|
System.Uri | node | The node to try. |
System.Object | value | A DynamicNode wrapped around the |
Returns
Type | Description |
---|---|
System.Boolean | 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. |
System.Object | value | A DynamicNode wrapped around the |
Returns
Type | Description |
---|---|
System.Boolean | A value representing whether a |