Show / Hide Table of Contents

Class WrapperGraph

Abstract decorator for Graphs to make it easier to layer functionality on top of existing implementations.

Inheritance
object
WrapperGraph
DynamicGraph
ShapesGraph
SkosGraph
Implements
IGraph
INodeFactory
IDisposable
ITripleIndex
IEquatable<IGraph>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public abstract class WrapperGraph : IGraph, INodeFactory, IDisposable, ITripleIndex, IEquatable<IGraph>

Constructors

| Edit this page View Source

WrapperGraph(IGraph)

Creates a new wrapper around the given Graph.

Declaration
protected WrapperGraph(IGraph g)
Parameters
Type Name Description
IGraph g

Graph.

| Edit this page View Source

WrapperGraph(IRefNode)

Creates a wrapper around the default Graph implementation, primarily required only for deserialization and requires that the caller call AttachEventHandlers() to properly wire up event handling.

Declaration
protected WrapperGraph(IRefNode graphName = null)
Parameters
Type Name Description
IRefNode graphName

The name to assign to the new graph.

Fields

| Edit this page View Source

_g

Underlying Graph this is a wrapper around.

Declaration
protected readonly IGraph _g
Field Value
Type Description
IGraph

Properties

| Edit this page View Source

AllNodes

Gets the unique Subject, Predicate and Object nodes of the asserted triples in the Graph.

Declaration
public virtual IEnumerable<INode> AllNodes { get; }
Property Value
Type Description
IEnumerable<INode>
| Edit this page View Source

AllQuotedNodes

Gets the unique subject, predicate and object nodes of the quoted triples in the graph.

Declaration
public IEnumerable<INode> AllQuotedNodes { get; }
Property Value
Type Description
IEnumerable<INode>
| Edit this page View Source

BaseUri

Gets/Sets the Base URI of the Graph.

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

IsEmpty

Gets whether the Graph is empty.

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

LanguageTagValidation

Get or set the type of validation to apply to language tags when creating language-tagged literal nodes.

Declaration
public LanguageTagValidationMode LanguageTagValidation { get; set; }
Property Value
Type Description
LanguageTagValidationMode
| Edit this page View Source

Name

Gets the name of the graph.

Declaration
public virtual IRefNode Name { get; }
Property Value
Type Description
IRefNode
| Edit this page View Source

NamespaceMap

Gets the Namespace Map for the Graph.

Declaration
public virtual INamespaceMapper NamespaceMap { get; }
Property Value
Type Description
INamespaceMapper
| Edit this page View Source

Nodes

Gets the unique Subject and Object nodes of the Graph.

Declaration
public virtual IEnumerable<INode> Nodes { get; }
Property Value
Type Description
IEnumerable<INode>
Remarks

This property returns only nodes that appear in the Subject or Object position in asserted triples. To retrieve a list of all INode instances in a graph including those in Predicate position in a triple, use the AllNodes property.

| Edit this page View Source

NormalizeLiteralValues

Get or set whether to normalize literal values on creation.

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

QuotedNodes

Gets the unique subject and object nodes of the quoted triples in the graph.

Declaration
public IEnumerable<INode> QuotedNodes { get; }
Property Value
Type Description
IEnumerable<INode>
| Edit this page View Source

QuotedTriples

Gets the quoted triples in the graph.

Declaration
public virtual IEnumerable<Triple> QuotedTriples { get; }
Property Value
Type Description
IEnumerable<Triple>
| Edit this page View Source

Triples

Gets the Triple Collection for the Graph.

Declaration
public virtual BaseTripleCollection Triples { get; }
Property Value
Type Description
BaseTripleCollection
| Edit this page View Source

UriFactory

Get or set the factory to use when creating URIs.

Declaration
public IUriFactory UriFactory { get; set; }
Property Value
Type Description
IUriFactory

Methods

| Edit this page View Source

Assert(IEnumerable<Triple>)

Asserts Triples in the Graph.

Declaration
public virtual bool Assert(IEnumerable<Triple> ts)
Parameters
Type Name Description
IEnumerable<Triple> ts

Triples.

Returns
Type Description
bool
| Edit this page View Source

Assert(Triple)

Asserts a Triple in the Graph.

Declaration
public virtual bool Assert(Triple t)
Parameters
Type Name Description
Triple t

Triple.

Returns
Type Description
bool
| Edit this page View Source

AttachEventHandlers()

Helper method for attaching the necessary event handlers to the underlying graph.

Declaration
protected void AttachEventHandlers()
| Edit this page View Source

Clear()

Clears the Graph.

Declaration
public virtual void Clear()
| Edit this page View Source

ContainsQuotedTriple(Triple)

Gets whether a given triple is quoted in this graph.

Declaration
public virtual bool ContainsQuotedTriple(Triple t)
Parameters
Type Name Description
Triple t

Triple to test.

Returns
Type Description
bool

True if the triple is quoted in this graph, false otherwise.

| Edit this page View Source

ContainsTriple(Triple)

Gets whether a given Triple is either quoted or asserted in this Graph.

Declaration
public virtual bool ContainsTriple(Triple t)
Parameters
Type Name Description
Triple t

Triple to test.

Returns
Type Description
bool
| Edit this page View Source

CreateBlankNode()

Creates a new Blank Node.

Declaration
public virtual IBlankNode CreateBlankNode()
Returns
Type Description
IBlankNode
| Edit this page View Source

CreateBlankNode(string)

Creates a new Blank Node with the given Node ID.

Declaration
public virtual IBlankNode CreateBlankNode(string nodeId)
Parameters
Type Name Description
string nodeId

Node ID.

Returns
Type Description
IBlankNode
| Edit this page View Source

CreateGraphLiteralNode()

Creates a new Graph Literal Node.

Declaration
public virtual IGraphLiteralNode CreateGraphLiteralNode()
Returns
Type Description
IGraphLiteralNode
| Edit this page View Source

CreateGraphLiteralNode(IGraph)

Creates a new Graph Literal Node with the given sub-graph.

Declaration
public virtual IGraphLiteralNode CreateGraphLiteralNode(IGraph subgraph)
Parameters
Type Name Description
IGraph subgraph

Sub-graph.

Returns
Type Description
IGraphLiteralNode
| Edit this page View Source

CreateLiteralNode(string)

Creates a new Literal Node.

Declaration
public virtual ILiteralNode CreateLiteralNode(string literal)
Parameters
Type Name Description
string literal

Value.

Returns
Type Description
ILiteralNode
| Edit this page View Source

CreateLiteralNode(string, string)

Creates a new Literal Node with the given Language.

Declaration
public virtual ILiteralNode CreateLiteralNode(string literal, string langSpec)
Parameters
Type Name Description
string literal

Value.

string langSpec

Language.

Returns
Type Description
ILiteralNode
| Edit this page View Source

CreateLiteralNode(string, Uri)

Creates a new Literal Node with the given Datatype.

Declaration
public virtual ILiteralNode CreateLiteralNode(string literal, Uri datatype)
Parameters
Type Name Description
string literal

Value.

Uri datatype

Datatype URI.

Returns
Type Description
ILiteralNode
| Edit this page View Source

CreateTripleNode(Triple)

Creates a node that quotes the given triple.

Declaration
public virtual ITripleNode CreateTripleNode(Triple triple)
Parameters
Type Name Description
Triple triple

The triple to be the quoted value of the created node.

Returns
Type Description
ITripleNode
| Edit this page View Source

CreateUriNode()

Creates a new URI Node that references the Graphs Base URI.

Declaration
public virtual IUriNode CreateUriNode()
Returns
Type Description
IUriNode
| Edit this page View Source

CreateUriNode(string)

Creates a new URI Node from a QName.

Declaration
public virtual IUriNode CreateUriNode(string qName)
Parameters
Type Name Description
string qName

QName.

Returns
Type Description
IUriNode
| Edit this page View Source

CreateUriNode(Uri)

Creates a new URI Node.

Declaration
public virtual IUriNode CreateUriNode(Uri uri)
Parameters
Type Name Description
Uri uri

URI.

Returns
Type Description
IUriNode
| Edit this page View Source

CreateVariableNode(string)

Creates a new Variable Node.

Declaration
public virtual IVariableNode CreateVariableNode(string varName)
Parameters
Type Name Description
string varName

Variable Name.

Returns
Type Description
IVariableNode
| Edit this page View Source

Difference(IGraph)

Computes the Difference between this Graph the given Graph.

Declaration
public virtual GraphDiffReport Difference(IGraph g)
Parameters
Type Name Description
IGraph g

Graph.

Returns
Type Description
GraphDiffReport
Remarks

Produces a report which shows the changes that must be made to this Graph to produce the given Graph.

| Edit this page View Source

Dispose()

Disposes of the wrapper and in doing so disposes of the underlying graph.

Declaration
public virtual void Dispose()
| Edit this page View Source

Equals(IGraph)

Determines whether this graph is equal to another graph.

Declaration
public bool Equals(IGraph other)
Parameters
Type Name Description
IGraph other

Graph to test.

Returns
Type Description
bool
| Edit this page View Source

Equals(IGraph, out Dictionary<INode, INode>)

Determines whether this Graph is equal to the given Graph.

Declaration
public virtual bool Equals(IGraph g, out Dictionary<INode, INode> mapping)
Parameters
Type Name Description
IGraph g

Graph to test for equality.

Dictionary<INode, INode> mapping

Mapping of Blank Nodes iff the Graphs are equal and contain some Blank Nodes.

Returns
Type Description
bool
Remarks

The algorithm used to determine Graph equality is based in part on a Iterative Vertex Classification Algorithm described in a Technical Report from HP by Jeremy J Carroll -. Matching RDF Graphs

Graph Equality is determined according to the following algorithm:.

  1. If the given Graph is null Graphs are not equal
  2. If the given Graph is this Graph (as determined by Reference Equality) then Graphs are equal
  3. If the Graphs have a different number of Triples they are not equal
  4. Declare a list of Triples which are the Triples of the given Graph called OtherTriples
  5. Declare two dictionaries of Nodes to Integers which are called LocalClassification and OtherClassification
  6. For Each Triple in this Graph
    1. If it is a Ground Triple and cannot be found and removed from OtherTriples then Graphs are not equal since the Triple does not exist in both Graphs
    2. If it contains Blank Nodes track the number of usages of this Blank Node in LocalClassification
  7. If there are any Triples remaining in OtherTriples which are Ground Triples then Graphs are not equal since this Graph does not contain them
  8. If all the Triples from both Graphs were Ground Triples and there were no Blank Nodes then the Graphs are equal
  9. Iterate over the remaining Triples in OtherTriples and populate the OtherClassification
  10. If the count of the two classifications is different the Graphs are not equal since there are differing numbers of Blank Nodes in the Graph
  11. Now build two additional dictionaries of Integers to Integers which are called LocalDegreeClassification and OtherDegreeClassification. Iterate over LocalClassification and OtherClassification such that the corresponding degree classifications contain a mapping of the number of Blank Nodes with a given degree
  12. If the count of the two degree classifications is different the Graphs are not equal since there are not the same range of Blank Node degrees in both Graphs
  13. For All classifications in LocalDegreeClassification there must be a matching classification in OtherDegreeClassification else the Graphs are not equal
  14. Then build a possible mapping using the following rules:
    1. Any Blank Node used only once should be mapped to an equivalent Blank Node in the other Graph. If this is not possible then the Graphs are not equal
    2. Any Blank Node with a unique degree should be mapped to an equivalent Blank Node in the other Graph. If this is not possible then the Graphs are not equal
    3. Keep a copy of the mapping up to this point as a Base Mapping for use as a fallback in later steps
    4. Build up lists of dependent pairs of Blank Nodes for both Graphs
    5. Use these lists to determine if there are any independent nodes not yet mapped. These should be mapped to equivalent Blank Nodes in the other Graph, if this is not possible the Graphs are not equal
    6. Use the Dependencies and existing mappings to generate a possible mapping
    7. If a Complete Possible Mapping (there is a Mapping for each Blank Node from this Graph to the Other Graph) then test this mapping. If it succeeds then the Graphs are equal
    8. Otherwise we now fallback to the Base Mapping and use it as a basis for Brute Forcing the possible solution space and testing every possibility until either a mapping works or we find the Graphs to be non-equal
| Edit this page View Source

GetBlankNode(string)

Attempts to get the Blank Node with the given ID.

Declaration
public virtual IBlankNode GetBlankNode(string nodeId)
Parameters
Type Name Description
string nodeId

Node ID.

Returns
Type Description
IBlankNode

The Node if it exists or null.

| Edit this page View Source

GetLiteralNode(string)

Attempts to get the Literal Node with the given Value.

Declaration
public virtual ILiteralNode GetLiteralNode(string literal)
Parameters
Type Name Description
string literal

Value.

Returns
Type Description
ILiteralNode

The Node if it exists or null.

| Edit this page View Source

GetLiteralNode(string, string)

Attempts to get the Literal Node with the given Value and Language.

Declaration
public virtual ILiteralNode GetLiteralNode(string literal, string langspec)
Parameters
Type Name Description
string literal

Value.

string langspec

Language.

Returns
Type Description
ILiteralNode

The Node if it exists or null.

| Edit this page View Source

GetLiteralNode(string, Uri)

Attempts to get the Literal Node with the given Value and Datatype.

Declaration
public virtual ILiteralNode GetLiteralNode(string literal, Uri datatype)
Parameters
Type Name Description
string literal

Value.

Uri datatype

Datatype URI.

Returns
Type Description
ILiteralNode

The Node if it exists or null otherwise.

| Edit this page View Source

GetNextBlankNodeID()

Gets the next available Blank Node ID.

Declaration
public virtual string GetNextBlankNodeID()
Returns
Type Description
string
| Edit this page View Source

GetQuoted(Uri)

Selects all quoted triples which have a Uri Node with the given Uri.

Declaration
public IEnumerable<Triple> GetQuoted(Uri uri)
Parameters
Type Name Description
Uri uri

Uri.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

GetQuoted(INode)

Selects all quoted triples which contain the given Node.

Declaration
public IEnumerable<Triple> GetQuoted(INode n)
Parameters
Type Name Description
INode n

Node.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

GetQuotedWithObject(Uri)

Selects all quoted triples where the Object is a Uri Node with the given Uri.

Declaration
public IEnumerable<Triple> GetQuotedWithObject(Uri u)
Parameters
Type Name Description
Uri u

Uri.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

GetQuotedWithObject(INode)

Selects all quoted triples where the Object is a given Node.

Declaration
public IEnumerable<Triple> GetQuotedWithObject(INode n)
Parameters
Type Name Description
INode n

Node.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

GetQuotedWithPredicate(Uri)

Selects all quoted triples where the Predicate is a Uri Node with the given Uri.

Declaration
public IEnumerable<Triple> GetQuotedWithPredicate(Uri u)
Parameters
Type Name Description
Uri u

Uri.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

GetQuotedWithPredicate(INode)

Selects all quoted triples where the Predicate is a given Node.

Declaration
public IEnumerable<Triple> GetQuotedWithPredicate(INode n)
Parameters
Type Name Description
INode n

Node.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

GetQuotedWithPredicateObject(INode, INode)

Selects all quoted triples with the given Predicate and Object.

Declaration
public IEnumerable<Triple> GetQuotedWithPredicateObject(INode pred, INode obj)
Parameters
Type Name Description
INode pred

Predicate.

INode obj

Object.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

GetQuotedWithSubject(Uri)

Selects all quoted triples where the Subject is a Uri Node with the given Uri.

Declaration
public IEnumerable<Triple> GetQuotedWithSubject(Uri u)
Parameters
Type Name Description
Uri u

Uri.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

GetQuotedWithSubject(INode)

Selects all quoted triples where the Subject is a given Node.

Declaration
public IEnumerable<Triple> GetQuotedWithSubject(INode n)
Parameters
Type Name Description
INode n

Node.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

GetQuotedWithSubjectObject(INode, INode)

Selects all quoted triples with the given Subject and Object.

Declaration
public IEnumerable<Triple> GetQuotedWithSubjectObject(INode subj, INode obj)
Parameters
Type Name Description
INode subj

Subject.

INode obj

Object.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

GetQuotedWithSubjectPredicate(INode, INode)

Selects all quoted triples with the given Subject and Predicate.

Declaration
public IEnumerable<Triple> GetQuotedWithSubjectPredicate(INode subj, INode pred)
Parameters
Type Name Description
INode subj

Subject.

INode pred

Predicate.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

GetTripleNode(Triple)

Selects the Triple Node with the given Triple value if it exists in the graph.

Declaration
public virtual ITripleNode GetTripleNode(Triple triple)
Parameters
Type Name Description
Triple triple

Triple.

Returns
Type Description
ITripleNode

The triple node if it exists in the graph or else null.

| Edit this page View Source

GetTriples(Uri)

Gets all the Triples involving the given URI.

Declaration
public virtual IEnumerable<Triple> GetTriples(Uri uri)
Parameters
Type Name Description
Uri uri

The URI to find Triples involving.

Returns
Type Description
IEnumerable<Triple>

Zero/More Triples.

| Edit this page View Source

GetTriples(INode)

Gets all the Triples involving the given Node.

Declaration
public virtual IEnumerable<Triple> GetTriples(INode n)
Parameters
Type Name Description
INode n

The Node to find Triples involving.

Returns
Type Description
IEnumerable<Triple>

Zero/More Triples.

| Edit this page View Source

GetTriplesWithObject(Uri)

Gets all the Triples with the given URI as the Object.

Declaration
public virtual IEnumerable<Triple> GetTriplesWithObject(Uri u)
Parameters
Type Name Description
Uri u

The URI to find Triples with it as the Object.

Returns
Type Description
IEnumerable<Triple>

Zero/More Triples.

| Edit this page View Source

GetTriplesWithObject(INode)

Gets all the Triples with the given Node as the Object.

Declaration
public virtual IEnumerable<Triple> GetTriplesWithObject(INode n)
Parameters
Type Name Description
INode n

The Node to find Triples with it as the Object.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

GetTriplesWithPredicate(Uri)

Gets all the Triples with the given Uri as the Predicate.

Declaration
public virtual IEnumerable<Triple> GetTriplesWithPredicate(Uri u)
Parameters
Type Name Description
Uri u

The Uri to find Triples with it as the Predicate.

Returns
Type Description
IEnumerable<Triple>

Zero/More Triples.

| Edit this page View Source

GetTriplesWithPredicate(INode)

Gets all the Triples with the given Node as the Predicate.

Declaration
public virtual IEnumerable<Triple> GetTriplesWithPredicate(INode n)
Parameters
Type Name Description
INode n

The Node to find Triples with it as the Predicate.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

GetTriplesWithPredicateObject(INode, INode)

Selects all Triples with the given Predicate and Object.

Declaration
public virtual IEnumerable<Triple> GetTriplesWithPredicateObject(INode pred, INode obj)
Parameters
Type Name Description
INode pred

Predicate.

INode obj

Object.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

GetTriplesWithSubject(Uri)

Gets all the Triples with the given Uri as the Subject.

Declaration
public virtual IEnumerable<Triple> GetTriplesWithSubject(Uri u)
Parameters
Type Name Description
Uri u

The Uri to find Triples with it as the Subject.

Returns
Type Description
IEnumerable<Triple>

Zero/More Triples.

| Edit this page View Source

GetTriplesWithSubject(INode)

Gets all the Triples with the given Node as the Subject.

Declaration
public virtual IEnumerable<Triple> GetTriplesWithSubject(INode n)
Parameters
Type Name Description
INode n

The Node to find Triples with it as the Subject.

Returns
Type Description
IEnumerable<Triple>

Zero/More Triples.

| Edit this page View Source

GetTriplesWithSubjectObject(INode, INode)

Selects all Triples with the given Subject and Object.

Declaration
public virtual IEnumerable<Triple> GetTriplesWithSubjectObject(INode subj, INode obj)
Parameters
Type Name Description
INode subj

Subject.

INode obj

Object.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

GetTriplesWithSubjectPredicate(INode, INode)

Selects all Triples with the given Subject and Predicate.

Declaration
public virtual IEnumerable<Triple> GetTriplesWithSubjectPredicate(INode subj, INode pred)
Parameters
Type Name Description
INode subj

Subject.

INode pred

Predicate.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

GetUriNode(string)

Returns the UriNode with the given QName if it exists.

Declaration
public virtual IUriNode GetUriNode(string qname)
Parameters
Type Name Description
string qname

The QName of the Node to select.

Returns
Type Description
IUriNode
| Edit this page View Source

GetUriNode(Uri)

Returns the UriNode with the given Uri if it exists.

Declaration
public virtual IUriNode GetUriNode(Uri uri)
Parameters
Type Name Description
Uri uri

The Uri of the Node to select.

Returns
Type Description
IUriNode

Either the UriNode Or null if no Node with the given Uri exists.

| Edit this page View Source

HasSubGraph(IGraph)

Checks whether this Graph has the given Graph as a sub-graph.

Declaration
public virtual bool HasSubGraph(IGraph g)
Parameters
Type Name Description
IGraph g

Graph.

Returns
Type Description
bool
| Edit this page View Source

HasSubGraph(IGraph, out Dictionary<INode, INode>)

Checks whether this Graph has the given Graph as a sub-graph.

Declaration
public virtual bool HasSubGraph(IGraph g, out Dictionary<INode, INode> mapping)
Parameters
Type Name Description
IGraph g

Graph.

Dictionary<INode, INode> mapping

Mapping of Blank Nodes.

Returns
Type Description
bool
| Edit this page View Source

IsSubGraphOf(IGraph)

Checks whether this Graph is a sub-graph of the given Graph.

Declaration
public virtual bool IsSubGraphOf(IGraph g)
Parameters
Type Name Description
IGraph g

Graph.

Returns
Type Description
bool
| Edit this page View Source

IsSubGraphOf(IGraph, out Dictionary<INode, INode>)

Checks whether this Graph is a sub-graph of the given Graph.

Declaration
public virtual bool IsSubGraphOf(IGraph g, out Dictionary<INode, INode> mapping)
Parameters
Type Name Description
IGraph g

Graph.

Dictionary<INode, INode> mapping

Mapping of Blank Nodes.

Returns
Type Description
bool
| Edit this page View Source

Merge(IGraph)

Merges another Graph into the current Graph.

Declaration
public virtual void Merge(IGraph g)
Parameters
Type Name Description
IGraph g

Graph to Merge into this Graph.

Remarks

The Graph on which you invoke this method will preserve its Blank Node IDs while the Blank Nodes from the Graph being merged in will be given new IDs as required in the scope of this Graph.

| Edit this page View Source

Merge(IGraph, bool)

Merges another Graph into the current Graph.

Declaration
public virtual void Merge(IGraph g, bool keepOriginalGraphUri)
Parameters
Type Name Description
IGraph g

Graph to Merge into this Graph.

bool keepOriginalGraphUri

Indicates that the Merge should preserve the Graph URIs of Nodes so they refer to the Graph they originated in.

Remarks

The Graph on which you invoke this method will preserve its Blank Node IDs while the Blank Nodes from the Graph being merged in will be given new IDs as required in the scope of this Graph.

The Graph will raise the MergeRequested event before the Merge operation which gives any event handlers the oppurtunity to cancel this event. When the Merge operation is completed the Merged event is raised.

| Edit this page View Source

OnChanged(object, GraphEventArgs)

Event handler to help propogate Graph events from the underlying graph.

Declaration
protected virtual void OnChanged(object sender, GraphEventArgs args)
Parameters
Type Name Description
object sender

Sender.

GraphEventArgs args

Arguments.

| Edit this page View Source

OnClearRequested(object, CancellableGraphEventArgs)

Event handler to help propogate Graph events from the underlying graph.

Declaration
protected virtual void OnClearRequested(object sender, CancellableGraphEventArgs args)
Parameters
Type Name Description
object sender

Sender.

CancellableGraphEventArgs args

Arguments.

| Edit this page View Source

OnCleared(object, GraphEventArgs)

Event handler to help propogate Graph events from the underlying graph.

Declaration
protected virtual void OnCleared(object sender, GraphEventArgs args)
Parameters
Type Name Description
object sender

Sender.

GraphEventArgs args

Arguments.

| Edit this page View Source

OnMergeRequested(object, CancellableGraphEventArgs)

Event handler to help propogate Graph events from the underlying graph.

Declaration
protected virtual void OnMergeRequested(object sender, CancellableGraphEventArgs args)
Parameters
Type Name Description
object sender

Sender.

CancellableGraphEventArgs args

Arguments.

| Edit this page View Source

OnMerged(object, GraphEventArgs)

Event handler to help propogate Graph events from the underlying graph.

Declaration
protected virtual void OnMerged(object sender, GraphEventArgs args)
Parameters
Type Name Description
object sender

Sender.

GraphEventArgs args

Arguments.

| Edit this page View Source

OnTripleAsserted(object, TripleEventArgs)

Event Handler which handles the Triple Added event from the underlying Triple Collection by raising the Graph's TripleAsserted event.

Declaration
protected virtual void OnTripleAsserted(object sender, TripleEventArgs args)
Parameters
Type Name Description
object sender

Sender.

TripleEventArgs args

Triple Event Arguments.

| Edit this page View Source

OnTripleRetracted(object, TripleEventArgs)

Event Handler which handles the Triple Removed event from the underlying Triple Collection by raising the Graph's Triple Retracted event.

Declaration
protected virtual void OnTripleRetracted(object sender, TripleEventArgs args)
Parameters
Type Name Description
object sender

Sender.

TripleEventArgs args

Triple Event Arguments.

| Edit this page View Source

RaiseClearRequested(CancellableGraphEventArgs)

Helper method for raising the Clear Requested event and returning whether any of the Event Handlers cancelled the operation.

Declaration
protected void RaiseClearRequested(CancellableGraphEventArgs args)
Parameters
Type Name Description
CancellableGraphEventArgs args
| Edit this page View Source

RaiseCleared()

Helper method for raising the Cleared event.

Declaration
protected void RaiseCleared()
| Edit this page View Source

RaiseGraphChanged()

Helper method for raising the Changed event.

Declaration
protected void RaiseGraphChanged()
| Edit this page View Source

RaiseGraphChanged(TripleEventArgs)

Helper method for raising the Changed event.

Declaration
protected void RaiseGraphChanged(TripleEventArgs args)
Parameters
Type Name Description
TripleEventArgs args

Triple Event Arguments.

| Edit this page View Source

RaiseMergeRequested(CancellableGraphEventArgs)

Helper method for raising the Merge Requested event and returning whether any of the Event Handlers cancelled the operation.

Declaration
protected void RaiseMergeRequested(CancellableGraphEventArgs args)
Parameters
Type Name Description
CancellableGraphEventArgs args
| Edit this page View Source

RaiseMerged()

Helper method for raising the Merged event.

Declaration
protected void RaiseMerged()
| Edit this page View Source

RaiseTripleAsserted(Triple)

Helper method for raising the Triple Asserted event manually.

Declaration
protected void RaiseTripleAsserted(Triple t)
Parameters
Type Name Description
Triple t

Triple.

| Edit this page View Source

RaiseTripleAsserted(TripleEventArgs)

Helper method for raising the Triple Asserted event manually.

Declaration
protected void RaiseTripleAsserted(TripleEventArgs args)
Parameters
Type Name Description
TripleEventArgs args

Triple Event Arguments.

| Edit this page View Source

RaiseTripleRetracted(Triple)

Helper method for raising the Triple Retracted event manually.

Declaration
protected void RaiseTripleRetracted(Triple t)
Parameters
Type Name Description
Triple t

Triple.

| Edit this page View Source

RaiseTripleRetracted(TripleEventArgs)

Helper method for raising the Triple Retracted event manually.

Declaration
protected void RaiseTripleRetracted(TripleEventArgs args)
Parameters
Type Name Description
TripleEventArgs args
| Edit this page View Source

ResolveQName(string)

Helper function for Resolving QNames to URIs.

Declaration
public virtual Uri ResolveQName(string qname)
Parameters
Type Name Description
string qname

QName to resolve to a Uri.

Returns
Type Description
Uri
| Edit this page View Source

Retract(IEnumerable<Triple>)

Retracts Triples from the Graph.

Declaration
public virtual bool Retract(IEnumerable<Triple> ts)
Parameters
Type Name Description
IEnumerable<Triple> ts

Triples.

Returns
Type Description
bool
| Edit this page View Source

Retract(Triple)

Retracts a Triple from the Graph.

Declaration
public virtual bool Retract(Triple t)
Parameters
Type Name Description
Triple t

Triple.

Returns
Type Description
bool
| Edit this page View Source

Unstar()

Converts an graph containing quoted triples into to a graph with no quoted triples by applying the unstar operation described in https://w3c.github.io/rdf-star/cg-spec/2021-12-17.html#mapping.

Declaration
public void Unstar()
Remarks

The unstar operation modifies the graph in-place by calls to Assert(Triple) an Retract(Triple).

Events

| Edit this page View Source

Changed

Event which is raised when the Graph contents change

Declaration
public event GraphEventHandler Changed
Event Type
Type Description
GraphEventHandler
| Edit this page View Source

ClearRequested

Event which is raised just before the Graph is cleared of its contents

Declaration
public event CancellableGraphEventHandler ClearRequested
Event Type
Type Description
CancellableGraphEventHandler
| Edit this page View Source

Cleared

Event which is raised after the Graph is cleared of its contents

Declaration
public event GraphEventHandler Cleared
Event Type
Type Description
GraphEventHandler
| Edit this page View Source

MergeRequested

Event which is raised when a Merge operation is requested on the Graph

Declaration
public event CancellableGraphEventHandler MergeRequested
Event Type
Type Description
CancellableGraphEventHandler
| Edit this page View Source

Merged

Event which is raised when a Merge operation is completed on the Graph

Declaration
public event GraphEventHandler Merged
Event Type
Type Description
GraphEventHandler
| Edit this page View Source

TripleAsserted

Event which is raised when a Triple is asserted in the Graph

Declaration
public event TripleEventHandler TripleAsserted
Event Type
Type Description
TripleEventHandler
| Edit this page View Source

TripleRetracted

Event which is raised when a Triple is retracted from the Graph

Declaration
public event TripleEventHandler TripleRetracted
Event Type
Type Description
TripleEventHandler

Implements

IGraph
INodeFactory
IDisposable
ITripleIndex
IEquatable<T>

Extension Methods

Extensions.ToSafeString(object)
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)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • WrapperGraph(IGraph)
    • WrapperGraph(IRefNode)
  • Fields
    • _g
  • Properties
    • AllNodes
    • AllQuotedNodes
    • BaseUri
    • IsEmpty
    • LanguageTagValidation
    • Name
    • NamespaceMap
    • Nodes
    • NormalizeLiteralValues
    • QuotedNodes
    • QuotedTriples
    • Triples
    • UriFactory
  • Methods
    • Assert(IEnumerable<Triple>)
    • Assert(Triple)
    • AttachEventHandlers()
    • Clear()
    • ContainsQuotedTriple(Triple)
    • ContainsTriple(Triple)
    • CreateBlankNode()
    • CreateBlankNode(string)
    • CreateGraphLiteralNode()
    • CreateGraphLiteralNode(IGraph)
    • CreateLiteralNode(string)
    • CreateLiteralNode(string, string)
    • CreateLiteralNode(string, Uri)
    • CreateTripleNode(Triple)
    • CreateUriNode()
    • CreateUriNode(string)
    • CreateUriNode(Uri)
    • CreateVariableNode(string)
    • Difference(IGraph)
    • Dispose()
    • Equals(IGraph)
    • Equals(IGraph, out Dictionary<INode, INode>)
    • GetBlankNode(string)
    • GetLiteralNode(string)
    • GetLiteralNode(string, string)
    • GetLiteralNode(string, Uri)
    • GetNextBlankNodeID()
    • GetQuoted(Uri)
    • GetQuoted(INode)
    • GetQuotedWithObject(Uri)
    • GetQuotedWithObject(INode)
    • GetQuotedWithPredicate(Uri)
    • GetQuotedWithPredicate(INode)
    • GetQuotedWithPredicateObject(INode, INode)
    • GetQuotedWithSubject(Uri)
    • GetQuotedWithSubject(INode)
    • GetQuotedWithSubjectObject(INode, INode)
    • GetQuotedWithSubjectPredicate(INode, INode)
    • GetTripleNode(Triple)
    • GetTriples(Uri)
    • GetTriples(INode)
    • GetTriplesWithObject(Uri)
    • GetTriplesWithObject(INode)
    • GetTriplesWithPredicate(Uri)
    • GetTriplesWithPredicate(INode)
    • GetTriplesWithPredicateObject(INode, INode)
    • GetTriplesWithSubject(Uri)
    • GetTriplesWithSubject(INode)
    • GetTriplesWithSubjectObject(INode, INode)
    • GetTriplesWithSubjectPredicate(INode, INode)
    • GetUriNode(string)
    • GetUriNode(Uri)
    • HasSubGraph(IGraph)
    • HasSubGraph(IGraph, out Dictionary<INode, INode>)
    • IsSubGraphOf(IGraph)
    • IsSubGraphOf(IGraph, out Dictionary<INode, INode>)
    • Merge(IGraph)
    • Merge(IGraph, bool)
    • OnChanged(object, GraphEventArgs)
    • OnClearRequested(object, CancellableGraphEventArgs)
    • OnCleared(object, GraphEventArgs)
    • OnMergeRequested(object, CancellableGraphEventArgs)
    • OnMerged(object, GraphEventArgs)
    • OnTripleAsserted(object, TripleEventArgs)
    • OnTripleRetracted(object, TripleEventArgs)
    • RaiseClearRequested(CancellableGraphEventArgs)
    • RaiseCleared()
    • RaiseGraphChanged()
    • RaiseGraphChanged(TripleEventArgs)
    • RaiseMergeRequested(CancellableGraphEventArgs)
    • RaiseMerged()
    • RaiseTripleAsserted(Triple)
    • RaiseTripleAsserted(TripleEventArgs)
    • RaiseTripleRetracted(Triple)
    • RaiseTripleRetracted(TripleEventArgs)
    • ResolveQName(string)
    • Retract(IEnumerable<Triple>)
    • Retract(Triple)
    • Unstar()
  • Events
    • Changed
    • ClearRequested
    • Cleared
    • MergeRequested
    • Merged
    • TripleAsserted
    • TripleRetracted
  • Implements
  • Extension Methods
Back to top Generated by DocFX