Show / Hide Table of Contents

Class BaseNode

Abstract Class for Nodes, implements the two basic properties of the INode Interface.

Inheritance
object
BaseNode
BaseBlankNode
BaseGraphLiteralNode
BaseLiteralNode
BaseTripleNode
BaseUriNode
BaseVariableNode
Implements
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>
Inherited Members
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, 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>, IComparable<IRefNode>, IComparable<ITripleNode>, IEquatable<INode>, IEquatable<IBlankNode>, IEquatable<IGraphLiteralNode>, IEquatable<ILiteralNode>, IEquatable<IUriNode>, IEquatable<IVariableNode>, IEquatable<IRefNode>, IEquatable<ITripleNode>

Constructors

| Edit this page View Source

BaseNode(NodeType)

Base Constructor which instantiates the Graph reference, Graph Uri and Node Type of the Node.

Declaration
protected BaseNode(NodeType type)
Parameters
Type Name Description
NodeType type

Node Type.

Fields

| Edit this page View Source

_nodeType

Node Type for the Node.

Declaration
protected NodeType _nodeType
Field Value
Type Description
NodeType

Properties

| Edit this page View Source

NodeType

Nodes have a Type.

Declaration
public NodeType NodeType { get; }
Property Value
Type Description
NodeType

Methods

| Edit this page 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
int
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.

| Edit this page 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
int
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.

| Edit this page 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
int
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.

| Edit this page 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
int
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.

| Edit this page View Source

CompareTo(IRefNode)

Nodes must implement a CompareTo method to allow them to be Sorted.

Declaration
public abstract int CompareTo(IRefNode other)
Parameters
Type Name Description
IRefNode other

Node to compare self to.

Returns
Type Description
int
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.

| Edit this page View Source

CompareTo(ITripleNode)

Nodes must implement a CompareTo method to allow them to be Sorted.

Declaration
public abstract int CompareTo(ITripleNode other)
Parameters
Type Name Description
ITripleNode other

Node to compare self to.

Returns
Type Description
int
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.

| Edit this page 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
int
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.

| Edit this page 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
int
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.

| Edit this page View Source

Equals(object)

Nodes must implement an Equals method.

Declaration
public override abstract bool Equals(object obj)
Parameters
Type Name Description
object obj

Object to compare against.

Returns
Type Description
bool
Overrides
object.Equals(object)
| Edit this page 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
bool
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.

| Edit this page 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
bool
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.

| Edit this page 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
bool
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.

| Edit this page 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
bool
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.

| Edit this page View Source

Equals(IRefNode)

Nodes must implement an Equals method so we can do type specific equality.

Declaration
public abstract bool Equals(IRefNode other)
Parameters
Type Name Description
IRefNode other

Node to check for equality.

Returns
Type Description
bool
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.

| Edit this page View Source

Equals(ITripleNode)

Nodes must implement an Equals method so we can do type specific equality.

Declaration
public abstract bool Equals(ITripleNode other)
Parameters
Type Name Description
ITripleNode other

Node to check for equality.

Returns
Type Description
bool
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.

| Edit this page 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
bool
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.

| Edit this page 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
bool
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.

| Edit this page View Source

GetHashCode()

Serves as the default hash function.

Declaration
public override abstract int GetHashCode()
Returns
Type Description
int

A hash code for the current object.

Overrides
object.GetHashCode()
| Edit this page View Source

ToString()

Nodes must implement a ToString method.

Declaration
public override abstract string ToString()
Returns
Type Description
string
Overrides
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.

| Edit this page 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
string
| Edit this page 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
string

Operators

| Edit this page View Source

operator ==(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
bool

Whether the two Nodes are equal.

Remarks

Uses the Equals method to evaluate the result.

| Edit this page View Source

operator !=(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
bool

Whether the two Nodes are non-equal.

Remarks

Uses the Equals method to evaluate the result.

Implements

INode
IComparable<T>
IComparable<T>
IComparable<T>
IComparable<T>
IComparable<T>
IComparable<T>
IComparable<T>
IComparable<T>
IEquatable<T>
IEquatable<T>
IEquatable<T>
IEquatable<T>
IEquatable<T>
IEquatable<T>
IEquatable<T>
IEquatable<T>

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
DynamicExtensions.AsDynamic(INode, IGraph, Uri)
Extensions.EffectiveBooleanValue(INode)
Extensions.IsListRoot(INode, IGraph)
ValuedNodeExtensions.AsValuedNode(INode)
  • Edit this page
  • View Source
In this article
  • Constructors
    • BaseNode(NodeType)
  • Fields
    • _nodeType
  • Properties
    • NodeType
  • Methods
    • CompareTo(IBlankNode)
    • CompareTo(IGraphLiteralNode)
    • CompareTo(ILiteralNode)
    • CompareTo(INode)
    • CompareTo(IRefNode)
    • CompareTo(ITripleNode)
    • CompareTo(IUriNode)
    • CompareTo(IVariableNode)
    • Equals(object)
    • Equals(IBlankNode)
    • Equals(IGraphLiteralNode)
    • Equals(ILiteralNode)
    • Equals(INode)
    • Equals(IRefNode)
    • Equals(ITripleNode)
    • Equals(IUriNode)
    • Equals(IVariableNode)
    • GetHashCode()
    • ToString()
    • ToString(INodeFormatter)
    • ToString(INodeFormatter, TripleSegment)
  • Operators
    • operator ==(BaseNode, BaseNode)
    • operator !=(BaseNode, BaseNode)
  • Implements
  • Extension Methods
Back to top Generated by DocFX