Show / Hide Table of Contents

Class BaseNode

Abstract Class for Nodes, implements the two basic properties of the INode Interface.
Inheritance
System.Object
BaseNode
BaseBlankNode
BaseGraphLiteralNode
BaseLiteralNode
BaseUriNode
BaseVariableNode
Implements
INode
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
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
Assembly: dotNetRDF.dll
Syntax
public abstract class BaseNode : 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

Constructors

| Improve this Doc View Source

BaseNode(IGraph, NodeType)

Base Constructor which instantiates the Graph reference, Graph Uri and Node Type of the Node.
Declaration
public BaseNode(IGraph g, NodeType type)
Parameters
Type Name Description
IGraph g Graph this Node is in.
NodeType type Node Type.

Fields

| Improve this Doc View Source

_graph

Reference to the Graph that the Node belongs to.
Declaration
protected IGraph _graph
Field Value
Type Description
IGraph
| Improve this Doc View Source

_graphUri

Uri of the Graph that the Node belongs to.
Declaration
protected Uri _graphUri
Field Value
Type Description
System.Uri
| Improve this Doc View Source

_hashcode

Stores the computed Hash Code for this Node.
Declaration
protected int _hashcode
Field Value
Type Description
System.Int32
| Improve this Doc View Source

_nodetype

Node Type for the Node.
Declaration
protected NodeType _nodetype
Field Value
Type Description
NodeType

Properties

| Improve this Doc View Source

Graph

Nodes belong to a Graph.
Declaration
public IGraph Graph { get; }
Property Value
Type Description
IGraph
| Improve this Doc View Source

GraphUri

Gets/Sets the Graph Uri of the Node.
Declaration
public Uri GraphUri { get; set; }
Property Value
Type Description
System.Uri
| Improve this Doc View Source

NodeType

Nodes have a Type.
Declaration
public NodeType NodeType { get; }
Property Value
Type Description
NodeType

Methods

| Improve this Doc View Source

CompareTo(IBlankNode)

Nodes must implement a CompareTo method to allow them to be Sorted.
Declaration
public abstract int CompareTo(IBlankNode other)
Parameters
Type Name Description
IBlankNode other Node to compare self to.
Returns
Type Description
System.Int32
Remarks
Implementations should use the SPARQL Term Sort Order for ordering nodes (as opposed to value sort order). Standard implementations of Node type specific comparisons can be found in ComparisonHelper.
| Improve this Doc View Source

CompareTo(IGraphLiteralNode)

Nodes must implement a CompareTo method to allow them to be Sorted.
Declaration
public abstract int CompareTo(IGraphLiteralNode other)
Parameters
Type Name Description
IGraphLiteralNode other Node to compare self to.
Returns
Type Description
System.Int32
Remarks
Implementations should use the SPARQL Term Sort Order for ordering nodes (as opposed to value sort order). Standard implementations of Node type specific comparisons can be found in ComparisonHelper.
| Improve this Doc View Source

CompareTo(ILiteralNode)

Nodes must implement a CompareTo method to allow them to be Sorted.
Declaration
public abstract int CompareTo(ILiteralNode other)
Parameters
Type Name Description
ILiteralNode other Node to compare self to.
Returns
Type Description
System.Int32
Remarks
Implementations should use the SPARQL Term Sort Order for ordering nodes (as opposed to value sort order). Standard implementations of Node type specific comparisons can be found in ComparisonHelper.
| Improve this Doc View Source

CompareTo(INode)

Nodes must implement a CompareTo method to allow them to be Sorted.
Declaration
public abstract int CompareTo(INode other)
Parameters
Type Name Description
INode other Node to compare self to.
Returns
Type Description
System.Int32
Remarks
Implementations should use the SPARQL Term Sort Order for ordering nodes (as opposed to value sort order). Standard implementations of Node type specific comparisons can be found in ComparisonHelper.
| Improve this Doc View Source

CompareTo(IUriNode)

Nodes must implement a CompareTo method to allow them to be Sorted.
Declaration
public abstract int CompareTo(IUriNode other)
Parameters
Type Name Description
IUriNode other Node to compare self to.
Returns
Type Description
System.Int32
Remarks
Implementations should use the SPARQL Term Sort Order for ordering nodes (as opposed to value sort order). Standard implementations of Node type specific comparisons can be found in ComparisonHelper.
| Improve this Doc View Source

CompareTo(IVariableNode)

Nodes must implement a CompareTo method to allow them to be Sorted.
Declaration
public abstract int CompareTo(IVariableNode other)
Parameters
Type Name Description
IVariableNode other Node to compare self to.
Returns
Type Description
System.Int32
Remarks
Implementations should use the SPARQL Term Sort Order for ordering nodes (as opposed to value sort order). Standard implementations of Node type specific comparisons can be found in ComparisonHelper.
| Improve this Doc View Source

Equals(Object)

Nodes must implement an Equals method.
Declaration
public abstract override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj Object to compare against.
Returns
Type Description
System.Boolean
Overrides
System.Object.Equals(System.Object)
| Improve this Doc View Source

Equals(IBlankNode)

Nodes must implement an Equals method so we can do type specific equality.
Declaration
public abstract bool Equals(IBlankNode other)
Parameters
Type Name Description
IBlankNode other Node to check for equality.
Returns
Type Description
System.Boolean
Remarks
Nodes implementations are also required to implement an override of the non-generic Equals method. Standard implementations of some equality comparisons can be found in EqualityHelper.
| Improve this Doc View Source

Equals(IGraphLiteralNode)

Nodes must implement an Equals method so we can do type specific equality.
Declaration
public abstract bool Equals(IGraphLiteralNode other)
Parameters
Type Name Description
IGraphLiteralNode other Node to check for equality.
Returns
Type Description
System.Boolean
Remarks
Nodes implementations are also required to implement an override of the non-generic Equals method. Standard implementations of some equality comparisons can be found in EqualityHelper.
| Improve this Doc View Source

Equals(ILiteralNode)

Nodes must implement an Equals method so we can do type specific equality.
Declaration
public abstract bool Equals(ILiteralNode other)
Parameters
Type Name Description
ILiteralNode other Node to check for equality.
Returns
Type Description
System.Boolean
Remarks
Nodes implementations are also required to implement an override of the non-generic Equals method. Standard implementations of some equality comparisons can be found in EqualityHelper.
| Improve this Doc View Source

Equals(INode)

Nodes must implement an Equals method so we can do type specific equality.
Declaration
public abstract bool Equals(INode other)
Parameters
Type Name Description
INode other Node to check for equality.
Returns
Type Description
System.Boolean
Remarks
Nodes implementations are also required to implement an override of the non-generic Equals method. Standard implementations of some equality comparisons can be found in EqualityHelper.
| Improve this Doc View Source

Equals(IUriNode)

Nodes must implement an Equals method so we can do type specific equality.
Declaration
public abstract bool Equals(IUriNode other)
Parameters
Type Name Description
IUriNode other Node to check for equality.
Returns
Type Description
System.Boolean
Remarks
Nodes implementations are also required to implement an override of the non-generic Equals method. Standard implementations of some equality comparisons can be found in EqualityHelper.
| Improve this Doc View Source

Equals(IVariableNode)

Nodes must implement an Equals method so we can do type specific equality.
Declaration
public abstract bool Equals(IVariableNode other)
Parameters
Type Name Description
IVariableNode other Node to check for equality.
Returns
Type Description
System.Boolean
Remarks
Nodes implementations are also required to implement an override of the non-generic Equals method. Standard implementations of some equality comparisons can be found in EqualityHelper.
| Improve this Doc View Source

GetHashCode()

Gets a Hash Code for a Node.
Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.Object.GetHashCode()
Remarks

Implemented by getting the Hash Code of the result of ToString for a Node prefixed with its Node Type, this is pre-computed for efficiency when a Node is created since Nodes are immutable. See remarks on ToString for more detail.

Since Hash Codes are based on a String representation there is no guarantee of uniqueness though the same Node will always give the same Hash Code (on a given Platform - see the MSDN Documentation for System.String.GetHashCode for further details).

| Improve this Doc View Source

GetObjectData(SerializationInfo, StreamingContext)

Gets the information 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.
| Improve this Doc View Source

GetSchema()

Gets the schema for XML serialization.
Declaration
public XmlSchema GetSchema()
Returns
Type Description
System.Xml.Schema.XmlSchema
| Improve this Doc View Source

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.
| Improve this Doc View Source

ToString()

Nodes must implement a ToString method.
Declaration
public abstract override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()
Remarks

Essential for the implementation of GetHashCode to work correctly, Nodes should generate a String representation that is 'unique' as far as that is possible.

Any two Nodes which match via the Equals method (based on strict RDF Specification Equality) should produce the same String representation since Hash Codes are generated by calling GetHashCode on this String.

| Improve this Doc View Source

ToString(INodeFormatter)

Gets the String representation of the Node formatted with the given Node formatter.
Declaration
public virtual string ToString(INodeFormatter formatter)
Parameters
Type Name Description
INodeFormatter formatter Formatter.
Returns
Type Description
System.String
| Improve this Doc View Source

ToString(INodeFormatter, TripleSegment)

Gets the String representation of the Node formatted with the given Node formatter.
Declaration
public virtual string ToString(INodeFormatter formatter, TripleSegment segment)
Parameters
Type Name Description
INodeFormatter formatter Formatter.
TripleSegment segment Triple Segment.
Returns
Type Description
System.String
| Improve this Doc View Source

WriteXml(XmlWriter)

Writes the data for XML serialization.
Declaration
public virtual void WriteXml(XmlWriter writer)
Parameters
Type Name Description
System.Xml.XmlWriter writer XML Writer.

Operators

| Improve this Doc View Source

Equality(BaseNode, BaseNode)

The Equality operator is defined for Nodes.
Declaration
public static bool operator ==(BaseNode a, BaseNode b)
Parameters
Type Name Description
BaseNode a First Node.
BaseNode b Second Node.
Returns
Type Description
System.Boolean Whether the two Nodes are equal.
Remarks
Uses the Equals method to evaluate the result.
| Improve this Doc View Source

Inequality(BaseNode, BaseNode)

The Non-Equality operator is defined for Nodes.
Declaration
public static bool operator !=(BaseNode a, BaseNode b)
Parameters
Type Name Description
BaseNode a First Node.
BaseNode b Second Node.
Returns
Type Description
System.Boolean Whether the two Nodes are non-equal.
Remarks
Uses the Equals method to evaluate the result.

Implements

INode
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

Extension Methods

Extensions.AsEnumerable<T>(T)
Extensions.IsListRoot(INode, IGraph)
Extensions.CopyNode(INode, IGraph)
Extensions.CopyNode(INode, IGraph, Boolean)
DynamicExtensions.AsDynamic(INode, Uri)
ValuedNodeExtensions.AsValuedNode(INode)
  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • BaseNode(IGraph, NodeType)
  • Fields
    • _graph
    • _graphUri
    • _hashcode
    • _nodetype
  • Properties
    • Graph
    • GraphUri
    • NodeType
  • Methods
    • CompareTo(IBlankNode)
    • CompareTo(IGraphLiteralNode)
    • CompareTo(ILiteralNode)
    • CompareTo(INode)
    • CompareTo(IUriNode)
    • CompareTo(IVariableNode)
    • Equals(Object)
    • Equals(IBlankNode)
    • Equals(IGraphLiteralNode)
    • Equals(ILiteralNode)
    • Equals(INode)
    • Equals(IUriNode)
    • Equals(IVariableNode)
    • GetHashCode()
    • GetObjectData(SerializationInfo, StreamingContext)
    • GetSchema()
    • ReadXml(XmlReader)
    • ToString()
    • ToString(INodeFormatter)
    • ToString(INodeFormatter, TripleSegment)
    • WriteXml(XmlWriter)
  • Operators
    • Equality(BaseNode, BaseNode)
    • Inequality(BaseNode, BaseNode)
  • Implements
  • Extension Methods
Back to top Generated by DocFX