Show / Hide Table of Contents

Class DynamicGraph

A wrapper that provides read/write dictionary and dynamic functionality.

Inheritance
object
WrapperGraph
DynamicGraph
Implements
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
Inherited Members
WrapperGraph._g
WrapperGraph.BaseUri
WrapperGraph.Name
WrapperGraph.IsEmpty
WrapperGraph.NamespaceMap
WrapperGraph.UriFactory
WrapperGraph.LanguageTagValidation
WrapperGraph.Nodes
WrapperGraph.AllNodes
WrapperGraph.Triples
WrapperGraph.QuotedTriples
WrapperGraph.QuotedNodes
WrapperGraph.AllQuotedNodes
WrapperGraph.Assert(Triple)
WrapperGraph.Assert(IEnumerable<Triple>)
WrapperGraph.Retract(Triple)
WrapperGraph.Retract(IEnumerable<Triple>)
WrapperGraph.Clear()
WrapperGraph.NormalizeLiteralValues
WrapperGraph.CreateBlankNode(string)
WrapperGraph.CreateBlankNode()
WrapperGraph.GetNextBlankNodeID()
WrapperGraph.CreateGraphLiteralNode(IGraph)
WrapperGraph.CreateGraphLiteralNode()
WrapperGraph.CreateLiteralNode(string)
WrapperGraph.CreateLiteralNode(string, Uri)
WrapperGraph.CreateLiteralNode(string, string)
WrapperGraph.CreateUriNode()
WrapperGraph.CreateUriNode(string)
WrapperGraph.CreateUriNode(Uri)
WrapperGraph.CreateVariableNode(string)
WrapperGraph.CreateTripleNode(Triple)
WrapperGraph.GetBlankNode(string)
WrapperGraph.GetLiteralNode(string, string)
WrapperGraph.GetLiteralNode(string)
WrapperGraph.GetLiteralNode(string, Uri)
WrapperGraph.GetTripleNode(Triple)
WrapperGraph.GetTriples(Uri)
WrapperGraph.GetTriples(INode)
WrapperGraph.GetTriplesWithObject(Uri)
WrapperGraph.GetTriplesWithObject(INode)
WrapperGraph.GetTriplesWithPredicate(INode)
WrapperGraph.GetTriplesWithPredicate(Uri)
WrapperGraph.GetTriplesWithSubject(INode)
WrapperGraph.GetTriplesWithSubject(Uri)
WrapperGraph.GetTriplesWithSubjectPredicate(INode, INode)
WrapperGraph.GetTriplesWithSubjectObject(INode, INode)
WrapperGraph.GetTriplesWithPredicateObject(INode, INode)
WrapperGraph.GetQuoted(Uri)
WrapperGraph.GetQuoted(INode)
WrapperGraph.GetQuotedWithObject(Uri)
WrapperGraph.GetQuotedWithObject(INode)
WrapperGraph.GetQuotedWithPredicate(INode)
WrapperGraph.GetQuotedWithPredicate(Uri)
WrapperGraph.GetQuotedWithSubject(INode)
WrapperGraph.GetQuotedWithSubject(Uri)
WrapperGraph.GetQuotedWithSubjectPredicate(INode, INode)
WrapperGraph.GetQuotedWithSubjectObject(INode, INode)
WrapperGraph.GetQuotedWithPredicateObject(INode, INode)
WrapperGraph.GetUriNode(string)
WrapperGraph.GetUriNode(Uri)
WrapperGraph.ContainsTriple(Triple)
WrapperGraph.ContainsQuotedTriple(Triple)
WrapperGraph.Merge(IGraph)
WrapperGraph.Merge(IGraph, bool)
WrapperGraph.Equals(IGraph)
WrapperGraph.Equals(IGraph, out Dictionary<INode, INode>)
WrapperGraph.IsSubGraphOf(IGraph)
WrapperGraph.IsSubGraphOf(IGraph, out Dictionary<INode, INode>)
WrapperGraph.HasSubGraph(IGraph)
WrapperGraph.HasSubGraph(IGraph, out Dictionary<INode, INode>)
WrapperGraph.Difference(IGraph)
WrapperGraph.Unstar()
WrapperGraph.ResolveQName(string)
WrapperGraph.TripleAsserted
WrapperGraph.TripleRetracted
WrapperGraph.Changed
WrapperGraph.ClearRequested
WrapperGraph.Cleared
WrapperGraph.MergeRequested
WrapperGraph.Merged
WrapperGraph.OnTripleAsserted(object, TripleEventArgs)
WrapperGraph.RaiseTripleAsserted(TripleEventArgs)
WrapperGraph.RaiseTripleAsserted(Triple)
WrapperGraph.OnTripleRetracted(object, TripleEventArgs)
WrapperGraph.RaiseTripleRetracted(TripleEventArgs)
WrapperGraph.RaiseTripleRetracted(Triple)
WrapperGraph.OnChanged(object, GraphEventArgs)
WrapperGraph.RaiseGraphChanged(TripleEventArgs)
WrapperGraph.RaiseGraphChanged()
WrapperGraph.OnClearRequested(object, CancellableGraphEventArgs)
WrapperGraph.RaiseClearRequested(CancellableGraphEventArgs)
WrapperGraph.OnCleared(object, GraphEventArgs)
WrapperGraph.RaiseCleared()
WrapperGraph.OnMergeRequested(object, CancellableGraphEventArgs)
WrapperGraph.RaiseMergeRequested(CancellableGraphEventArgs)
WrapperGraph.OnMerged(object, GraphEventArgs)
WrapperGraph.RaiseMerged()
WrapperGraph.AttachEventHandlers()
WrapperGraph.Dispose()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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 Source

DynamicGraph(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 Source

Count

Gets the number of URI nodes in this graph.

Declaration
public int Count { get; }
Property Value
Type Description
int
| Edit this page View Source

IsReadOnly

Gets a value indicating whether this graph dictionary is read only (always false).

Declaration
public bool IsReadOnly { get; }
Property Value
Type Description
bool
| Edit this page View Source

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 node.

Exceptions
Type Condition
ArgumentNullException

When node is null.

| Edit this page View Source

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 node.

Exceptions
Type Condition
ArgumentNullException

When node is null.

| Edit this page View Source

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 node.

Exceptions
Type Condition
ArgumentNullException

When node is null.

| Edit this page View Source

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>
| Edit this page View Source

PredicateBaseUri

Gets the URI used for resolving relative predicate references.

Declaration
public Uri PredicateBaseUri { get; }
Property Value
Type Description
Uri
| Edit this page View Source

SubjectBaseUri

Gets the Uri used for resolving relative subject references.

Declaration
public Uri SubjectBaseUri { get; }
Property Value
Type Description
Uri
| Edit this page View Source

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 Source

Add(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 subject or predicateAndObjects is null.

| Edit this page View Source

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 subject.

| Edit this page View Source

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 subject or predicateAndObjects is null.

InvalidOperationException

When predicateAndObjects is a dictionary with keys other than INode, Uri or string.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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 predicateAndObjects is a dictionary with keys other than INode, Uri or string.

| Edit this page View Source

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 key exists.

| Edit this page View Source

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 key exists.

| Edit this page View Source

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 key exists.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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 subject is null.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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 node.

Returns
Type Description
bool

A value representing whether a value was set or not.

| Edit this page View Source

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 node.

Returns
Type Description
bool

A value representing whether a value was set or not.

| Edit this page View Source

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 node.

Returns
Type Description
bool

A value representing whether a value was set or not.

Implements

IGraph
INodeFactory
IDisposable
ITripleIndex
IEquatable<T>
IDynamicMetaObjectProvider
IDictionary<TKey, TValue>
ICollection<T>
IEnumerable<T>
IDictionary<TKey, TValue>
ICollection<T>
IEnumerable<T>
IDictionary<TKey, TValue>
ICollection<T>
IEnumerable<T>
IEnumerable

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
GraphExtensions.ToDataTable(IGraph)
DynamicExtensions.AsDynamic(IGraph, Uri, Uri)
Extensions.AddToList(IGraph, INode, IEnumerable<INode>)
Extensions.AddToList<T>(IGraph, INode, IEnumerable<T>, Func<T, INode>)
Extensions.Assert(IGraph, INode, INode, INode)
Extensions.AssertList(IGraph, IEnumerable<INode>)
Extensions.AssertList(IGraph, INode, IEnumerable<INode>)
Extensions.AssertList<T>(IGraph, IEnumerable<T>, Func<T, INode>)
Extensions.AssertList<T>(IGraph, INode, IEnumerable<T>, Func<T, INode>)
Extensions.GetListAsTriples(IGraph, INode)
Extensions.GetListItems(IGraph, INode)
Extensions.GetListNodes(IGraph, INode)
Extensions.RemoveFromList(IGraph, INode, IEnumerable<INode>)
Extensions.RemoveFromList<T>(IGraph, INode, IEnumerable<T>, Func<T, INode>)
Extensions.Retract(IGraph, INode, INode, INode)
Extensions.RetractList(IGraph, INode)
GraphExtensions.GetETag(IGraph)
GraphExtensions.LoadFromEmbeddedResource(IGraph, string)
GraphExtensions.LoadFromEmbeddedResource(IGraph, string, IRdfReader)
GraphExtensions.LoadFromFile(IGraph, string)
GraphExtensions.LoadFromFile(IGraph, string, IRdfReader)
GraphExtensions.LoadFromString(IGraph, string)
GraphExtensions.LoadFromString(IGraph, string, IRdfReader)
GraphExtensions.LoadFromUri(IGraph, Uri, IRdfReader, Loader)
GraphExtensions.LoadFromUri(IGraph, Uri, Loader)
GraphExtensions.SaveToFile(IGraph, string)
GraphExtensions.SaveToFile(IGraph, string, IRdfWriter)
GraphExtensions.SaveToFile(IGraph, string, IStoreWriter)
GraphExtensions.SaveToStream(IGraph, TextWriter, IRdfWriter)
GraphExtensions.SaveToStream(IGraph, TextWriter, IStoreWriter)
GraphExtensions.SaveToStream(IGraph, string, TextWriter)
InMemoryExtensions.ExecuteQuery(IGraph, string)
InMemoryExtensions.ExecuteQuery(IGraph, IRdfHandler, ISparqlResultsHandler, string)
InMemoryExtensions.ExecuteQuery(IGraph, IRdfHandler, ISparqlResultsHandler, SparqlParameterizedString)
InMemoryExtensions.ExecuteQuery(IGraph, IRdfHandler, ISparqlResultsHandler, SparqlQuery)
InMemoryExtensions.ExecuteQuery(IGraph, SparqlParameterizedString)
InMemoryExtensions.ExecuteQuery(IGraph, SparqlQuery)
  • Edit this page
  • View Source
In this article
  • Constructors
    • DynamicGraph(IGraph, Uri, Uri)
  • Properties
    • Count
    • IsReadOnly
    • this[string]
    • this[Uri]
    • this[INode]
    • Keys
    • PredicateBaseUri
    • SubjectBaseUri
    • Values
  • Methods
    • Add(string, object)
    • Add(Uri, object)
    • Add(INode, object)
    • Contains(string, object)
    • Contains(Uri, object)
    • Contains(INode, object)
    • ContainsKey(string)
    • ContainsKey(Uri)
    • ContainsKey(INode)
    • Remove(string)
    • Remove(string, object)
    • Remove(Uri)
    • Remove(Uri, object)
    • Remove(INode)
    • Remove(INode, object)
    • TryGetValue(string, out object)
    • TryGetValue(Uri, out object)
    • TryGetValue(INode, out object)
  • Implements
  • Extension Methods
Back to top Generated by DocFX