Comunica
    Preparing search index...

    Module @comunica/utils-expression-evaluator - v5.4.0

    Comunica Expression Evaluator Utils

    npm version

    The building blocks that the SPARQL expression evaluation actors of Comunica are made of: the internal term representation, the type system, and the errors of expression evaluation.

    This module is part of the Comunica framework, and should only be used by developers that want to build their own query engine.

    Click here if you just want to query with Comunica.

    To evaluate expressions rather than implement them, use Comunica SPARQL Expressions.

    Learn more about expression evaluation.

    $ yarn add @comunica/utils-expression-evaluator
    
    • Expressions: Term and its subclasses (Literal, NumericLiteral, LangStringLiteral, DateTimeLiteral, ...), Operator, Aggregate, Existence and Variable, the representation that evaluation works on, together with the TermTransformer that creates terms from RDF/JS terms.
    • declare and its Builder: define a function with overloads, backed by an OverloadTree that resolves the implementation matching the argument types.
    • The type system: TypeURL, TypeAlias, KnownLiteralTypes, isSubTypeOf and typedLiteral.
    • The operator names known to Comunica: SparqlOperator, NamedOperator, KnownOperator and GeneralOperator.
    • ExpressionError and its subclasses, together with isExpressionError to recognize them. These are the errors that are expected during evaluation, and that FILTER and ORDER BY respond to differently.
    • Lexical form parsers and date arithmetic: parseDateTime, parseDuration, toUTCDate, addDurationToDateTime, ...
    • prepareEvaluatorActionContext: derives the context entries an evaluator needs from the ones it was given.

    SPARQL algebra expressions are transformed into the internal representation of this package by the AlgebraTransformer, after which the evaluator recursively evaluates them.

    Tests for functions built on these utilities are written as test tables; see @comunica/utils-jest.

    Enumerations

    SparqlOperator
    TypeAlias
    TypeURL

    Classes

    Aggregate
    BlankNode
    BooleanLiteral
    Builder
    CastError
    CoalesceError
    DateLiteral
    DateTimeLiteral
    DayTimeDurationLiteral
    DecimalLiteral
    DefaultGraph
    DirLangStringLiteral
    DoubleLiteral
    DurationLiteral
    EmptyAggregateError
    Existence
    ExpressionError
    ExtensionFunctionError
    FloatLiteral
    IncompatibleLanguageOperation
    InError
    IntegerLiteral
    InvalidArgumentTypes
    InvalidArity
    InvalidLexicalForm
    InvalidTimezoneCall
    LangStringLiteral
    Literal
    NamedNode
    NoAggregator
    NonLexicalLiteral
    NumericLiteral
    Operator
    OverloadTree
    Quad
    RDFEqualTypeError
    StringLiteral
    Term
    TermTransformer
    TimeLiteral
    UnboundVariableError
    Variable
    YearMonthDurationLiteral

    Interfaces

    ISerializable

    Type Aliases

    GeneralOperator
    KnownLiteralTypes
    KnownOperator
    NamedOperator

    Functions

    addDurationToDateTime
    bool
    dateTime
    dayTimeDurationsToSeconds
    decimal
    declare
    defaultedDateTimeRepresentation
    defaultedDayTimeDurationRepresentation
    defaultedDurationRepresentation
    defaultedYearMonthDurationRepresentation
    dirLangString
    double
    elapsedDuration
    expressionToVar
    extractRawTimeZone
    float
    integer
    isExpressionError
    isNonLexicalLiteral
    isSubTypeOf
    langString
    negateDuration
    nonLexicalComparisonHandler
    parseDate
    parseDateTime
    parseDayTimeDuration
    parseDuration
    parseTime
    parseXSDDecimal
    parseXSDFloat
    parseYearMonthDuration
    prepareEvaluatorActionContext
    string
    toDateTimeRepresentation
    toUTCDate
    trimToDayTimeDuration
    trimToYearMonthDuration
    typedLiteral
    yearMonthDurationsToMonths