Class Literal

An RDF literal, containing some value which isn't expressed as an IRI.

Hierarchy (view full)

Implements

  • Literal

Constructors

  • Initializes a literal

    Parameters

    • value: string

      The literal's lexical value

    • Optional language: null | string

      The language for the literal. Defaults to ''.

    • Optional datatype: any

      The literal's datatype as a named node. Defaults to xsd:string.

    Returns Literal

Properties

classOrder: number = ClassOrder.Literal

The class order for this node

datatype: NamedNode = XSD.string

The literal's datatype as a named node

isVar: number = 0
language: string = ''

The language for the literal

termType: "Literal" = LiteralTermType

The type of node

value: string

The node's value

toJS: ((term) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[])

Type declaration

    • (term): string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]
    • Parameters

      • term: any

      Returns string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

Accessors

  • get lang(): string
  • The language for the literal

    Returns string

    Deprecated

    use {language} instead

  • set lang(language): void
  • Parameters

    • language: string

    Returns void

Methods

  • Gets whether two literals are the same

    Parameters

    • other: Term

      The other statement

    Returns boolean

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

    Type Parameters

    Parameters

    • bindings: Bindings

      Bindings of identifiers to nodes

    Returns T

  • Creates a n-triples string representation of this node

    Returns string

  • Builds a literal node from an input value

    Type Parameters

    • T extends FromValueReturns

    Parameters

    • value: ValueType

      The input value

    Returns T

  • Serializes a literal to an N-Triples string

    Parameters

    Returns string