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 materialising.
Inheritance
System.Object
BaseVirtualNode<TNodeID, TGraphID>
Implements
IVirtualNode<TNodeID, TGraphID>
System.IComparable<INode>
System.IComparable<IBlankNode>
System.IComparable<IGraphLiteralNode>
System.IComparable<ILiteralNode>
System.IComparable<IUriNode>
System.IComparable<IVariableNode>
System.IEquatable<INode>
System.IEquatable<IBlankNode>
System.IEquatable<IGraphLiteralNode>
System.IEquatable<ILiteralNode>
System.IEquatable<IUriNode>
System.IEquatable<IVariableNode>
System.Runtime.Serialization.ISerializable
System.Xml.Serialization.IXmlSerializable
System.IEquatable<IVirtualNode<TNodeID, TGraphID>>
System.IComparable<IVirtualNode<TNodeID, TGraphID>>
System.IEquatable<BaseVirtualNode<TNodeID, TGraphID>>
System.IComparable<BaseVirtualNode<TNodeID, TGraphID>>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
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>, IEquatable<INode>, IEquatable<IBlankNode>, IEquatable<IGraphLiteralNode>, IEquatable<ILiteralNode>, IEquatable<IUriNode>, IEquatable<IVariableNode>, ISerializable, IXmlSerializable, 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 specialised Node interfaces and instead relies on the casting of its materialised value to an appropriately typed node to provide the true values to code that needs it.
Constructors
| Improve this Doc View SourceBaseVirtualNode(IGraph, NodeType, TNodeID, IVirtualRdfProvider<TNodeID, TGraphID>)
Creates a new Base Virtual Node.
Declaration
public 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
public 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 | Materialised Value. |
Fields
| Improve this Doc View Source_value
The materialised value of the Virtual Node.
Declaration
protected INode _value
Field Value
Type | Description |
---|---|
INode |
Properties
| Improve this Doc 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 |
---|---|
System.Uri |
IsMaterialised
Gets whether the Nodes value has been materialised.
Declaration
public bool IsMaterialised { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
MaterialisedValue
Gets the materialised value of the Node forcing it to be materialised 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
| Improve this Doc 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 |
---|---|
System.Int32 |
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 materialised in order to perform comparison.
|
Improve this Doc
View Source
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 |
---|---|
System.Int32 |
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 materialised in order to perform comparison.
|
Improve this Doc
View Source
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 |
---|---|
System.Int32 |
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 materialised in order to perform comparison.
|
Improve this Doc
View Source
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 |
---|---|
System.Int32 |
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 materialised in order to perform comparison.
|
Improve this Doc
View Source
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 |
---|---|
System.Int32 |
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 materialised in order to perform comparison.
|
Improve this Doc
View Source
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 |
---|---|
System.Int32 |
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 materialised in order to perform comparison.
|
Improve this Doc
View Source
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 |
---|---|
System.Int32 |
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 materialised in order to perform comparison.
|
Improve this Doc
View Source
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 |
---|---|
System.Int32 |
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 materialised in order to perform comparison.
|
Improve this Doc
View Source
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 |
---|---|
System.Int32 | 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 sealed override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Other Object. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
System.Object.Equals(System.Object)
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 materialised in order to perform the equality check.
|
Improve this Doc
View Source
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 |
---|---|
System.Boolean |
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 materialised in order to perform the equality check.
|
Improve this Doc
View Source
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 |
---|---|
System.Boolean |
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 materialised in order to perform the equality check.
|
Improve this Doc
View Source
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 |
---|---|
System.Boolean |
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 materialised in order to perform the equality check.
|
Improve this Doc
View Source
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 |
---|---|
System.Boolean |
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 materialised in order to perform the equality check.
|
Improve this Doc
View Source
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 |
---|---|
System.Boolean |
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 materialised in order to perform the equality check.
|
Improve this Doc
View Source
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 |
---|---|
System.Boolean |
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 materialised in order to perform the equality check.
|
Improve this Doc
View Source
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 |
---|---|
System.Boolean |
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 materialised in order to perform the equality check.
|
Improve this Doc
View Source
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 |
---|---|
System.Boolean |
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 materialised in order to perform the equality check.
|
Improve this Doc
View Source
GetHashCode()
Gets the Hash Code of the Virtual Node.
Declaration
public sealed override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
System.Object.GetHashCode()
|
Improve this Doc
View Source
GetObjectData(SerializationInfo, StreamingContext)
Gets the data for serialization.
Declaration
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | Serialization Information. |
System.Runtime.Serialization.StreamingContext | context | Streaming Context. |
Exceptions
Type | Condition |
---|---|
System.NotImplementedException | Thrown because serializing a Virtual Node would be lossy. |
GetSchema()
Gets the schema for XML serialization.
Declaration
public XmlSchema GetSchema()
Returns
Type | Description |
---|---|
System.Xml.Schema.XmlSchema |
MaterialiseValue()
Materialises the Value if it is not already materialised.
Declaration
protected void MaterialiseValue()
OnMaterialise()
Called after the value is materialised for the first time.
Declaration
protected virtual void OnMaterialise()
ReadXml(XmlReader)
Reads the data for XML deserialization.
Declaration
public virtual void ReadXml(XmlReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | reader | XML Reader. |
Exceptions
Type | Condition |
---|---|
System.NotImplementedException | Thrown because serializing a Virtual Node would be lossy. |
ToString()
Gets the String representation of the Node.
Declaration
public sealed override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
System.Object.ToString()
|
Improve this Doc
View Source
ToString(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 |
---|---|
System.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 |
---|---|
System.String |
TryCompareVirtualId(INode, out Int32)
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. |
System.Int32 | comparisonResult | The comparison result. |
Returns
Type | Description |
---|---|
System.Boolean | True if the comparison could be performed, false otherwise. |
Remarks
This node can only be compared to
|
Improve this Doc
View Source
other
if other
is a IVirtualNode<TNodeID, TGraphID> from the same
IVirtualRdfProvider<TNodeID, TGraphID> as this node.TryVirtualEquality(INode, out Boolean)
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. |
System.Boolean | areEqual | Whether the virtual nodes are equal. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the virtual equality test was valid, if false then other means must be used to determine equality. |
WriteXml(XmlWriter)
Writes the data for XML deserialization.
Declaration
public virtual void WriteXml(XmlWriter writer)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlWriter | writer | XML Writer. |
Exceptions
Type | Condition |
---|---|
System.NotImplementedException | Thrown because serializing a Virtual Node would be lossy. |
Implements
System.IComparable<T>
System.IComparable<T>
System.IComparable<T>
System.IComparable<T>
System.IComparable<T>
System.IComparable<T>
System.IEquatable<T>
System.IEquatable<T>
System.IEquatable<T>
System.IEquatable<T>
System.IEquatable<T>
System.IEquatable<T>
System.Runtime.Serialization.ISerializable
System.Xml.Serialization.IXmlSerializable
System.IEquatable<T>
System.IComparable<T>
System.IEquatable<T>
System.IComparable<T>