Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Node

The superclass of all RDF Statement objects, that is NamedNode, Literal, BlankNode, etc. Should not be instantiated directly. Also called Term.

link

https://rdf.js.org/data-model-spec/#term-interface

class

Node

Hierarchy

Index

Constructors

Protected constructor

  • new Node(value: string): Node

Properties

classOrder

classOrder: number

The class order for this node

termType

termType: TermType

The type of node

value

value: string

The node's value

Static fromValue

fromValue: function

Type declaration

Static toJS

toJS: function

Type declaration

    • (term: any): Date | Number | string | boolean | object | Array<Date | Number | string | boolean | object>
    • Parameters

      • term: any

      Returns Date | Number | string | boolean | object | Array<Date | Number | string | boolean | object>

Methods

compareTerm

  • compareTerm(other: Node): number
  • Compares this node with another

    see

    {equals} to check if two nodes are equal

    Parameters

    • other: Node

      The other node

    Returns number

equals

  • equals(other: Term): boolean
  • Compares whether the two nodes are equal

    Parameters

    • other: Term

      The other node

    Returns boolean

hashString

  • hashString(): string
  • Creates a hash for this node

    deprecated

    use {rdfFactory.id} instead if possible

    Returns string

sameTerm

  • sameTerm(other: Node): boolean
  • Compares whether this node is the same as the other one

    Parameters

    • other: Node

      Another node

    Returns boolean

substitute

  • Creates the substituted node for this one, according to the specified bindings

    Type parameters

    Parameters

    • bindings: Bindings

      Bindings of identifiers to nodes

    Returns T

toCanonical

  • toCanonical(): string
  • Creates a canonical string representation of this node

    Returns string

toNQ

  • toNQ(): string
  • Creates a n-quads string representation of this node

    Returns string

toNT

  • toNT(): string
  • Creates a n-triples string representation of this node

    Returns string

toString

  • toString(): string