Class BaseVirtualNode<TNodeID, TGraphID>
Abstract Base implementation of a Virtual Node which is a Node that is represented only by some ID until such time as its value actually needs materializing.
Inheritance
Implements
Inherited Members
Namespace: VDS.RDF.Storage.Virtualisation
Assembly: dotNetRdf.dll
Syntax
public abstract class BaseVirtualNode<TNodeID, TGraphID> : IVirtualNode<TNodeID, TGraphID>, INode, IComparable<INode>, IComparable<IBlankNode>, IComparable<IGraphLiteralNode>, IComparable<ILiteralNode>, IComparable<IUriNode>, IComparable<IVariableNode>, IComparable<IRefNode>, IComparable<ITripleNode>, IEquatable<INode>, IEquatable<IBlankNode>, IEquatable<IGraphLiteralNode>, IEquatable<ILiteralNode>, IEquatable<IUriNode>, IEquatable<IVariableNode>, IEquatable<IRefNode>, IEquatable<ITripleNode>, IEquatable<IVirtualNode<TNodeID, TGraphID>>, IComparable<IVirtualNode<TNodeID, TGraphID>>, IVirtualIdComparable, IEquatable<BaseVirtualNode<TNodeID, TGraphID>>, IComparable<BaseVirtualNode<TNodeID, TGraphID>>, ICanCopy
Type Parameters
Name | Description |
---|---|
TNodeID | Node ID Type. |
TGraphID | Graph ID Type. |
Remarks
As far as possible equality checks are carried out using these IDs and limited comparisons may also be done this way. More specific implementations may wish to derive from this class in order to override the default comparison implementation to further reduce the number of places where value materialisation is done.
Note that this class does not implement any of the specialized Node interfaces and instead relies on the casting of its materialized value to an appropriately typed node to provide the true values to code that needs it.
Constructors
| Edit this page View SourceBaseVirtualNode(IGraph, NodeType, TNodeID, IVirtualRdfProvider<TNodeID, TGraphID>)
Creates a new Base Virtual Node.
Declaration
protected BaseVirtualNode(IGraph g, NodeType type, TNodeID id, IVirtualRdfProvider<TNodeID, TGraphID> provider)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph the Node belongs to. |
NodeType | type | Type of the node. |
TNodeID | id | Virtual ID. |
IVirtualRdfProvider<TNodeID, TGraphID> | provider | Virtual RDF Provider. |
BaseVirtualNode(IGraph, NodeType, TNodeID, IVirtualRdfProvider<TNodeID, TGraphID>, INode)
Creates a new Base Virtual Node.
Declaration
protected BaseVirtualNode(IGraph g, NodeType type, TNodeID id, IVirtualRdfProvider<TNodeID, TGraphID> provider, INode value)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph the Node belongs to. |
NodeType | type | Type of the node. |
TNodeID | id | Virtual ID. |
IVirtualRdfProvider<TNodeID, TGraphID> | provider | Virtual RDF Provider. |
INode | value | Materialized Value. |
Fields
| Edit this page View Source_value
The materialized value of the Virtual Node.
Declaration
protected INode _value
Field Value
Type | Description |
---|---|
INode |
Properties
| Edit this page View SourceGraph
Gets the Graph the Node belongs to.
Declaration
public IGraph Graph { get; }
Property Value
Type | Description |
---|---|
IGraph |
GraphUri
Gets/Sets the Graph URI of the Node.
Declaration
public Uri GraphUri { get; set; }
Property Value
Type | Description |
---|---|
Uri |
IsMaterialised
Gets whether the Nodes value has been materialized.
Declaration
public bool IsMaterialised { get; }
Property Value
Type | Description |
---|---|
bool |
MaterialisedValue
Gets the materialized value of the Node forcing it to be materialized if it hasn't already.
Declaration
public INode MaterialisedValue { get; }
Property Value
Type | Description |
---|---|
INode |
NodeType
Gets the Type of the Node.
Declaration
public NodeType NodeType { get; }
Property Value
Type | Description |
---|---|
NodeType |
Provider
Gets the Virtual RDF Provider of the Node.
Declaration
public IVirtualRdfProvider<TNodeID, TGraphID> Provider { get; }
Property Value
Type | Description |
---|---|
IVirtualRdfProvider<TNodeID, TGraphID> |
VirtualID
Gets the Virtual ID of the Node.
Declaration
public TNodeID VirtualID { get; }
Property Value
Type | Description |
---|---|
TNodeID |
Methods
| Edit this page View SourceCompareTo(IBlankNode)
Compares this Node to another Blank Node.
Declaration
public virtual int CompareTo(IBlankNode other)
Parameters
Type | Name | Description |
---|---|---|
IBlankNode | other | Other Blank Node. |
Returns
Type | Description |
---|---|
int |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform comparison.
CompareTo(IGraphLiteralNode)
Compares this Node to another Graph LiteralNode.
Declaration
public virtual int CompareTo(IGraphLiteralNode other)
Parameters
Type | Name | Description |
---|---|---|
IGraphLiteralNode | other | Other Graph Literal Node. |
Returns
Type | Description |
---|---|
int |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform comparison.
CompareTo(ILiteralNode)
Compares this Node to another Literal Node.
Declaration
public virtual int CompareTo(ILiteralNode other)
Parameters
Type | Name | Description |
---|---|---|
ILiteralNode | other | Other Literal Node. |
Returns
Type | Description |
---|---|
int |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform comparison.
CompareTo(INode)
Compares this Node to another Node.
Declaration
public int CompareTo(INode other)
Parameters
Type | Name | Description |
---|---|---|
INode | other | Other Node. |
Returns
Type | Description |
---|---|
int |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform comparison.
CompareTo(IRefNode)
Compares this Node to another Ref Node.
Declaration
public virtual int CompareTo(IRefNode other)
Parameters
Type | Name | Description |
---|---|---|
IRefNode | other | Other Ref Node. |
Returns
Type | Description |
---|---|
int |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform comparison.
CompareTo(ITripleNode)
Compares this Node to another Triple Node.
Declaration
public virtual int CompareTo(ITripleNode other)
Parameters
Type | Name | Description |
---|---|---|
ITripleNode | other | Other Triple Node. |
Returns
Type | Description |
---|---|
int |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform comparison.
CompareTo(IUriNode)
Compares this Node to another URI Node.
Declaration
public virtual int CompareTo(IUriNode other)
Parameters
Type | Name | Description |
---|---|---|
IUriNode | other | Other URI Node. |
Returns
Type | Description |
---|---|
int |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform comparison.
CompareTo(IVariableNode)
Compares this Node to another Variable Node.
Declaration
public virtual int CompareTo(IVariableNode other)
Parameters
Type | Name | Description |
---|---|---|
IVariableNode | other | Other Variable Node. |
Returns
Type | Description |
---|---|
int |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform comparison.
CompareTo(BaseVirtualNode<TNodeID, TGraphID>)
Compares this Node to another Virtual Node.
Declaration
public int CompareTo(BaseVirtualNode<TNodeID, TGraphID> other)
Parameters
Type | Name | Description |
---|---|---|
BaseVirtualNode<TNodeID, TGraphID> | other | Other Virtual Node. |
Returns
Type | Description |
---|---|
int |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform comparison.
CompareTo(IVirtualNode<TNodeID, TGraphID>)
Compares this Node to another Virtual Node.
Declaration
public int CompareTo(IVirtualNode<TNodeID, TGraphID> other)
Parameters
Type | Name | Description |
---|---|---|
IVirtualNode<TNodeID, TGraphID> | other | Other Virtual Node. |
Returns
Type | Description |
---|---|
int |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform comparison.
CompareVirtualId(TNodeID)
Method to be implemented in derived classes to provide comparison of VirtualId values.
Declaration
public abstract int CompareVirtualId(TNodeID other)
Parameters
Type | Name | Description |
---|---|---|
TNodeID | other | The other virtual ID value to be compared with this node's virtual ID value. |
Returns
Type | Description |
---|---|
int | The comparison result. |
CopyNode(IGraph)
Copies the Virtual Node into another Graph.
Declaration
public abstract INode CopyNode(IGraph target)
Parameters
Type | Name | Description |
---|---|---|
IGraph | target | Target Graph. |
Returns
Type | Description |
---|---|
INode |
Equals(object)
Checks this Node for equality against another Object.
Declaration
public override sealed bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | Other Object. |
Returns
Type | Description |
---|---|
bool |
Overrides
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform the equality check.
Equals(IBlankNode)
Checks this Node for equality against another Blank Node.
Declaration
public virtual bool Equals(IBlankNode other)
Parameters
Type | Name | Description |
---|---|---|
IBlankNode | other | Other Blank Node. |
Returns
Type | Description |
---|---|
bool |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform the equality check.
Equals(IGraphLiteralNode)
Checks this Node for equality against another Graph Literal Node.
Declaration
public virtual bool Equals(IGraphLiteralNode other)
Parameters
Type | Name | Description |
---|---|---|
IGraphLiteralNode | other | Other Graph Literal Node. |
Returns
Type | Description |
---|---|
bool |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform the equality check.
Equals(ILiteralNode)
Checks this Node for equality against another Literal Node.
Declaration
public virtual bool Equals(ILiteralNode other)
Parameters
Type | Name | Description |
---|---|---|
ILiteralNode | other | Other Literal Node. |
Returns
Type | Description |
---|---|
bool |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform the equality check.
Equals(INode)
Checks this Node for equality against another Node.
Declaration
public bool Equals(INode other)
Parameters
Type | Name | Description |
---|---|---|
INode | other | Other Node. |
Returns
Type | Description |
---|---|
bool |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform the equality check.
Equals(IRefNode)
Checks this Node for equality against another Ref Node.
Declaration
public virtual bool Equals(IRefNode other)
Parameters
Type | Name | Description |
---|---|---|
IRefNode | other | Other Ref Node. |
Returns
Type | Description |
---|---|
bool |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform the equality check.
Equals(ITripleNode)
Checks this Node for equality against another Triple Node.
Declaration
public virtual bool Equals(ITripleNode other)
Parameters
Type | Name | Description |
---|---|---|
ITripleNode | other | Other Triple Node. |
Returns
Type | Description |
---|---|
bool |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform the equality check.
Equals(IUriNode)
Checks this Node for equality against another URI Node.
Declaration
public virtual bool Equals(IUriNode other)
Parameters
Type | Name | Description |
---|---|---|
IUriNode | other | Other URI Node. |
Returns
Type | Description |
---|---|
bool |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform the equality check.
Equals(IVariableNode)
Checks this Node for equality against another Variable Node.
Declaration
public virtual bool Equals(IVariableNode other)
Parameters
Type | Name | Description |
---|---|---|
IVariableNode | other | Other Variable Node. |
Returns
Type | Description |
---|---|
bool |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform the equality check.
Equals(BaseVirtualNode<TNodeID, TGraphID>)
Checks this Node for equality against another Virtual Node.
Declaration
public bool Equals(BaseVirtualNode<TNodeID, TGraphID> other)
Parameters
Type | Name | Description |
---|---|---|
BaseVirtualNode<TNodeID, TGraphID> | other | Other Virtual Node. |
Returns
Type | Description |
---|---|
bool |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform the equality check.
Equals(IVirtualNode<TNodeID, TGraphID>)
Checks this Node for equality against another Virtual Node.
Declaration
public bool Equals(IVirtualNode<TNodeID, TGraphID> other)
Parameters
Type | Name | Description |
---|---|---|
IVirtualNode<TNodeID, TGraphID> | other | Other Virtual Node. |
Returns
Type | Description |
---|---|
bool |
Remarks
Unless Virtual Equality (equality based on the Virtual RDF Provider and Virtual ID) can be determined or the Nodes are of different types then the Nodes value will have to be materialized in order to perform the equality check.
GetHashCode()
Gets the Hash Code of the Virtual Node.
Declaration
public override sealed int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
| Edit this page View SourceMaterialiseValue()
Materializes the Value if it is not already materialized.
Declaration
protected void MaterialiseValue()
OnMaterialise()
Called after the value is materialized for the first time.
Declaration
protected virtual void OnMaterialise()
ToString()
Gets the String representation of the Node.
Declaration
public override sealed string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
| Edit this page View SourceToString(INodeFormatter)
Gets the String representation of the Node formatted with the given Node formatter.
Declaration
public string ToString(INodeFormatter formatter)
Parameters
Type | Name | Description |
---|---|---|
INodeFormatter | formatter | Formatter. |
Returns
Type | Description |
---|---|
string |
ToString(INodeFormatter, TripleSegment)
Gets the String representation of the Node formatted with the given Node formatter.
Declaration
public string ToString(INodeFormatter formatter, TripleSegment segment)
Parameters
Type | Name | Description |
---|---|---|
INodeFormatter | formatter | Formatter. |
TripleSegment | segment | Triple Segment. |
Returns
Type | Description |
---|---|
string |
TryCompareVirtualId(INode, out int)
Attempt to compare this node with another node.
Declaration
public bool TryCompareVirtualId(INode other, out int comparisonResult)
Parameters
Type | Name | Description |
---|---|---|
INode | other | The node to compare to. |
int | comparisonResult | The comparison result. |
Returns
Type | Description |
---|---|
bool | True if the comparison could be performed, false otherwise. |
Remarks
This node can only be compared to other
if other
is a IVirtualNode<TNodeID, TGraphID> from the same
IVirtualRdfProvider<TNodeID, TGraphID> as this node.
TryVirtualEquality(INode, out bool)
Tries to check for equality using virtual node IDs.
Declaration
protected bool TryVirtualEquality(INode other, out bool areEqual)
Parameters
Type | Name | Description |
---|---|---|
INode | other | Node to test against. |
bool | areEqual | Whether the virtual nodes are equal. |
Returns
Type | Description |
---|---|
bool | Whether the virtual equality test was valid, if false then other means must be used to determine equality. |