Options
All
  • Public
  • Public/Protected
  • All
Menu

An implementation of RDF/JS' Literal.

Hierarchy

Implements

  • Literal

Index

Constructors

  • new Literal(value: string, languageOrDatatype?: string | NamedNode<string>): Literal
  • Creates a new instance.

    Parameters

    • value: string

      The value of the literal.

    • Optional languageOrDatatype: string | NamedNode<string>

      Sets the datatype if either an RDFJS.NamedNode or a string containing a datatype URI is supplied. Sets the language if a valid language tag is supplied as a string. If not specified, the default data type is Literal.stringDatatype.

    Returns Literal

Properties

datatype: NamedNode<string>
language: string
termType: "Literal" = "Literal"
value: string
langStringDatatype: NamedNode<"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"> = ...
stringDatatype: NamedNode<"http://www.w3.org/2001/XMLSchema#string"> = ...

Methods

  • equals(other: null | Term): boolean
  • Checks the equality of two terms.

    Parameters

    • other: null | Term

      The term to compare against.

    Returns boolean

    false if the term is null, undefined, or of a different type. Also false if one or more properties are not equal, otherwise true.

Generated using TypeDoc