Class UnionGraph
A Graph which represents the Union of several Graphs.
Inherited Members
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public class UnionGraph : Graph, IGraph, INodeFactory, IDisposable, ITripleIndex, IEquatable<IGraph>, IEquatable<Graph>
Remarks
The Union is entirely virtual, the Graphs and their Triples are not actually physically merged together.
All Assert and Retract operations are directed only to the Default Graph while a Clear() operation will clear all Graphs in the Union.
Constructors
| Improve this Doc View SourceUnionGraph(IGraph, IEnumerable<IGraph>)
Creates a new Union Graph which is the Union of all the given Graphs with a specific Default Graph.
Declaration
public UnionGraph(IGraph defaultGraph, IEnumerable<IGraph> graphs)
Parameters
Type | Name | Description |
---|---|---|
IGraph | defaultGraph | Default Graph of the Union. |
System.Collections.Generic.IEnumerable<T><IGraph> | graphs | Other Graphs in the Union. |
Remarks
The Union is entirely virtual, the Graphs and their Triples are not actually physically merged together.
All Assert and Retract operations are directed only to the Default Graph while a Clear() operation will clear all Graphs in the Union.
Properties
| Improve this Doc View SourceNodes
Gets the Nodes of the Graph.
Declaration
public override IEnumerable<INode> Nodes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><INode> |
Overrides
Remarks
The Union is entirely virtual, the Graphs and their Triples are not actually physically merged together.
All Assert and Retract operations are directed only to the Default Graph while a Clear() operation will clear all Graphs in the Union.
Methods
| Improve this Doc View SourceAssert(IEnumerable<Triple>)
Asserts some Triples in the Graph.
Declaration
public override bool Assert(IEnumerable<Triple> ts)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T><Triple> | ts | Triples. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
Remarks
Assert and Retract operations are directed to the Default Graph of the Union. We have to override the method to do this as although the UnionTripleCollection will direct asserts/retracts to Triple Collection of the default Graph we cannot guarantee that the Graph will be able to carry out any assertion/retraction logic (e.g. persistence) it might have implemented if the Assert/Retract bypasses the Assert/Retract method of the Default Graph.
Assert(Triple)
Asserts s Triple in the Graph.
Declaration
public override bool Assert(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
Remarks
Assert and Retract operations are directed to the Default Graph of the Union. We have to override the method to do this as although the UnionTripleCollection will direct asserts/retracts to Triple Collection of the default Graph we cannot guarantee that the Graph will be able to carry out any assertion/retraction logic (e.g. persistence) it might have implemented if the Assert/Retract bypasses the Assert/Retract method of the Default Graph.
Clear()
Clears all the Graphs in the Union.
Declaration
public override void Clear()
Overrides
Remarks
The Union is entirely virtual, the Graphs and their Triples are not actually physically merged together.
All Assert and Retract operations are directed only to the Default Graph while a Clear() operation will clear all Graphs in the Union.
Retract(IEnumerable<Triple>)
Retracts some Triples from the Graph.
Declaration
public override bool Retract(IEnumerable<Triple> ts)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T><Triple> | ts | Triples. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
Remarks
Assert and Retract operations are directed to the Default Graph of the Union. We have to override the method to do this as although the UnionTripleCollection will direct asserts/retracts to Triple Collection of the default Graph we cannot guarantee that the Graph will be able to carry out any assertion/retraction logic (e.g. persistence) it might have implemented if the Assert/Retract bypasses the Assert/Retract method of the Default Graph.
Retract(Triple)
Retracts a Triple from the Graph.
Declaration
public override bool Retract(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
Remarks
Assert and Retract operations are directed to the Default Graph of the Union. We have to override the method to do this as although the UnionTripleCollection will direct asserts/retracts to Triple Collection of the default Graph we cannot guarantee that the Graph will be able to carry out any assertion/retraction logic (e.g. persistence) it might have implemented if the Assert/Retract bypasses the Assert/Retract method of the Default Graph.