This class is used when a literal is parsed, and it's value is an invalid lexical form for it's datatype. The spec defines value with invalid lexical form are still valid terms, and as such we can not error immediately. This class makes sure that the typedValue will remain undefined, and the category 'nonlexical'. This way, only when operators apply to the 'nonlexical' category, they will keep working, otherwise they will throw a type error. This seems to match the spec, except maybe for functions that accept non-lexical values for their datatype.

See:

Hierarchy (view full)

  • Literal<{
        toString: (() => "undefined");
    }>
    • NonLexicalLiteral

Constructors

Properties

dataType: string

a string representing the datatype. Can be of type

expressionType: Term = ExpressionType.Term
language?: string

the language, mainly for language enabled strings like RDF_LANG_STRING

strValue?: string

the string value of this literal. In other words, the string representing the RDF.literal value.

termType: "literal" = ...
typedValue: {
    toString: (() => "undefined");
}

internal representation of this literal's value

Methods