Manta Developers
GitHub
Menu

@manta-eu/datalog-parser

Reference for @manta-eu/datalog-parser as it is on main, generated from its TypeScript sources.

The last release is 0.8.1. An export added on main since then arrives with the next release.

pnpm add @manta-eu/datalog-parser

Entry points

Classes

DatalogAstBuilder

Extends

Constructors

Constructor

new DatalogAstBuilder(…args): DatalogAstBuilder

Parameters
args

…any[]

Returns

DatalogAstBuilder

Inherited from

BaseDatalogVisitor.constructor

Methods

additiveExpression()

additiveExpression(children): DatalogExpression

Parameters
children

AdditiveExpressionCstChildren

Returns

DatalogExpression

aggregate()

aggregate(children): DatalogAggregate

Parameters
children

AggregateCstChildren

Returns

DatalogAggregate

aggregateBind()

aggregateBind(children): AggregateBinding

Parameters
children

AggregateBindCstChildren

Returns

AggregateBinding

aggregateFunction()

aggregateFunction(children): Omit<UnaryAggregateBinding, "variable" | "groundedTarget"> | Omit<BinaryAggregateBinding, "variable" | "groundedTarget"> | Omit<PercentileAggregateBinding, "variable" | "groundedTarget">

Parameters
children

AggregateFunctionCstChildren

Returns

Omit<UnaryAggregateBinding, "variable" | "groundedTarget"> | Omit<BinaryAggregateBinding, "variable" | "groundedTarget"> | Omit<PercentileAggregateBinding, "variable" | "groundedTarget">

aggregateFunction1()

aggregateFunction1(children): Omit<UnaryAggregateBinding, "variable" | "groundedTarget">

Parameters
children

AggregateFunction1CstChildren

Returns

Omit<UnaryAggregateBinding, "variable" | "groundedTarget">

aggregateFunction2()

aggregateFunction2(children): Omit<BinaryAggregateBinding, "variable" | "groundedTarget">

Parameters
children

AggregateFunction2CstChildren

Returns

Omit<BinaryAggregateBinding, "variable" | "groundedTarget">

argumentList()

argumentList(children): DatalogExpression[]

Parameters
children

ArgumentListCstChildren

Returns

DatalogExpression[]

asTarget()

asTarget(children, missingMessage): object

Parameters
children
groundedAsTarget?

CstNode[]

VARIABLE?

IToken[]

missingMessage

string

Returns

object

groundedTarget?

optional groundedTarget?: DatalogTerm

variable

variable: string

atom()

atom(children): DatalogAggregateAtom

Parameters
children

Record<string, CstNode[]>

Returns

DatalogAggregateAtom

atomList()

atomList(children): DatalogAggregateAtom[]

Parameters
children

AtomListCstChildren

Returns

DatalogAggregateAtom[]

bindAtom()

bindAtom(children): DatalogBind

Parameters
children

BindAtomCstChildren

Returns

DatalogBind

bodyFormula()

bodyFormula(children): DatalogBodyFormula

Parameters
children

BodyFormulaCstChildren

Returns

DatalogBodyFormula

bodyFormulaList()

bodyFormulaList(children): DatalogBodyFormula[]

Parameters
children

BodyFormulaListCstChildren

Returns

DatalogBodyFormula[]

booleanLiteral()

booleanLiteral(children): LiteralTerm

Parameters
children

BooleanLiteralCstChildren

Returns

LiteralTerm

concatFunction()

concatFunction(children): DatalogExpression

Parameters
children

ConcatFunctionCstChildren

Returns

DatalogExpression

conditionalAndExpression()

conditionalAndExpression(children): DatalogExpression

Parameters
children

ConditionalAndExpressionCstChildren

Returns

DatalogExpression

conditionalOrExpression()

conditionalOrExpression(children): DatalogExpression

Parameters
children

ConditionalOrExpressionCstChildren

Returns

DatalogExpression

defaultGraphAtom()

defaultGraphAtom(children): DatalogAtom

Parameters
children

DefaultGraphAtomCstChildren

Returns

DatalogAtom

existsClause()

existsClause(children): string[]

Parameters
children

ExistsClauseCstChildren

Returns

string[]

expression()

expression(children): DatalogExpression

Parameters
children

ExpressionCstChildren

Returns

DatalogExpression

filterAtom()

filterAtom(children): DatalogFilter

Parameters
children

FilterAtomCstChildren

Returns

DatalogFilter

functionCall()

functionCall(children): DatalogExpression

Parameters
children

FunctionCallCstChildren

Returns

DatalogExpression

generalAtom()

generalAtom(children): GeneralAtom

Parameters
children

GeneralAtomCstChildren

Returns

GeneralAtom

graphName()

graphName(children): DatalogTerm

Parameters
children

GraphNameCstChildren

Returns

DatalogTerm

groundedAsTarget()

groundedAsTarget(children): DatalogTerm

Parameters
children

GroundedAsTargetCstChildren

Returns

DatalogTerm

ifFunction()

ifFunction(children): DatalogExpression

Parameters
children

IfFunctionCstChildren

Returns

DatalogExpression

iri()

iri(children): IriTerm

Parameters
children

IriCstChildren

Returns

IriTerm

iriFunction()

iriFunction(children): DatalogExpression

Parameters
children

IriFunctionCstChildren

Returns

DatalogExpression

literal()

literal(children): LiteralTerm

Parameters
children

LiteralCstChildren

Returns

LiteralTerm

multiplicativeExpression()

multiplicativeExpression(children): DatalogExpression

Parameters
children

MultiplicativeExpressionCstChildren

Returns

DatalogExpression

negation()

negation(children): DatalogNegation

Parameters
children

NegationCstChildren

Returns

DatalogNegation

numericLiteral()

numericLiteral(children): LiteralTerm

Parameters
children

NumericLiteralCstChildren

Returns

LiteralTerm

onClause()

onClause(children): object

Parameters
children

OnClauseCstChildren

Returns

object

groundedOnTargets?

optional groundedOnTargets?: DatalogTerm[]

onVars

onVars: string[]

percentileFunction()

percentileFunction(children): Omit<PercentileAggregateBinding, "variable" | "groundedTarget">

Parameters
children

PercentileFunctionCstChildren

Returns

Omit<PercentileAggregateBinding, "variable" | "groundedTarget">

primaryExpression()

primaryExpression(children): DatalogExpression

Parameters
children

PrimaryExpressionCstChildren

Returns

DatalogExpression

regexFunction()

regexFunction(children): DatalogExpression

Parameters
children

RegexFunctionCstChildren

Returns

DatalogExpression

relationalExpression()

relationalExpression(children): DatalogExpression

Parameters
children

RelationalExpressionCstChildren

Returns

DatalogExpression

roundFunction()

roundFunction(children): DatalogExpression

Parameters
children

RoundFunctionCstChildren

Returns

DatalogExpression

rule()

rule(children): DatalogRuleAst

Parameters
children

RuleCstChildren

Returns

DatalogRuleAst

ruleBody()

ruleBody(children): DatalogBodyFormula[]

Parameters
children

RuleBodyCstChildren

Returns

DatalogBodyFormula[]

ruleHead()

ruleHead(children): DatalogAtom[]

Parameters
children

RuleHeadCstChildren

Returns

DatalogAtom[]

skolemAtom()

skolemAtom(children): DatalogSkolem

Parameters
children

SkolemAtomCstChildren

Returns

DatalogSkolem

skolemFunction()

skolemFunction(children): DatalogExpression

Parameters
children

SkolemFunctionCstChildren

Returns

DatalogExpression

strFunction()

strFunction(children): DatalogExpression

Parameters
children

StrFunctionCstChildren

Returns

DatalogExpression

stringLiteral()

stringLiteral(children): LiteralTerm

Parameters
children

StringLiteralCstChildren

Returns

LiteralTerm

term()

term(children): DatalogTerm

Parameters
children

TermCstChildren

Returns

DatalogTerm

tupleTableAtom()

tupleTableAtom(children): DatalogAtom

Parameters
children

TupleTableAtomCstChildren

Returns

DatalogAtom

unaryExpression()

unaryExpression(children): DatalogExpression

Parameters
children

UnaryExpressionCstChildren

Returns

DatalogExpression

validateVisitor()

validateVisitor(): void

Will throw an error if the visitor is missing any required methods

  • visitXYZ for each XYZ grammar rule.
Returns

void

Inherited from

BaseDatalogVisitor.validateVisitor

visit()

visit(cstNode, param?): any

Parameters
cstNode

CstNode | CstNode[]

param?

any

Returns

any

Inherited from

BaseDatalogVisitor.visit


DatalogParser

Extends

  • CstParser

Extended by

Constructors

Constructor

new DatalogParser(config?): DatalogParser

Parameters
config?

DatalogParserConfig = {}

Returns

DatalogParser

Overrides

CstParser.constructor

Properties

aggregateBind

protected aggregateBind: ParserMethod<[], CstNode>

aggregateFunction

protected aggregateFunction: ParserMethod<[], CstNode>

aggregateFunction1

protected aggregateFunction1: ParserMethod<[], CstNode>

aggregateFunction2

protected aggregateFunction2: ParserMethod<[], CstNode>

atomList

protected atomList: ParserMethod<[], CstNode>

bindAtom

protected bindAtom: ParserMethod<[], CstNode>

errors

errors: IRecognitionException[]

Inherited from

CstParser.errors

expression

protected expression: ParserMethod<[], CstNode>

functionCall

protected functionCall: ParserMethod<[], CstNode>

iri

protected iri: ParserMethod<[], CstNode>

literal

protected literal: ParserMethod<[], CstNode>

onClause

protected onClause: ParserMethod<[], CstNode>

percentileFunction

protected percentileFunction: ParserMethod<[], CstNode>

primaryExpression

protected primaryExpression: ParserMethod<[], CstNode>

RECORDING_PHASE

RECORDING_PHASE: boolean

Flag indicating the Parser is at the recording phase. Can be used to implement methods similar to BaseParser.ACTION Or any other logic to requires knowledge of the recording phase. See:

Inherited from

CstParser.RECORDING_PHASE

rule

rule: ParserMethod<[], CstNode>

term

term: ParserMethod<[], CstNode>

Accessors

atEndOfInput
Get Signature

get atEndOfInput(): boolean

Returns

boolean

input
Get Signature

get input(): IToken[]

Returns

IToken[]

Set Signature

set input(value): void

Parameters
value

IToken[]

Returns

void

Inherited from

CstParser.input

Methods

ACTION()

protected ACTION<T>(impl): T

The Semantic Actions wrapper. Should be used to wrap semantic actions that either:

  • May fail when executing in “recording phase”.
  • Have global side effects that should be avoided during “recording phase”.

For more information see:

Type Parameters
T

T

Parameters
impl

() => T

Returns

T

Inherited from

CstParser.ACTION

AT_LEAST_ONE()

protected AT_LEAST_ONE(actionORMethodDef): void

Convenience method, same as MANY but the repetition is of one or more. failing to match at least one repetition will result in a parsing error and cause a parsing error.

Parameters
actionORMethodDef

GrammarAction<any> | DSLMethodOptsWithErr<any>

The grammar action to optionally invoke multiple times or an “OPTIONS” object describing the grammar action and optional properties.

Returns

void

See

MANY

Inherited from

CstParser.AT_LEAST_ONE

AT_LEAST_ONE_SEP()

protected AT_LEAST_ONE_SEP(options): void

Convenience method, same as MANY_SEP but the repetition is of one or more. failing to match at least one repetition will result in a parsing error and cause the parser to attempt error recovery.

Note that an additional optional property ERR_MSG can be used to provide custom error messages.

Parameters
options

AtLeastOneSepMethodOpts<any>

An object defining the grammar of each iteration and the separator between iterations

Returns

void

See

MANY_SEP

Inherited from

CstParser.AT_LEAST_ONE_SEP

atLeastOne()

protected atLeastOne(idx, actionORMethodDef): void

Like AT_LEAST_ONE with the numerical suffix as a parameter, e.g: atLeastOne(0, X) === AT_LEAST_ONE(X) atLeastOne(1, X) === AT_LEAST_ONE1(X) atLeastOne(2, X) === AT_LEAST_ONE2(X) …

Parameters
idx

number

actionORMethodDef

GrammarAction<any> | DSLMethodOptsWithErr<any>

Returns

void

See

AT_LEAST_ONE

Inherited from

CstParser.atLeastOne

BACKTRACK()

protected BACKTRACK<T>(grammarRule, args?): () => boolean

Type Parameters
T

T

Parameters
grammarRule

(…args) => T

The rule to try and parse in backtracking mode.

args?

any[]

argument to be passed to the grammar rule execution

Returns

a lookahead function that will try to parse the given grammarRule and will return true if succeed.

() => boolean

Inherited from

CstParser.BACKTRACK

canTokenTypeBeDeletedInRecovery()

protected canTokenTypeBeDeletedInRecovery(tokType): boolean

By default, all token types may be deleted. This behavior may be overridden in inheriting parsers. The method receives the expected token type. The token that would be deleted can be received with LA.

Parameters
tokType

TokenType

Returns

boolean

Inherited from

CstParser.canTokenTypeBeDeletedInRecovery

canTokenTypeBeInsertedInRecovery()

protected canTokenTypeBeInsertedInRecovery(tokType): boolean

By default, all tokens type may be inserted. This behavior may be overridden in inheriting Recognizers for example: One may decide that only punctuation tokens may be inserted automatically as they have no additional semantic value. (A mandatory semicolon has no additional semantic meaning, but an Integer may have additional meaning depending on its int value and context (Inserting an integer 0 in cardinality: “[1..]” will cause semantic issues as the max of the cardinality will be greater than the min value (and this is a false error!).

Parameters
tokType

TokenType

Returns

boolean

Inherited from

CstParser.canTokenTypeBeInsertedInRecovery

computeContentAssist()

computeContentAssist(startRuleName, precedingInput): ISyntacticContentAssistPath[]

Parameters
startRuleName

string

precedingInput

IToken[]

The token vector up to (not including) the content assist point

Returns

ISyntacticContentAssistPath[]

Inherited from

CstParser.computeContentAssist

consume()

protected consume(idx, tokType, options?): IToken

Like CONSUME with the numerical suffix as a parameter, e.g: consume(0, X) === CONSUME(X) consume(1, X) === CONSUME1(X) consume(2, X) === CONSUME2(X) …

Parameters
idx

number

tokType

TokenType

options?

ConsumeMethodOpts

Returns

IToken

See

CONSUME

Inherited from

CstParser.consume

CONSUME()

protected CONSUME(tokType, options?): IToken

A Parsing DSL method use to consume a single Token. In EBNF terms this is equivalent to a Terminal.

A Token will be consumed, IFF the next token in the token vector matches tokType. otherwise the parser may attempt to perform error recovery (if enabled).

The index in the method name indicates the unique occurrence of a terminal consumption inside a the top level rule. What this means is that if a terminal appears more than once in a single rule, each appearance must have a different index.

For example:

  this.RULE("qualifiedName", () => {
  this.CONSUME1(Identifier);
    this.MANY(() => {
      this.CONSUME1(Dot);
      // here we use CONSUME2 because the terminal
      // 'Identifier' has already appeared previously in the
      // the rule 'parseQualifiedName'
      this.CONSUME2(Identifier);
    });
  })
Parameters
tokType

TokenType

The Type of the token to be consumed.

options?

ConsumeMethodOpts

optional properties to modify the behavior of CONSUME.

Returns

IToken

Inherited from

CstParser.CONSUME

getBaseCstVisitorConstructor()

getBaseCstVisitorConstructor<IN, OUT>(): new (…args) => ICstVisitor<IN, OUT>

Type Parameters
IN

IN = any

OUT

OUT = any

Returns

new (…args) => ICstVisitor<IN, OUT>

Inherited from

CstParser.getBaseCstVisitorConstructor

getBaseCstVisitorConstructorWithDefaults()

getBaseCstVisitorConstructorWithDefaults<IN, OUT>(): new (…args) => ICstVisitor<IN, OUT>

Type Parameters
IN

IN = any

OUT

OUT = any

Returns

new (…args) => ICstVisitor<IN, OUT>

Inherited from

CstParser.getBaseCstVisitorConstructorWithDefaults

getGAstProductions()

getGAstProductions(): Record<string, Rule>

Returns

Record<string, Rule>

Inherited from

CstParser.getGAstProductions

getNextPossibleTokenTypes()

protected getNextPossibleTokenTypes(grammarPath): TokenType[]

Parameters
grammarPath

ITokenGrammarPath

Returns

TokenType[]

Deprecated
  • will be removed in the future
Inherited from

CstParser.getNextPossibleTokenTypes

getSerializedGastProductions()

getSerializedGastProductions(): ISerializedGast[]

Returns

ISerializedGast[]

Inherited from

CstParser.getSerializedGastProductions

getTokenToInsert()

protected getTokenToInsert(tokType): IToken

Returns an “imaginary” Token to insert when Single Token Insertion is done Override this if you require special behavior in your grammar. For example if an IntegerToken is required provide one with the image ‘0’ so it would be valid syntactically.

Parameters
tokType

TokenType

Returns

IToken

Inherited from

CstParser.getTokenToInsert

LA()

protected LA(howMuch): IToken

Look-Ahead for the Token Vector LA(1) is the next Token ahead. LA(n) is the nth Token ahead. LA(0) is the previously consumed Token.

Looking beyond the end of the Token Vector or before its beginning will return in an IToken of type EOF EOF. This behavior can be used to avoid infinite loops.

This is often used to implement custom lookahead logic for GATES. https://chevrotain.io/docs/features/gates.html

Parameters
howMuch

number

Returns

IToken

Inherited from

CstParser.LA

many()

protected many(idx, actionORMethodDef): void

Like MANY with the numerical suffix as a parameter, e.g: many(0, X) === MANY(X) many(1, X) === MANY1(X) many(2, X) === MANY2(X) …

Parameters
idx

number

actionORMethodDef

GrammarAction<any> | DSLMethodOpts<any>

Returns

void

See

MANY

Inherited from

CstParser.many

MANY()

protected MANY(actionORMethodDef): void

Parsing DSL method, that indicates a repetition of zero or more. This is equivalent to EBNF repetition {…}.

Note that there are two syntax forms:

  • Passing the grammar action directly:

      this.MANY(() => {
        this.CONSUME(Comma)
        this.CONSUME(Digit)
       })
  • using an “options” object:

      this.MANY({
        GATE: predicateFunc,
        DEF: () => {
               this.CONSUME(Comma)
               this.CONSUME(Digit)
             }
      });

The optional ‘GATE’ property in “options” object form can be used to add constraints to invoking the grammar action.

As in CONSUME the index in the method name indicates the occurrence of the repetition production in it’s top rule.

Parameters
actionORMethodDef

GrammarAction<any> | DSLMethodOpts<any>

The grammar action to optionally invoke multiple times or an “OPTIONS” object describing the grammar action and optional properties.

Returns

void

Inherited from

CstParser.MANY

MANY_SEP()

protected MANY_SEP(options): void

Parsing DSL method, that indicates a repetition of zero or more with a separator Token between the repetitions.

Example:

    this.MANY_SEP({
        SEP:Comma,
        DEF: () => {
            this.CONSUME(Number};
            // ...
        })

Note that because this DSL method always requires more than one argument the options object is always required and it is not possible to use a shorter form like in the MANY DSL method.

Note that for the purposes of deciding on whether or not another iteration exists Only a single Token is examined (The separator). Therefore if the grammar being implemented is so “crazy” to require multiple tokens to identify an item separator please use the more basic DSL methods to implement it.

As in CONSUME the index in the method name indicates the occurrence of the repetition production in it’s top rule.

Parameters
options

ManySepMethodOpts<any>

An object defining the grammar of each iteration and the separator between iterations

Returns

void

Inherited from

CstParser.MANY_SEP

option()

protected option<OUT>(idx, actionORMethodDef): OUT | undefined

Like OPTION with the numerical suffix as a parameter, e.g: option(0, X) === OPTION(X) option(1, X) === OPTION1(X) option(2, X) === OPTION2(X) …

Type Parameters
OUT

OUT

Parameters
idx

number

actionORMethodDef

GrammarAction<OUT> | DSLMethodOpts<OUT>

Returns

OUT | undefined

See

OPTION

Inherited from

CstParser.option

OPTION()

protected OPTION<OUT>(actionORMethodDef): OUT | undefined

Parsing DSL Method that Indicates an Optional production. in EBNF notation this is equivalent to: “[…]”.

Note that there are two syntax forms:

  • Passing the grammar action directly:

      this.OPTION(() => {
        this.CONSUME(Digit)}
      );
  • using an “options” object:

      this.OPTION({
        GATE:predicateFunc,
        DEF: () => {
          this.CONSUME(Digit)
      }});

The optional ‘GATE’ property in “options” object form can be used to add constraints to invoking the grammar action.

As in CONSUME the index in the method name indicates the occurrence of the optional production in it’s top rule.

Type Parameters
OUT

OUT

Parameters
actionORMethodDef

GrammarAction<OUT> | DSLMethodOpts<OUT>

The grammar action to optionally invoke once or an “OPTIONS” object describing the grammar action and optional properties.

Returns

OUT | undefined

The GrammarAction return value (OUT) if the optional syntax is encountered or undefined if not.

Inherited from

CstParser.OPTION

or()
Call Signature

protected or(idx, altsOrOpts): any

Like OR with the numerical suffix as a parameter, e.g: or(0, X) === OR(X) or(1, X) === OR1(X) or(2, X) === OR2(X) …

Parameters
idx

number

altsOrOpts

IOrAlt<any>[] | OrMethodOpts<any>

Returns

any

See

OR

Inherited from

CstParser.or

Call Signature

protected or<T>(idx, altsOrOpts): T

Like OR with the numerical suffix as a parameter, e.g: or(0, X) === OR(X) or(1, X) === OR1(X) or(2, X) === OR2(X) …

Type Parameters
T

T

Parameters
idx

number

altsOrOpts

IOrAlt<T>[] | OrMethodOpts<T>

Returns

T

See

OR

Inherited from

CstParser.or

OR()
Call Signature

protected OR<T>(altsOrOpts): T

Parsing DSL method that indicates a choice between a set of alternatives must be made. This is equivalent to an EBNF alternation (A | B | C | D …), except that the alternatives are ordered like in a PEG grammar. This means that the first matching alternative is always chosen.

There are several forms for the inner alternatives array:

  • Passing alternatives array directly:

      this.OR([
        { ALT:() => { this.CONSUME(One) }},
        { ALT:() => { this.CONSUME(Two) }},
        { ALT:() => { this.CONSUME(Three) }}
      ])
  • Passing alternative array directly with predicates (GATE):

      this.OR([
        { GATE: predicateFunc1, ALT:() => { this.CONSUME(One) }},
        { GATE: predicateFuncX, ALT:() => { this.CONSUME(Two) }},
        { GATE: predicateFuncX, ALT:() => { this.CONSUME(Three) }}
      ])
  • These syntax forms can also be mixed:

      this.OR([
        {
          GATE: predicateFunc1,
          ALT:() => { this.CONSUME(One) }
        },
        { ALT:() => { this.CONSUME(Two) }},
        { ALT:() => { this.CONSUME(Three) }}
      ])
  • Additionally an “options” object may be used:

      this.OR({
        DEF:[
          { ALT:() => { this.CONSUME(One) }},
          { ALT:() => { this.CONSUME(Two) }},
          { ALT:() => { this.CONSUME(Three) }}
        ],
        // OPTIONAL property
        ERR_MSG: "A Number"
      })

The ‘predicateFuncX’ in the long form can be used to add constraints to choosing the alternative.

As in CONSUME the index in the method name indicates the occurrence of the alternation production in it’s top rule.

Type Parameters
T

T

Parameters
altsOrOpts

IOrAlt<T>[] | OrMethodOpts<T>

A set of alternatives or an “OPTIONS” object describing the alternatives and optional properties.

Returns

T

The result of invoking the chosen alternative.

Inherited from

CstParser.OR

Call Signature

protected OR(altsOrOpts): any

Parsing DSL method that indicates a choice between a set of alternatives must be made. This is equivalent to an EBNF alternation (A | B | C | D …), except that the alternatives are ordered like in a PEG grammar. This means that the first matching alternative is always chosen.

There are several forms for the inner alternatives array:

  • Passing alternatives array directly:

      this.OR([
        { ALT:() => { this.CONSUME(One) }},
        { ALT:() => { this.CONSUME(Two) }},
        { ALT:() => { this.CONSUME(Three) }}
      ])
  • Passing alternative array directly with predicates (GATE):

      this.OR([
        { GATE: predicateFunc1, ALT:() => { this.CONSUME(One) }},
        { GATE: predicateFuncX, ALT:() => { this.CONSUME(Two) }},
        { GATE: predicateFuncX, ALT:() => { this.CONSUME(Three) }}
      ])
  • These syntax forms can also be mixed:

      this.OR([
        {
          GATE: predicateFunc1,
          ALT:() => { this.CONSUME(One) }
        },
        { ALT:() => { this.CONSUME(Two) }},
        { ALT:() => { this.CONSUME(Three) }}
      ])
  • Additionally an “options” object may be used:

      this.OR({
        DEF:[
          { ALT:() => { this.CONSUME(One) }},
          { ALT:() => { this.CONSUME(Two) }},
          { ALT:() => { this.CONSUME(Three) }}
        ],
        // OPTIONAL property
        ERR_MSG: "A Number"
      })

The ‘predicateFuncX’ in the long form can be used to add constraints to choosing the alternative.

As in CONSUME the index in the method name indicates the occurrence of the alternation production in it’s top rule.

Parameters
altsOrOpts

IOrAlt<any>[] | OrMethodOpts<any>

A set of alternatives or an “OPTIONS” object describing the alternatives and optional properties.

Returns

any

The result of invoking the chosen alternative.

Inherited from

CstParser.OR

OVERRIDE_RULE()

protected OVERRIDE_RULE<F>(name, implementation, config?): ParserMethod<Parameters<F>, CstNode>

Overrides a Grammar Rule See usage example in: https://github.com/chevrotain/chevrotain/blob/master/examples/parser/versioning/versioning.js

Type Parameters
F

F extends () => void

Parameters
name

string

implementation

F

config?

IRuleConfig<CstNode>

Returns

ParserMethod<Parameters<F>, CstNode>

Inherited from

CstParser.OVERRIDE_RULE

performSelfAnalysis()

protected performSelfAnalysis(): void

This must be called at the end of a Parser constructor. See: http://chevrotain.io/docs/tutorial/step2_parsing.html#under-the-hood

Returns

void

Inherited from

CstParser.performSelfAnalysis

reset()

reset(): void

Resets the parser state, should be overridden for custom parsers which “carry” additional state. When overriding, remember to also invoke the super implementation!

Returns

void

Inherited from

CstParser.reset

RULE()

protected RULE<F>(name, implementation, config?): ParserMethod<Parameters<F>, CstNode>

Creates a Grammar Rule

Note that any parameters of your implementation must be optional as it will be called without parameters during the grammar recording phase.

Type Parameters
F

F extends () => void

Parameters
name

string

implementation

F

config?

IRuleConfig<CstNode>

Returns

ParserMethod<Parameters<F>, CstNode>

Inherited from

CstParser.RULE

SKIP_TOKEN()

protected SKIP_TOKEN(): IToken

Will consume a single token and return the next token, meaning the token after the skipped token.

Returns

IToken

Inherited from

CstParser.SKIP_TOKEN

subrule()

protected subrule<ARGS>(idx, ruleToCall, options?): CstNode

Like SUBRULE with the numerical suffix as a parameter, e.g: subrule(0, X) === SUBRULE(X) subrule(1, X) === SUBRULE1(X) subrule(2, X) === SUBRULE2(X) …

Type Parameters
ARGS

ARGS extends unknown[]

Parameters
idx

number

ruleToCall

ParserMethod<ARGS, CstNode>

options?

SubruleMethodOpts<ARGS>

Returns

CstNode

See

SUBRULE

Inherited from

CstParser.subrule

SUBRULE()

protected SUBRULE<ARGS>(ruleToCall, options?): CstNode

The Parsing DSL Method is used by one rule to call another. It is equivalent to a non-Terminal in EBNF notation.

This may seem redundant as it does not actually do much. However using it is mandatory for all sub rule invocations.

Calling another rule without wrapping in SUBRULE(…) will cause errors/mistakes in the Parser’s self analysis phase, which will lead to errors in error recovery/automatic lookahead calculation and any other functionality relying on the Parser’s self analysis output.

As in CONSUME the index in the method name indicates the occurrence of the sub rule invocation in its rule.

Type Parameters
ARGS

ARGS extends unknown[]

Parameters
ruleToCall

ParserMethod<ARGS, CstNode>

options?

SubruleMethodOpts<ARGS>

Returns

CstNode

Inherited from

CstParser.SUBRULE


DatalogTokenError

A rule error located at one token, so the editor can underline it.

Extends

  • Error

Constructors

Constructor

new DatalogTokenError(message, token): DatalogTokenError

Parameters
message

string

token

IToken

Returns

DatalogTokenError

Overrides

Error.constructor

Properties

cause?

optional cause?: unknown

Inherited from

Error.cause

message

message: string

Inherited from

Error.message

name

name: string

Inherited from

Error.name

stack?

optional stack?: string

Inherited from

Error.stack

token

readonly token: IToken

stackTraceLimit

static stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

Error.stackTraceLimit

Methods

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

Error.captureStackTrace

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

Error.prepareStackTrace


ExpandedDatalogParser

Grammar variant for the grounded rules the engine returns.

Grounding substitutes an AS target with the value it computed, so BIND(?spend > 500 AS ?highSpend) comes back as BIND(901.22 > 500 AS true). It also emits atom-free aggregates (AGGREGATE(AVG(9.0) AS 9.0)) and expression-only bindings (AGGREGATE(13 / 100 AS 0.13)). That is not valid authored Datalog, and rules written by hand or by the agent must keep being rejected, so the permissive grammar lives here rather than relaxing the strict one.

Extends

Constructors

Constructor

new ExpandedDatalogParser(): ExpandedDatalogParser

Returns

ExpandedDatalogParser

Overrides

DatalogParser.constructor

Properties

aggregateBind

protected aggregateBind: ParserMethod<[], CstNode>

Inherited from

DatalogParser.aggregateBind

aggregateFunction

protected aggregateFunction: ParserMethod<[], CstNode>

Inherited from

DatalogParser.aggregateFunction

aggregateFunction1

protected aggregateFunction1: ParserMethod<[], CstNode>

Inherited from

DatalogParser.aggregateFunction1

aggregateFunction2

protected aggregateFunction2: ParserMethod<[], CstNode>

Inherited from

DatalogParser.aggregateFunction2

atomList

protected atomList: ParserMethod<[], CstNode>

Inherited from

DatalogParser.atomList

bindAtom

protected bindAtom: ParserMethod<[], CstNode>

Inherited from

DatalogParser.bindAtom

errors

errors: IRecognitionException[]

Inherited from

DatalogParser.errors

expandedAggregate

protected expandedAggregate: ParserMethod<[], CstNode>

expandedAggregateBind

protected expandedAggregateBind: ParserMethod<[], CstNode>

expandedBindAtom

protected expandedBindAtom: ParserMethod<[], CstNode>

expandedOnClause

protected expandedOnClause: ParserMethod<[], CstNode>

expandedPrimaryExpression

protected expandedPrimaryExpression: ParserMethod<[], CstNode>

expression

protected expression: ParserMethod<[], CstNode>

Inherited from

DatalogParser.expression

functionCall

protected functionCall: ParserMethod<[], CstNode>

Inherited from

DatalogParser.functionCall

groundedAsTarget

protected groundedAsTarget: ParserMethod<[], CstNode>

iri

protected iri: ParserMethod<[], CstNode>

Inherited from

DatalogParser.iri

literal

protected literal: ParserMethod<[], CstNode>

Inherited from

DatalogParser.literal

onClause

protected onClause: ParserMethod<[], CstNode>

Inherited from

DatalogParser.onClause

percentileFunction

protected percentileFunction: ParserMethod<[], CstNode>

Inherited from

DatalogParser.percentileFunction

primaryExpression

protected primaryExpression: ParserMethod<[], CstNode>

Inherited from

DatalogParser.primaryExpression

RECORDING_PHASE

RECORDING_PHASE: boolean

Flag indicating the Parser is at the recording phase. Can be used to implement methods similar to BaseParser.ACTION Or any other logic to requires knowledge of the recording phase. See:

Inherited from

DatalogParser.RECORDING_PHASE

rule

rule: ParserMethod<[], CstNode>

Inherited from

DatalogParser.rule

term

term: ParserMethod<[], CstNode>

Inherited from

DatalogParser.term

Accessors

atEndOfInput
Get Signature

get atEndOfInput(): boolean

Returns

boolean

Inherited from

DatalogParser.atEndOfInput

input
Get Signature

get input(): IToken[]

Returns

IToken[]

Set Signature

set input(value): void

Parameters
value

IToken[]

Returns

void

Inherited from

DatalogParser.input

Methods

ACTION()

protected ACTION<T>(impl): T

The Semantic Actions wrapper. Should be used to wrap semantic actions that either:

  • May fail when executing in “recording phase”.
  • Have global side effects that should be avoided during “recording phase”.

For more information see:

Type Parameters
T

T

Parameters
impl

() => T

Returns

T

Inherited from

DatalogParser.ACTION

AT_LEAST_ONE()

protected AT_LEAST_ONE(actionORMethodDef): void

Convenience method, same as MANY but the repetition is of one or more. failing to match at least one repetition will result in a parsing error and cause a parsing error.

Parameters
actionORMethodDef

GrammarAction<any> | DSLMethodOptsWithErr<any>

The grammar action to optionally invoke multiple times or an “OPTIONS” object describing the grammar action and optional properties.

Returns

void

See

MANY

Inherited from

DatalogParser.AT_LEAST_ONE

AT_LEAST_ONE_SEP()

protected AT_LEAST_ONE_SEP(options): void

Convenience method, same as MANY_SEP but the repetition is of one or more. failing to match at least one repetition will result in a parsing error and cause the parser to attempt error recovery.

Note that an additional optional property ERR_MSG can be used to provide custom error messages.

Parameters
options

AtLeastOneSepMethodOpts<any>

An object defining the grammar of each iteration and the separator between iterations

Returns

void

See

MANY_SEP

Inherited from

DatalogParser.AT_LEAST_ONE_SEP

atLeastOne()

protected atLeastOne(idx, actionORMethodDef): void

Like AT_LEAST_ONE with the numerical suffix as a parameter, e.g: atLeastOne(0, X) === AT_LEAST_ONE(X) atLeastOne(1, X) === AT_LEAST_ONE1(X) atLeastOne(2, X) === AT_LEAST_ONE2(X) …

Parameters
idx

number

actionORMethodDef

GrammarAction<any> | DSLMethodOptsWithErr<any>

Returns

void

See

AT_LEAST_ONE

Inherited from

DatalogParser.atLeastOne

BACKTRACK()

protected BACKTRACK<T>(grammarRule, args?): () => boolean

Type Parameters
T

T

Parameters
grammarRule

(…args) => T

The rule to try and parse in backtracking mode.

args?

any[]

argument to be passed to the grammar rule execution

Returns

a lookahead function that will try to parse the given grammarRule and will return true if succeed.

() => boolean

Inherited from

DatalogParser.BACKTRACK

canTokenTypeBeDeletedInRecovery()

protected canTokenTypeBeDeletedInRecovery(tokType): boolean

By default, all token types may be deleted. This behavior may be overridden in inheriting parsers. The method receives the expected token type. The token that would be deleted can be received with LA.

Parameters
tokType

TokenType

Returns

boolean

Inherited from

DatalogParser.canTokenTypeBeDeletedInRecovery

canTokenTypeBeInsertedInRecovery()

protected canTokenTypeBeInsertedInRecovery(tokType): boolean

By default, all tokens type may be inserted. This behavior may be overridden in inheriting Recognizers for example: One may decide that only punctuation tokens may be inserted automatically as they have no additional semantic value. (A mandatory semicolon has no additional semantic meaning, but an Integer may have additional meaning depending on its int value and context (Inserting an integer 0 in cardinality: “[1..]” will cause semantic issues as the max of the cardinality will be greater than the min value (and this is a false error!).

Parameters
tokType

TokenType

Returns

boolean

Inherited from

DatalogParser.canTokenTypeBeInsertedInRecovery

computeContentAssist()

computeContentAssist(startRuleName, precedingInput): ISyntacticContentAssistPath[]

Parameters
startRuleName

string

precedingInput

IToken[]

The token vector up to (not including) the content assist point

Returns

ISyntacticContentAssistPath[]

Inherited from

DatalogParser.computeContentAssist

consume()

protected consume(idx, tokType, options?): IToken

Like CONSUME with the numerical suffix as a parameter, e.g: consume(0, X) === CONSUME(X) consume(1, X) === CONSUME1(X) consume(2, X) === CONSUME2(X) …

Parameters
idx

number

tokType

TokenType

options?

ConsumeMethodOpts

Returns

IToken

See

CONSUME

Inherited from

DatalogParser.consume

CONSUME()

protected CONSUME(tokType, options?): IToken

A Parsing DSL method use to consume a single Token. In EBNF terms this is equivalent to a Terminal.

A Token will be consumed, IFF the next token in the token vector matches tokType. otherwise the parser may attempt to perform error recovery (if enabled).

The index in the method name indicates the unique occurrence of a terminal consumption inside a the top level rule. What this means is that if a terminal appears more than once in a single rule, each appearance must have a different index.

For example:

  this.RULE("qualifiedName", () => {
  this.CONSUME1(Identifier);
    this.MANY(() => {
      this.CONSUME1(Dot);
      // here we use CONSUME2 because the terminal
      // 'Identifier' has already appeared previously in the
      // the rule 'parseQualifiedName'
      this.CONSUME2(Identifier);
    });
  })
Parameters
tokType

TokenType

The Type of the token to be consumed.

options?

ConsumeMethodOpts

optional properties to modify the behavior of CONSUME.

Returns

IToken

Inherited from

DatalogParser.CONSUME

getBaseCstVisitorConstructor()

getBaseCstVisitorConstructor<IN, OUT>(): new (…args) => ICstVisitor<IN, OUT>

Type Parameters
IN

IN = any

OUT

OUT = any

Returns

new (…args) => ICstVisitor<IN, OUT>

Inherited from

DatalogParser.getBaseCstVisitorConstructor

getBaseCstVisitorConstructorWithDefaults()

getBaseCstVisitorConstructorWithDefaults<IN, OUT>(): new (…args) => ICstVisitor<IN, OUT>

Type Parameters
IN

IN = any

OUT

OUT = any

Returns

new (…args) => ICstVisitor<IN, OUT>

Inherited from

DatalogParser.getBaseCstVisitorConstructorWithDefaults

getGAstProductions()

getGAstProductions(): Record<string, Rule>

Returns

Record<string, Rule>

Inherited from

DatalogParser.getGAstProductions

getNextPossibleTokenTypes()

protected getNextPossibleTokenTypes(grammarPath): TokenType[]

Parameters
grammarPath

ITokenGrammarPath

Returns

TokenType[]

Deprecated
  • will be removed in the future
Inherited from

DatalogParser.getNextPossibleTokenTypes

getSerializedGastProductions()

getSerializedGastProductions(): ISerializedGast[]

Returns

ISerializedGast[]

Inherited from

DatalogParser.getSerializedGastProductions

getTokenToInsert()

protected getTokenToInsert(tokType): IToken

Returns an “imaginary” Token to insert when Single Token Insertion is done Override this if you require special behavior in your grammar. For example if an IntegerToken is required provide one with the image ‘0’ so it would be valid syntactically.

Parameters
tokType

TokenType

Returns

IToken

Inherited from

DatalogParser.getTokenToInsert

LA()

protected LA(howMuch): IToken

Look-Ahead for the Token Vector LA(1) is the next Token ahead. LA(n) is the nth Token ahead. LA(0) is the previously consumed Token.

Looking beyond the end of the Token Vector or before its beginning will return in an IToken of type EOF EOF. This behavior can be used to avoid infinite loops.

This is often used to implement custom lookahead logic for GATES. https://chevrotain.io/docs/features/gates.html

Parameters
howMuch

number

Returns

IToken

Inherited from

DatalogParser.LA

many()

protected many(idx, actionORMethodDef): void

Like MANY with the numerical suffix as a parameter, e.g: many(0, X) === MANY(X) many(1, X) === MANY1(X) many(2, X) === MANY2(X) …

Parameters
idx

number

actionORMethodDef

GrammarAction<any> | DSLMethodOpts<any>

Returns

void

See

MANY

Inherited from

DatalogParser.many

MANY()

protected MANY(actionORMethodDef): void

Parsing DSL method, that indicates a repetition of zero or more. This is equivalent to EBNF repetition {…}.

Note that there are two syntax forms:

  • Passing the grammar action directly:

      this.MANY(() => {
        this.CONSUME(Comma)
        this.CONSUME(Digit)
       })
  • using an “options” object:

      this.MANY({
        GATE: predicateFunc,
        DEF: () => {
               this.CONSUME(Comma)
               this.CONSUME(Digit)
             }
      });

The optional ‘GATE’ property in “options” object form can be used to add constraints to invoking the grammar action.

As in CONSUME the index in the method name indicates the occurrence of the repetition production in it’s top rule.

Parameters
actionORMethodDef

GrammarAction<any> | DSLMethodOpts<any>

The grammar action to optionally invoke multiple times or an “OPTIONS” object describing the grammar action and optional properties.

Returns

void

Inherited from

DatalogParser.MANY

MANY_SEP()

protected MANY_SEP(options): void

Parsing DSL method, that indicates a repetition of zero or more with a separator Token between the repetitions.

Example:

    this.MANY_SEP({
        SEP:Comma,
        DEF: () => {
            this.CONSUME(Number};
            // ...
        })

Note that because this DSL method always requires more than one argument the options object is always required and it is not possible to use a shorter form like in the MANY DSL method.

Note that for the purposes of deciding on whether or not another iteration exists Only a single Token is examined (The separator). Therefore if the grammar being implemented is so “crazy” to require multiple tokens to identify an item separator please use the more basic DSL methods to implement it.

As in CONSUME the index in the method name indicates the occurrence of the repetition production in it’s top rule.

Parameters
options

ManySepMethodOpts<any>

An object defining the grammar of each iteration and the separator between iterations

Returns

void

Inherited from

DatalogParser.MANY_SEP

option()

protected option<OUT>(idx, actionORMethodDef): OUT | undefined

Like OPTION with the numerical suffix as a parameter, e.g: option(0, X) === OPTION(X) option(1, X) === OPTION1(X) option(2, X) === OPTION2(X) …

Type Parameters
OUT

OUT

Parameters
idx

number

actionORMethodDef

GrammarAction<OUT> | DSLMethodOpts<OUT>

Returns

OUT | undefined

See

OPTION

Inherited from

DatalogParser.option

OPTION()

protected OPTION<OUT>(actionORMethodDef): OUT | undefined

Parsing DSL Method that Indicates an Optional production. in EBNF notation this is equivalent to: “[…]”.

Note that there are two syntax forms:

  • Passing the grammar action directly:

      this.OPTION(() => {
        this.CONSUME(Digit)}
      );
  • using an “options” object:

      this.OPTION({
        GATE:predicateFunc,
        DEF: () => {
          this.CONSUME(Digit)
      }});

The optional ‘GATE’ property in “options” object form can be used to add constraints to invoking the grammar action.

As in CONSUME the index in the method name indicates the occurrence of the optional production in it’s top rule.

Type Parameters
OUT

OUT

Parameters
actionORMethodDef

GrammarAction<OUT> | DSLMethodOpts<OUT>

The grammar action to optionally invoke once or an “OPTIONS” object describing the grammar action and optional properties.

Returns

OUT | undefined

The GrammarAction return value (OUT) if the optional syntax is encountered or undefined if not.

Inherited from

DatalogParser.OPTION

or()
Call Signature

protected or(idx, altsOrOpts): any

Like OR with the numerical suffix as a parameter, e.g: or(0, X) === OR(X) or(1, X) === OR1(X) or(2, X) === OR2(X) …

Parameters
idx

number

altsOrOpts

IOrAlt<any>[] | OrMethodOpts<any>

Returns

any

See

OR

Inherited from

DatalogParser.or

Call Signature

protected or<T>(idx, altsOrOpts): T

Like OR with the numerical suffix as a parameter, e.g: or(0, X) === OR(X) or(1, X) === OR1(X) or(2, X) === OR2(X) …

Type Parameters
T

T

Parameters
idx

number

altsOrOpts

IOrAlt<T>[] | OrMethodOpts<T>

Returns

T

See

OR

Inherited from

DatalogParser.or

OR()
Call Signature

protected OR<T>(altsOrOpts): T

Parsing DSL method that indicates a choice between a set of alternatives must be made. This is equivalent to an EBNF alternation (A | B | C | D …), except that the alternatives are ordered like in a PEG grammar. This means that the first matching alternative is always chosen.

There are several forms for the inner alternatives array:

  • Passing alternatives array directly:

      this.OR([
        { ALT:() => { this.CONSUME(One) }},
        { ALT:() => { this.CONSUME(Two) }},
        { ALT:() => { this.CONSUME(Three) }}
      ])
  • Passing alternative array directly with predicates (GATE):

      this.OR([
        { GATE: predicateFunc1, ALT:() => { this.CONSUME(One) }},
        { GATE: predicateFuncX, ALT:() => { this.CONSUME(Two) }},
        { GATE: predicateFuncX, ALT:() => { this.CONSUME(Three) }}
      ])
  • These syntax forms can also be mixed:

      this.OR([
        {
          GATE: predicateFunc1,
          ALT:() => { this.CONSUME(One) }
        },
        { ALT:() => { this.CONSUME(Two) }},
        { ALT:() => { this.CONSUME(Three) }}
      ])
  • Additionally an “options” object may be used:

      this.OR({
        DEF:[
          { ALT:() => { this.CONSUME(One) }},
          { ALT:() => { this.CONSUME(Two) }},
          { ALT:() => { this.CONSUME(Three) }}
        ],
        // OPTIONAL property
        ERR_MSG: "A Number"
      })

The ‘predicateFuncX’ in the long form can be used to add constraints to choosing the alternative.

As in CONSUME the index in the method name indicates the occurrence of the alternation production in it’s top rule.

Type Parameters
T

T

Parameters
altsOrOpts

IOrAlt<T>[] | OrMethodOpts<T>

A set of alternatives or an “OPTIONS” object describing the alternatives and optional properties.

Returns

T

The result of invoking the chosen alternative.

Inherited from

DatalogParser.OR

Call Signature

protected OR(altsOrOpts): any

Parsing DSL method that indicates a choice between a set of alternatives must be made. This is equivalent to an EBNF alternation (A | B | C | D …), except that the alternatives are ordered like in a PEG grammar. This means that the first matching alternative is always chosen.

There are several forms for the inner alternatives array:

  • Passing alternatives array directly:

      this.OR([
        { ALT:() => { this.CONSUME(One) }},
        { ALT:() => { this.CONSUME(Two) }},
        { ALT:() => { this.CONSUME(Three) }}
      ])
  • Passing alternative array directly with predicates (GATE):

      this.OR([
        { GATE: predicateFunc1, ALT:() => { this.CONSUME(One) }},
        { GATE: predicateFuncX, ALT:() => { this.CONSUME(Two) }},
        { GATE: predicateFuncX, ALT:() => { this.CONSUME(Three) }}
      ])
  • These syntax forms can also be mixed:

      this.OR([
        {
          GATE: predicateFunc1,
          ALT:() => { this.CONSUME(One) }
        },
        { ALT:() => { this.CONSUME(Two) }},
        { ALT:() => { this.CONSUME(Three) }}
      ])
  • Additionally an “options” object may be used:

      this.OR({
        DEF:[
          { ALT:() => { this.CONSUME(One) }},
          { ALT:() => { this.CONSUME(Two) }},
          { ALT:() => { this.CONSUME(Three) }}
        ],
        // OPTIONAL property
        ERR_MSG: "A Number"
      })

The ‘predicateFuncX’ in the long form can be used to add constraints to choosing the alternative.

As in CONSUME the index in the method name indicates the occurrence of the alternation production in it’s top rule.

Parameters
altsOrOpts

IOrAlt<any>[] | OrMethodOpts<any>

A set of alternatives or an “OPTIONS” object describing the alternatives and optional properties.

Returns

any

The result of invoking the chosen alternative.

Inherited from

DatalogParser.OR

OVERRIDE_RULE()

protected OVERRIDE_RULE<F>(name, implementation, config?): ParserMethod<Parameters<F>, CstNode>

Overrides a Grammar Rule See usage example in: https://github.com/chevrotain/chevrotain/blob/master/examples/parser/versioning/versioning.js

Type Parameters
F

F extends () => void

Parameters
name

string

implementation

F

config?

IRuleConfig<CstNode>

Returns

ParserMethod<Parameters<F>, CstNode>

Inherited from

DatalogParser.OVERRIDE_RULE

performSelfAnalysis()

protected performSelfAnalysis(): void

This must be called at the end of a Parser constructor. See: http://chevrotain.io/docs/tutorial/step2_parsing.html#under-the-hood

Returns

void

Inherited from

DatalogParser.performSelfAnalysis

reset()

reset(): void

Resets the parser state, should be overridden for custom parsers which “carry” additional state. When overriding, remember to also invoke the super implementation!

Returns

void

Inherited from

DatalogParser.reset

RULE()

protected RULE<F>(name, implementation, config?): ParserMethod<Parameters<F>, CstNode>

Creates a Grammar Rule

Note that any parameters of your implementation must be optional as it will be called without parameters during the grammar recording phase.

Type Parameters
F

F extends () => void

Parameters
name

string

implementation

F

config?

IRuleConfig<CstNode>

Returns

ParserMethod<Parameters<F>, CstNode>

Inherited from

DatalogParser.RULE

SKIP_TOKEN()

protected SKIP_TOKEN(): IToken

Will consume a single token and return the next token, meaning the token after the skipped token.

Returns

IToken

Inherited from

DatalogParser.SKIP_TOKEN

subrule()

protected subrule<ARGS>(idx, ruleToCall, options?): CstNode

Like SUBRULE with the numerical suffix as a parameter, e.g: subrule(0, X) === SUBRULE(X) subrule(1, X) === SUBRULE1(X) subrule(2, X) === SUBRULE2(X) …

Type Parameters
ARGS

ARGS extends unknown[]

Parameters
idx

number

ruleToCall

ParserMethod<ARGS, CstNode>

options?

SubruleMethodOpts<ARGS>

Returns

CstNode

See

SUBRULE

Inherited from

DatalogParser.subrule

SUBRULE()

protected SUBRULE<ARGS>(ruleToCall, options?): CstNode

The Parsing DSL Method is used by one rule to call another. It is equivalent to a non-Terminal in EBNF notation.

This may seem redundant as it does not actually do much. However using it is mandatory for all sub rule invocations.

Calling another rule without wrapping in SUBRULE(…) will cause errors/mistakes in the Parser’s self analysis phase, which will lead to errors in error recovery/automatic lookahead calculation and any other functionality relying on the Parser’s self analysis output.

As in CONSUME the index in the method name indicates the occurrence of the sub rule invocation in its rule.

Type Parameters
ARGS

ARGS extends unknown[]

Parameters
ruleToCall

ParserMethod<ARGS, CstNode>

options?

SubruleMethodOpts<ARGS>

Returns

CstNode

Inherited from

DatalogParser.SUBRULE

variableOrGroundedTarget()

protected variableOrGroundedTarget(): void

Returns

void

Interfaces

AdditiveExpressionCstNode

Extends

  • CstNode

Properties

children

children: AdditiveExpressionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "additiveExpression"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


AggregateBindCstNode

Extends

  • CstNode

Properties

children

children: AggregateBindCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "aggregateBind"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


AggregateCstNode

Extends

  • CstNode

Properties

children

children: AggregateCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "aggregate"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


AggregateFunction1CstNode

Extends

  • CstNode

Properties

children

children: AggregateFunction1CstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "aggregateFunction1"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


AggregateFunction2CstNode

Extends

  • CstNode

Properties

children

children: AggregateFunction2CstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "aggregateFunction2"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


AggregateFunctionCstNode

Extends

  • CstNode

Properties

children

children: AggregateFunctionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "aggregateFunction"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


ArgumentListCstNode

Extends

  • CstNode

Properties

children

children: ArgumentListCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "argumentList"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


AtomCstNode

Extends

  • CstNode

Properties

children

children: AtomCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "atom"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


AtomListCstNode

Extends

  • CstNode

Properties

children

children: AtomListCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "atomList"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


BindAtomCstNode

Extends

  • CstNode

Properties

children

children: BindAtomCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "bindAtom"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


BodyFormulaCstNode

Extends

  • CstNode

Properties

children

children: BodyFormulaCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "bodyFormula"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


BodyFormulaListCstNode

Extends

  • CstNode

Properties

children

children: BodyFormulaListCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "bodyFormulaList"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


BooleanLiteralCstNode

Extends

  • CstNode

Properties

children

children: BooleanLiteralCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "booleanLiteral"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


ConcatFunctionCstNode

Extends

  • CstNode

Properties

children

children: ConcatFunctionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "concatFunction"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


ConditionalAndExpressionCstNode

Extends

  • CstNode

Properties

children

children: ConditionalAndExpressionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "conditionalAndExpression"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


ConditionalOrExpressionCstNode

Extends

  • CstNode

Properties

children

children: ConditionalOrExpressionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "conditionalOrExpression"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


DefaultGraphAtomCstNode

Extends

  • CstNode

Properties

children

children: DefaultGraphAtomCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "defaultGraphAtom"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


ExistsClauseCstNode

Extends

  • CstNode

Properties

children

children: ExistsClauseCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "existsClause"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


ExpressionCstNode

Extends

  • CstNode

Properties

children

children: ExpressionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "expression"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


FilterAtomCstNode

Extends

  • CstNode

Properties

children

children: FilterAtomCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "filterAtom"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


FunctionCallCstNode

Extends

  • CstNode

Properties

children

children: FunctionCallCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "functionCall"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


GeneralAtomCstNode

Extends

  • CstNode

Properties

children

children: GeneralAtomCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "generalAtom"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


GraphNameCstNode

Extends

  • CstNode

Properties

children

children: GraphNameCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "graphName"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


GroundedAsTargetCstNode

Extends

  • CstNode

Properties

children

children: GroundedAsTargetCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "groundedAsTarget"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


ICstNodeVisitor

Extends

  • ICstVisitor<IN, OUT>

Type Parameters

IN

IN

OUT

OUT

Methods

additiveExpression()

additiveExpression(children, param?): OUT

Parameters
children

AdditiveExpressionCstChildren

param?

IN

Returns

OUT

aggregate()

aggregate(children, param?): OUT

Parameters
children

AggregateCstChildren

param?

IN

Returns

OUT

aggregateBind()

aggregateBind(children, param?): OUT

Parameters
children

AggregateBindCstChildren

param?

IN

Returns

OUT

aggregateFunction()

aggregateFunction(children, param?): OUT

Parameters
children

AggregateFunctionCstChildren

param?

IN

Returns

OUT

aggregateFunction1()

aggregateFunction1(children, param?): OUT

Parameters
children

AggregateFunction1CstChildren

param?

IN

Returns

OUT

aggregateFunction2()

aggregateFunction2(children, param?): OUT

Parameters
children

AggregateFunction2CstChildren

param?

IN

Returns

OUT

argumentList()

argumentList(children, param?): OUT

Parameters
children

ArgumentListCstChildren

param?

IN

Returns

OUT

atom()

atom(children, param?): OUT

Parameters
children

AtomCstChildren

param?

IN

Returns

OUT

atomList()

atomList(children, param?): OUT

Parameters
children

AtomListCstChildren

param?

IN

Returns

OUT

bindAtom()

bindAtom(children, param?): OUT

Parameters
children

BindAtomCstChildren

param?

IN

Returns

OUT

bodyFormula()

bodyFormula(children, param?): OUT

Parameters
children

BodyFormulaCstChildren

param?

IN

Returns

OUT

bodyFormulaList()

bodyFormulaList(children, param?): OUT

Parameters
children

BodyFormulaListCstChildren

param?

IN

Returns

OUT

booleanLiteral()

booleanLiteral(children, param?): OUT

Parameters
children

BooleanLiteralCstChildren

param?

IN

Returns

OUT

concatFunction()

concatFunction(children, param?): OUT

Parameters
children

ConcatFunctionCstChildren

param?

IN

Returns

OUT

conditionalAndExpression()

conditionalAndExpression(children, param?): OUT

Parameters
children

ConditionalAndExpressionCstChildren

param?

IN

Returns

OUT

conditionalOrExpression()

conditionalOrExpression(children, param?): OUT

Parameters
children

ConditionalOrExpressionCstChildren

param?

IN

Returns

OUT

defaultGraphAtom()

defaultGraphAtom(children, param?): OUT

Parameters
children

DefaultGraphAtomCstChildren

param?

IN

Returns

OUT

existsClause()

existsClause(children, param?): OUT

Parameters
children

ExistsClauseCstChildren

param?

IN

Returns

OUT

expression()

expression(children, param?): OUT

Parameters
children

ExpressionCstChildren

param?

IN

Returns

OUT

filterAtom()

filterAtom(children, param?): OUT

Parameters
children

FilterAtomCstChildren

param?

IN

Returns

OUT

functionCall()

functionCall(children, param?): OUT

Parameters
children

FunctionCallCstChildren

param?

IN

Returns

OUT

generalAtom()

generalAtom(children, param?): OUT

Parameters
children

GeneralAtomCstChildren

param?

IN

Returns

OUT

graphName()

graphName(children, param?): OUT

Parameters
children

GraphNameCstChildren

param?

IN

Returns

OUT

groundedAsTarget()

groundedAsTarget(children, param?): OUT

Parameters
children

GroundedAsTargetCstChildren

param?

IN

Returns

OUT

ifFunction()

ifFunction(children, param?): OUT

Parameters
children

IfFunctionCstChildren

param?

IN

Returns

OUT

iri()

iri(children, param?): OUT

Parameters
children

IriCstChildren

param?

IN

Returns

OUT

iriFunction()

iriFunction(children, param?): OUT

Parameters
children

IriFunctionCstChildren

param?

IN

Returns

OUT

literal()

literal(children, param?): OUT

Parameters
children

LiteralCstChildren

param?

IN

Returns

OUT

multiplicativeExpression()

multiplicativeExpression(children, param?): OUT

Parameters
children

MultiplicativeExpressionCstChildren

param?

IN

Returns

OUT

negation()

negation(children, param?): OUT

Parameters
children

NegationCstChildren

param?

IN

Returns

OUT

numericLiteral()

numericLiteral(children, param?): OUT

Parameters
children

NumericLiteralCstChildren

param?

IN

Returns

OUT

onClause()

onClause(children, param?): OUT

Parameters
children

OnClauseCstChildren

param?

IN

Returns

OUT

percentileFunction()

percentileFunction(children, param?): OUT

Parameters
children

PercentileFunctionCstChildren

param?

IN

Returns

OUT

primaryExpression()

primaryExpression(children, param?): OUT

Parameters
children

PrimaryExpressionCstChildren

param?

IN

Returns

OUT

regexFunction()

regexFunction(children, param?): OUT

Parameters
children

RegexFunctionCstChildren

param?

IN

Returns

OUT

relationalExpression()

relationalExpression(children, param?): OUT

Parameters
children

RelationalExpressionCstChildren

param?

IN

Returns

OUT

roundFunction()

roundFunction(children, param?): OUT

Parameters
children

RoundFunctionCstChildren

param?

IN

Returns

OUT

rule()

rule(children, param?): OUT

Parameters
children

RuleCstChildren

param?

IN

Returns

OUT

ruleBody()

ruleBody(children, param?): OUT

Parameters
children

RuleBodyCstChildren

param?

IN

Returns

OUT

ruleHead()

ruleHead(children, param?): OUT

Parameters
children

RuleHeadCstChildren

param?

IN

Returns

OUT

skolemAtom()

skolemAtom(children, param?): OUT

Parameters
children

SkolemAtomCstChildren

param?

IN

Returns

OUT

skolemFunction()

skolemFunction(children, param?): OUT

Parameters
children

SkolemFunctionCstChildren

param?

IN

Returns

OUT

strFunction()

strFunction(children, param?): OUT

Parameters
children

StrFunctionCstChildren

param?

IN

Returns

OUT

stringLiteral()

stringLiteral(children, param?): OUT

Parameters
children

StringLiteralCstChildren

param?

IN

Returns

OUT

term()

term(children, param?): OUT

Parameters
children

TermCstChildren

param?

IN

Returns

OUT

tupleTableAtom()

tupleTableAtom(children, param?): OUT

Parameters
children

TupleTableAtomCstChildren

param?

IN

Returns

OUT

unaryExpression()

unaryExpression(children, param?): OUT

Parameters
children

UnaryExpressionCstChildren

param?

IN

Returns

OUT

validateVisitor()

validateVisitor(): void

Will throw an error if the visitor is missing any required methods

  • visitXYZ for each XYZ grammar rule.
Returns

void

Inherited from

ICstVisitor.validateVisitor

visit()

visit(cstNode, param?): OUT

Parameters
cstNode

CstNode | CstNode[]

param?

IN

Returns

OUT

Inherited from

ICstVisitor.visit


IfFunctionCstNode

Extends

  • CstNode

Properties

children

children: IfFunctionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "ifFunction"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


IriCstNode

Extends

  • CstNode

Properties

children

children: IriCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "iri"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


IriFunctionCstNode

Extends

  • CstNode

Properties

children

children: IriFunctionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "iriFunction"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


LiteralCstNode

Extends

  • CstNode

Properties

children

children: LiteralCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "literal"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


MultiplicativeExpressionCstNode

Extends

  • CstNode

Properties

children

children: MultiplicativeExpressionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "multiplicativeExpression"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


NegationCstNode

Extends

  • CstNode

Properties

children

children: NegationCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "negation"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


NumericLiteralCstNode

Extends

  • CstNode

Properties

children

children: NumericLiteralCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "numericLiteral"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


OnClauseCstNode

Extends

  • CstNode

Properties

children

children: OnClauseCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "onClause"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


PercentileFunctionCstNode

Extends

  • CstNode

Properties

children

children: PercentileFunctionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "percentileFunction"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


PrimaryExpressionCstNode

Extends

  • CstNode

Properties

children

children: PrimaryExpressionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "primaryExpression"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


RegexFunctionCstNode

Extends

  • CstNode

Properties

children

children: RegexFunctionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "regexFunction"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


RelationalExpressionCstNode

Extends

  • CstNode

Properties

children

children: RelationalExpressionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "relationalExpression"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


RoundFunctionCstNode

Extends

  • CstNode

Properties

children

children: RoundFunctionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "roundFunction"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


RuleBodyCstNode

Extends

  • CstNode

Properties

children

children: RuleBodyCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "ruleBody"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


RuleCstNode

Extends

  • CstNode

Properties

children

children: RuleCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "rule"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


RuleHeadCstNode

Extends

  • CstNode

Properties

children

children: RuleHeadCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "ruleHead"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


SkolemAtomCstNode

Extends

  • CstNode

Properties

children

children: SkolemAtomCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "skolemAtom"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


SkolemFunctionCstNode

Extends

  • CstNode

Properties

children

children: SkolemFunctionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "skolemFunction"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


SparqlSelectResult

Properties

query

query: string

variables

variables: string[]


StrFunctionCstNode

Extends

  • CstNode

Properties

children

children: StrFunctionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "strFunction"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


StringLiteralCstNode

Extends

  • CstNode

Properties

children

children: StringLiteralCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "stringLiteral"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


TermCstNode

Extends

  • CstNode

Properties

children

children: TermCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "term"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


TupleTableAtomCstNode

Extends

  • CstNode

Properties

children

children: TupleTableAtomCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "tupleTableAtom"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode


UnaryExpressionCstNode

Extends

  • CstNode

Properties

children

children: UnaryExpressionCstChildren

Overrides

CstNode.children

location?

readonly optional location?: CstNodeLocation

Will only be present if the IParserConfig.nodeLocationTracking is not set to “none”. See: https://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnodes-location For more details.

Inherited from

CstNode.location

name

name: "unaryExpression"

Overrides

CstNode.name

recoveredNode?

readonly optional recoveredNode?: boolean

A flag indicating the whole CSTNode has been recovered during re-sync error recovery. This means that some of the node’s children may be missing.

Inherited from

CstNode.recoveredNode

Type Aliases

AdditiveExpressionCstChildren

AdditiveExpressionCstChildren = object

Properties

MINUS?

optional MINUS?: IToken[]

multiplicativeExpression

multiplicativeExpression: MultiplicativeExpressionCstNode[]

PLUS?

optional PLUS?: IToken[]


AggregateBindCstChildren

AggregateBindCstChildren = object

Properties

aggregateFunction?

optional aggregateFunction?: AggregateFunctionCstNode[]

AS

AS: IToken[]

BIND?

optional BIND?: IToken[]

expression?

optional expression?: ExpressionCstNode[]

groundedAsTarget?

optional groundedAsTarget?: GroundedAsTargetCstNode[]

VARIABLE?

optional VARIABLE?: IToken[]


AggregateBinding

AggregateBinding = AggregateFunctionBinding | ExpressionAggregateBinding


AggregateBindingTarget

AggregateBindingTarget = object

Properties

groundedTarget?

optional groundedTarget?: DatalogTerm

Set only when the expanded grammar read a value in AS position, as the engine’s grounded rules do.

variable

variable: string

Target variable name without its ?, or the value’s text when groundedTarget is set.


AggregateCstChildren

AggregateCstChildren = object

Properties

AGGREGATE

AGGREGATE: IToken[]

aggregateBind?

optional aggregateBind?: AggregateBindCstNode[]

atomList?

optional atomList?: AtomListCstNode[]

LPAREN

LPAREN: IToken[]

onClause?

optional onClause?: OnClauseCstNode[]

RPAREN

RPAREN: IToken[]


AggregateFunction

AggregateFunction = UnaryAggregateFunction | BinaryAggregateFunction | PercentileAggregateFunction


AggregateFunction1CstChildren

AggregateFunction1CstChildren = object

Properties

AVG?

optional AVG?: IToken[]

COUNT?

optional COUNT?: IToken[]

COUNT_MAX?

optional COUNT_MAX?: IToken[]

COUNT_MIN?

optional COUNT_MIN?: IToken[]

DISTINCT?

optional DISTINCT?: IToken[]

expression?

optional expression?: ExpressionCstNode[]

LPAREN

LPAREN: IToken[]

MAX?

optional MAX?: IToken[]

MIN?

optional MIN?: IToken[]

MODE?

optional MODE?: IToken[]

MUL?

optional MUL?: IToken[]

RPAREN

RPAREN: IToken[]

STAR?

optional STAR?: IToken[]

STDDEV_POP?

optional STDDEV_POP?: IToken[]

STDDEV_SAMP?

optional STDDEV_SAMP?: IToken[]

SUM?

optional SUM?: IToken[]

VAR_POP?

optional VAR_POP?: IToken[]

VAR_SAMP?

optional VAR_SAMP?: IToken[]


AggregateFunction2CstChildren

AggregateFunction2CstChildren = object

Properties

COMMA

COMMA: IToken[]

DISTINCT?

optional DISTINCT?: IToken[]

firstExpr

firstExpr: ExpressionCstNode[]

LPAREN

LPAREN: IToken[]

MAX_ARGMAX?

optional MAX_ARGMAX?: IToken[]

MAX_ARGMIN?

optional MAX_ARGMIN?: IToken[]

MIN_ARGMAX?

optional MIN_ARGMAX?: IToken[]

MIN_ARGMIN?

optional MIN_ARGMIN?: IToken[]

RPAREN

RPAREN: IToken[]

secondExpr

secondExpr: ExpressionCstNode[]


AggregateFunctionBinding

AggregateFunctionBinding = UnaryAggregateBinding | BinaryAggregateBinding | PercentileAggregateBinding


AggregateFunctionCstChildren

AggregateFunctionCstChildren = object

Properties

aggregateFunction1?

optional aggregateFunction1?: AggregateFunction1CstNode[]

aggregateFunction2?

optional aggregateFunction2?: AggregateFunction2CstNode[]

percentileFunction?

optional percentileFunction?: PercentileFunctionCstNode[]


ArgumentListCstChildren

ArgumentListCstChildren = object

Properties

COMMA?

optional COMMA?: IToken[]

expression

expression: ExpressionCstNode[]


AtomCstChildren

AtomCstChildren = object

Properties

bindAtom?

optional bindAtom?: BindAtomCstNode[]

filterAtom?

optional filterAtom?: FilterAtomCstNode[]

tupleTableAtom?

optional tupleTableAtom?: TupleTableAtomCstNode[]


AtomListCstChildren

AtomListCstChildren = object

Properties

atom

atom: AtomCstNode[]

COMMA?

optional COMMA?: IToken[]


AuthoredDatalogRule

AuthoredDatalogRule = DatalogRule & object

A rule AST that may be passed to SPARQL translators (excludes grounded ASTs).

Type Declaration

grounded?

optional grounded?: false


BinaryAggregateBinding

BinaryAggregateBinding = AggregateBindingTarget & object

Type Declaration

distinct?

optional distinct?: boolean

expression

expression: DatalogExpression

function

function: BinaryAggregateFunction

percentile?

optional percentile?: never

secondExpression

secondExpression: DatalogExpression


BinaryAggregateFunction

BinaryAggregateFunction = "MIN_ARGMIN" | "MAX_ARGMIN" | "MIN_ARGMAX" | "MAX_ARGMAX"


BinaryExpression

BinaryExpression = object

Properties

left

left: DatalogExpression

operator

operator: “||” | "&&" | "=" | "!=" | "<" | ">" | "<=" | ">=" | "+" | "-" | "*" | "/"

right: DatalogExpression

type

type: "binary"


BindAtomCstChildren

BindAtomCstChildren = object

Properties

AS

AS: IToken[]

BIND

BIND: IToken[]

expression

expression: ExpressionCstNode[]

groundedAsTarget?

optional groundedAsTarget?: GroundedAsTargetCstNode[]

LPAREN

LPAREN: IToken[]

RPAREN

RPAREN: IToken[]

VARIABLE?

optional VARIABLE?: IToken[]


BlankNodeTerm

BlankNodeTerm = object

Properties

label

label: string

type

type: "blank"


BodyFormulaCstChildren

BodyFormulaCstChildren = object

Properties

aggregate?

optional aggregate?: AggregateCstNode[]

bindAtom?

optional bindAtom?: BindAtomCstNode[]

filterAtom?

optional filterAtom?: FilterAtomCstNode[]

negation?

optional negation?: NegationCstNode[]

skolemAtom?

optional skolemAtom?: SkolemAtomCstNode[]

tupleTableAtom?

optional tupleTableAtom?: TupleTableAtomCstNode[]


BodyFormulaListCstChildren

BodyFormulaListCstChildren = object

Properties

bodyFormula

bodyFormula: BodyFormulaCstNode[]

COMMA?

optional COMMA?: IToken[]


BooleanLiteralCstChildren

BooleanLiteralCstChildren = object

Properties

FALSE?

optional FALSE?: IToken[]

TRUE?

optional TRUE?: IToken[]


ClassAssertion

ClassAssertion = object

Properties

className

className: string

graph?

optional graph?: DatalogTerm

instance

instance: DatalogTerm


ClassAtom

ClassAtom = object

Properties

className

className: string

graph?

optional graph?: DatalogTerm

instance

instance: DatalogTerm

type

type: "class"


ComparisonOperator

ComparisonOperator = Extract<BinaryExpression["operator"], "=" | "!=" | "<" | ">" | "<=" | ">=">


ConcatFunctionCstChildren

ConcatFunctionCstChildren = object

Properties

argumentList

argumentList: ArgumentListCstNode[]

CONCAT

CONCAT: IToken[]

LPAREN

LPAREN: IToken[]

RPAREN

RPAREN: IToken[]


ConditionalAndExpressionCstChildren

ConditionalAndExpressionCstChildren = object

Properties

AND?

optional AND?: IToken[]

relationalExpression

relationalExpression: RelationalExpressionCstNode[]


ConditionalOrExpressionCstChildren

ConditionalOrExpressionCstChildren = object

Properties

conditionalAndExpression

conditionalAndExpression: ConditionalAndExpressionCstNode[]

OR?

optional OR?: IToken[]


DatalogAggregate

DatalogAggregate = object

Properties

atoms

atoms: DatalogAggregateAtom[]

bindings?

optional bindings?: AggregateBinding[]

groundedOnTargets?

optional groundedOnTargets?: DatalogTerm[]

Set only when the expanded grammar read values in ON position, as the engine’s grounded rules do.

onVars?

optional onVars?: string[]

Grouping keys from ON …. Entries are variable names without ?, or the value’s text when the expanded grammar read a substituted ON term (e.g. ":Company_42"). Order is not source order: the visitor lists all variables, then all grounded targets. Do not feed grounded ASTs into SPARQL helpers that treat every entry as a variable name (datalog-to-sparql-select, ast-utils) — use authored/strict ASTs there.

type

type: "aggregate"


DatalogAggregateAtom

DatalogAggregateAtom = DatalogAtom | DatalogFilter | DatalogBind


DatalogAtom

DatalogAtom = TripleAtom | PropertyAtom | ClassAtom | GeneralAtom


DatalogBind

DatalogBind = object

Properties

expression

expression: DatalogExpression

groundedTarget?

optional groundedTarget?: DatalogTerm

Set only when the expanded grammar read a value in AS position, as the engine’s grounded rules do.

type

type: "bind"

variable

variable: string

Target variable name without its ?, or the value’s text when groundedTarget is set.


DatalogBodyFormula

DatalogBodyFormula = DatalogAtom | DatalogNegation | DatalogAggregate | DatalogFilter | DatalogBind | DatalogSkolem


DatalogExpression

DatalogExpression = BinaryExpression | UnaryExpression | TermExpression | FunctionCallExpression | InExpression


DatalogFilter

DatalogFilter = object

Properties

expression

expression: DatalogExpression

type

type: "filter"


DatalogNegation

DatalogNegation = object

Properties

existentialVars?

optional existentialVars?: string[]

formulas

formulas: DatalogBodyFormula[]

type

type: "negation"


DatalogParseIssue

DatalogParseIssue = object

Properties

column?

optional column?: number

endOffset?

optional endOffset?: number

line?

optional line?: number

message

message: string

offset?

optional offset?: number


DatalogParserConfig

DatalogParserConfig = object

Properties

selfAnalysis?

optional selfAnalysis?: boolean


DatalogParseResult

DatalogParseResult = { ok: true; rule: DatalogRule; } | { issues: DatalogParseIssue[]; ok: false; }


DatalogRule

DatalogRule = DatalogRuleAst & object

Type Declaration

raw

raw: string

spans?

optional spans?: DatalogRuleSpans


DatalogRuleAst

DatalogRuleAst = object

Properties

body

body: DatalogBodyFormula[]

head: DatalogAtom[]


DatalogRuleSourceTexts

DatalogRuleSourceTexts = object

Properties

body

body: string[]

head

head: string[]


DatalogRuleSpans

DatalogRuleSpans = object

Properties

body

body: SourceSpan[]

head

head: SourceSpan[]


DatalogSkolem

DatalogSkolem = object

Properties

args

args: DatalogExpression[]

type

type: "skolem"


DatalogTerm

DatalogTerm = VariableTerm | IriTerm | LiteralTerm | BlankNodeTerm


DatalogTextOptions

DatalogTextOptions = object

Properties

stripSimpleLiteralDatatypes?

optional stripSimpleLiteralDatatypes?: boolean


DatalogTextPart

DatalogTextPart = { text: string; type: "text"; } | { name: string; type: "variable"; } | { literal: LiteralTerm; text: string; type: "literal"; }


DatalogToken

DatalogToken = IToken


DataManipulationOptions

DataManipulationOptions = object

Properties

defaultGraphOnly?

optional defaultGraphOnly?: boolean


DataManipulationSubType

DataManipulationSubType = "insertdata" | "deletedata" | "modify"


DefaultGraphAtomCstChildren

DefaultGraphAtomCstChildren = object

Properties

COMMA?

optional COMMA?: IToken[]

firstTerm?

optional firstTerm?: TermCstNode[]

LBRACKET?

optional LBRACKET?: IToken[]

object?

optional object?: TermCstNode[]

predicate?

optional predicate?: TermCstNode[]

predicateOrClass?

optional predicateOrClass?: IriCstNode[]

RBRACKET?

optional RBRACKET?: IToken[]

secondTerm?

optional secondTerm?: TermCstNode[]

subject?

optional subject?: TermCstNode[]


ExistsClauseCstChildren

ExistsClauseCstChildren = object

Properties

COMMA?

optional COMMA?: IToken[]

EXISTS

EXISTS: IToken[]

IN

IN: IToken[]

VARIABLE

VARIABLE: IToken[]


ExpressionAggregateBinding

ExpressionAggregateBinding = AggregateBindingTarget & object

Type Declaration

distinct?

optional distinct?: never

expression

expression: DatalogExpression

function?

optional function?: never

percentile?

optional percentile?: never

secondExpression?

optional secondExpression?: never


ExpressionCstChildren

ExpressionCstChildren = object

Properties

conditionalOrExpression

conditionalOrExpression: ConditionalOrExpressionCstNode[]


FilterAtomCstChildren

FilterAtomCstChildren = object

Properties

expression

expression: ExpressionCstNode[]

FILTER

FILTER: IToken[]

LPAREN

LPAREN: IToken[]

RPAREN

RPAREN: IToken[]


FunctionCallCstChildren

FunctionCallCstChildren = object

Properties

argumentList?

optional argumentList?: ArgumentListCstNode[]

concatFunction?

optional concatFunction?: ConcatFunctionCstNode[]

ifFunction?

optional ifFunction?: IfFunctionCstNode[]

iri?

optional iri?: IriCstNode[]

iriFunction?

optional iriFunction?: IriFunctionCstNode[]

LPAREN?

optional LPAREN?: IToken[]

regexFunction?

optional regexFunction?: RegexFunctionCstNode[]

roundFunction?

optional roundFunction?: RoundFunctionCstNode[]

RPAREN?

optional RPAREN?: IToken[]

skolemFunction?

optional skolemFunction?: SkolemFunctionCstNode[]

strFunction?

optional strFunction?: StrFunctionCstNode[]


FunctionCallExpression

FunctionCallExpression = object

Properties

args

args: DatalogExpression[]

name

name: string

type

type: "function"


GeneralAtom

GeneralAtom = object

Properties

tableName

tableName: string

terms

terms: DatalogTerm[]

type

type: "general"


GeneralAtomCstChildren

GeneralAtomCstChildren = object

Properties

COMMA?

optional COMMA?: IToken[]

IDENTIFIER?

optional IDENTIFIER?: IToken[]

LPAREN

LPAREN: IToken[]

RPAREN

RPAREN: IToken[]

STRING_LITERAL?

optional STRING_LITERAL?: IToken[]

term

term: TermCstNode[]


GraphNameCstChildren

GraphNameCstChildren = object

Properties

iri?

optional iri?: IriCstNode[]

VARIABLE?

optional VARIABLE?: IToken[]


GroundedAsTargetCstChildren

GroundedAsTargetCstChildren = object

Properties

BLANK_NODE?

optional BLANK_NODE?: IToken[]

iri?

optional iri?: IriCstNode[]

literal?

optional literal?: LiteralCstNode[]


GroundedDatalogRule

GroundedDatalogRule = DatalogRule & object

A rule AST produced by parseGroundedDatalogRule — not safe for SPARQL translation.

Type Declaration

grounded

readonly grounded: true


IfFunctionCstChildren

IfFunctionCstChildren = object

Properties

COMMA

COMMA: IToken[]

condition

condition: ExpressionCstNode[]

elseExpr

elseExpr: ExpressionCstNode[]

IF

IF: IToken[]

LPAREN

LPAREN: IToken[]

RPAREN

RPAREN: IToken[]

thenExpr

thenExpr: ExpressionCstNode[]


InExpression

InExpression = object

Properties

expression

expression: DatalogExpression

list

list: DatalogExpression[]

negated

negated: boolean

type

type: "in"


InferenceVerificationResult

InferenceVerificationResult = object

Properties

candidateQuery?

optional candidateQuery?: string

error?

optional error?: string

sparqlQuery?

optional sparqlQuery?: string

testTriple?

optional testTriple?: object

object

object: string

predicate

predicate: string

subject

subject: string

verified

verified: boolean


IriCstChildren

IriCstChildren = object

Properties

DEFAULT_NS_IRI?

optional DEFAULT_NS_IRI?: IToken[]

IDENTIFIER?

optional IDENTIFIER?: IToken[]

INTERNAL_FUNCTION?

optional INTERNAL_FUNCTION?: IToken[]

IRI_REF?

optional IRI_REF?: IToken[]

PREFIX_ONLY?

optional PREFIX_ONLY?: IToken[]

PREFIXED_NAME?

optional PREFIXED_NAME?: IToken[]


IriFunctionCstChildren

IriFunctionCstChildren = object

Properties

baseIri?

optional baseIri?: ExpressionCstNode[]

COMMA?

optional COMMA?: IToken[]

IRI

IRI: IToken[]

iriExpr

iriExpr: ExpressionCstNode[]

LPAREN

LPAREN: IToken[]

RPAREN

RPAREN: IToken[]


IriTerm

IriTerm = object

Properties

prefixed

prefixed: boolean

type

type: "iri"

value

value: string


LiteralCstChildren

LiteralCstChildren = object

Properties

booleanLiteral?

optional booleanLiteral?: BooleanLiteralCstNode[]

numericLiteral?

optional numericLiteral?: NumericLiteralCstNode[]

stringLiteral?

optional stringLiteral?: StringLiteralCstNode[]


LiteralSetComparison

LiteralSetComparison = object

Properties

literals

literals: LiteralTerm[]

negated

negated: boolean

subject

subject: DatalogTerm


LiteralTerm

LiteralTerm = object

Properties

datatype?

optional datatype?: string

language?

optional language?: string

termSpan?

optional termSpan?: SourceSpan

type

type: "literal"

value

value: string

valueSpan?

optional valueSpan?: SourceSpan


MultiplicativeExpressionCstChildren

MultiplicativeExpressionCstChildren = object

Properties

SLASH?

optional SLASH?: IToken[]

STAR?

optional STAR?: IToken[]

unaryExpression

unaryExpression: UnaryExpressionCstNode[]


NegationCstChildren

NegationCstChildren = object

Properties

bodyFormulaList?

optional bodyFormulaList?: BodyFormulaListCstNode[]

existsClause?

optional existsClause?: ExistsClauseCstNode[]

LPAREN?

optional LPAREN?: IToken[]

NOT

NOT: IToken[]

RPAREN?

optional RPAREN?: IToken[]

tupleTableAtom?

optional tupleTableAtom?: TupleTableAtomCstNode[]


NumericLiteralCstChildren

NumericLiteralCstChildren = object

Properties

DECIMAL?

optional DECIMAL?: IToken[]

DOUBLE?

optional DOUBLE?: IToken[]

INTEGER?

optional INTEGER?: IToken[]


OnClauseCstChildren

OnClauseCstChildren = object

Properties

groundedAsTarget?

optional groundedAsTarget?: GroundedAsTargetCstNode[]

ON

ON: IToken[]

VARIABLE?

optional VARIABLE?: IToken[]


PercentileAggregateBinding

PercentileAggregateBinding = AggregateBindingTarget & object

Type Declaration

distinct?

optional distinct?: boolean

expression

expression: DatalogExpression

function

function: PercentileAggregateFunction

percentile

percentile: string

The PERCENTILE="…" parameter’s decimal text, in [0, 1].

secondExpression?

optional secondExpression?: never


PercentileAggregateFunction

PercentileAggregateFunction = "PERCENTILE_CONT" | "PERCENTILE_DISC"


PercentileFunctionCstChildren

PercentileFunctionCstChildren = object

Properties

DISTINCT?

optional DISTINCT?: IToken[]

EQUALS

EQUALS: IToken[]

expression

expression: ExpressionCstNode[]

LPAREN

LPAREN: IToken[]

PERCENTILE

PERCENTILE: IToken[]

PERCENTILE_CONT?

optional PERCENTILE_CONT?: IToken[]

PERCENTILE_DISC?

optional PERCENTILE_DISC?: IToken[]

RPAREN

RPAREN: IToken[]

SEMICOLON

SEMICOLON: IToken[]

STRING_LITERAL

STRING_LITERAL: IToken[]


PredicateEvidence

PredicateEvidence = object

Properties

position

position: PredicatePosition

term

term: string


PredicatePosition

PredicatePosition = "domain" | "range"


PrimaryExpressionCstChildren

PrimaryExpressionCstChildren = object

Properties

BLANK_NODE?

optional BLANK_NODE?: IToken[]

expression?

optional expression?: ExpressionCstNode[]

functionCall?

optional functionCall?: FunctionCallCstNode[]

iri?

optional iri?: IriCstNode[]

literal?

optional literal?: LiteralCstNode[]

LPAREN?

optional LPAREN?: IToken[]

RPAREN?

optional RPAREN?: IToken[]

VARIABLE?

optional VARIABLE?: IToken[]


PropertyAssertion

PropertyAssertion = object

Properties

graph?

optional graph?: DatalogTerm

object

object: DatalogTerm

predicate

predicate: string

subject

subject: DatalogTerm


PropertyAtom

PropertyAtom = object

Properties

graph?

optional graph?: DatalogTerm

object

object: DatalogTerm

predicate

predicate: string

subject

subject: DatalogTerm

type

type: "property"


ReadOnlySparqlOptions

ReadOnlySparqlOptions = object

Properties

defaults?

optional defaults?: SparqlParseDefaults

federation?

optional federation?: SparqlFederationPolicy


RegexFunctionCstChildren

RegexFunctionCstChildren = object

Properties

COMMA

COMMA: IToken[]

flagsExpr?

optional flagsExpr?: ExpressionCstNode[]

LPAREN

LPAREN: IToken[]

patternExpr

patternExpr: ExpressionCstNode[]

REGEX

REGEX: IToken[]

RPAREN

RPAREN: IToken[]

textExpr

textExpr: ExpressionCstNode[]


RelationalExpressionCstChildren

RelationalExpressionCstChildren = object

Properties

additiveExpression

additiveExpression: AdditiveExpressionCstNode[]

argumentList?

optional argumentList?: ArgumentListCstNode[]

EQUALS?

optional EQUALS?: IToken[]

GREATER_THAN?

optional GREATER_THAN?: IToken[]

GREATER_THAN_OR_EQUAL?

optional GREATER_THAN_OR_EQUAL?: IToken[]

IN?

optional IN?: IToken[]

LESS_THAN?

optional LESS_THAN?: IToken[]

LESS_THAN_OR_EQUAL?

optional LESS_THAN_OR_EQUAL?: IToken[]

LPAREN?

optional LPAREN?: IToken[]

NOT?

optional NOT?: IToken[]

NOT_EQUALS?

optional NOT_EQUALS?: IToken[]

RPAREN?

optional RPAREN?: IToken[]


ResolvableTerm

ResolvableTerm = object

Properties

domainIncludes

domainIncludes: string[]

rangeIncludes

rangeIncludes: string[]


RoundFunctionCstChildren

RoundFunctionCstChildren = object

Properties

expression

expression: ExpressionCstNode[]

LPAREN

LPAREN: IToken[]

ROUND

ROUND: IToken[]

RPAREN

RPAREN: IToken[]


RuleBodyCstChildren

RuleBodyCstChildren = object

Properties

bodyFormula

bodyFormula: BodyFormulaCstNode[]

COMMA?

optional COMMA?: IToken[]


RuleCstChildren

RuleCstChildren = object

Properties

DOT

DOT: IToken[]

RULE_ARROW

RULE_ARROW: IToken[]

ruleBody?

optional ruleBody?: RuleBodyCstNode[]

ruleHead

ruleHead: RuleHeadCstNode[]


RuleHeadCstChildren

RuleHeadCstChildren = object

Properties

COMMA?

optional COMMA?: IToken[]

tupleTableAtom

tupleTableAtom: TupleTableAtomCstNode[]


RuleVocabulary

RuleVocabulary = object

Properties

body

body: RuleVocabularyPosition

head

head: RuleVocabularyPosition


RuleVocabularyExtractionResult

RuleVocabularyExtractionResult = { ok: true; vocabulary: RuleVocabulary; } | { issues: DatalogParseIssue[]; ok: false; }


RuleVocabularyPosition

RuleVocabularyPosition = object

Properties

classes

classes: RuleVocabularyReference[]

predicates

predicates: RuleVocabularyReference[]


RuleVocabularyReference

RuleVocabularyReference = object

Properties

graph?

optional graph?: DatalogTerm

term

term: string


SimpleComparison

SimpleComparison = object

Properties

literal

literal: LiteralTerm

operator

operator: ComparisonOperator

variableName

variableName: string


SkolemAtomCstChildren

SkolemAtomCstChildren = object

Properties

argumentList

argumentList: ArgumentListCstNode[]

LPAREN

LPAREN: IToken[]

RPAREN

RPAREN: IToken[]

SKOLEM

SKOLEM: IToken[]


SkolemFunctionCstChildren

SkolemFunctionCstChildren = object

Properties

argumentList

argumentList: ArgumentListCstNode[]

LPAREN

LPAREN: IToken[]

RPAREN

RPAREN: IToken[]

SKOLEM

SKOLEM: IToken[]


SourceSpan

SourceSpan = object

Properties

end

end: number

start

start: number


SparqlExplicitTriple

SparqlExplicitTriple = SparqlTriple & object

Type Declaration

explicit?

optional explicit?: SparqlTerm


SparqlExpression

SparqlExpression = ExpressionOperation | ExpressionPatternOperation | ExpressionFunctionCall | ExpressionAggregate | SparqlTermIri | SparqlTermVariable | TermLiteral


SparqlFederationPolicy

SparqlFederationPolicy = object

Properties

allowedEndpoints

allowedEndpoints: readonly string[]

allowedPrefixes?

optional allowedPrefixes?: readonly string[]

gatewayEndpoints?

optional gatewayEndpoints?: boolean

maxServices?

optional maxServices?: number

reservedOrigins?

optional reservedOrigins?: readonly string[]


SparqlFederationResult

SparqlFederationResult = { allowed: true; endpoints: string[]; gatewayed: string[]; } | { allowed: false; endpoint?: string; error: string; }


SparqlGraphNode

SparqlGraphNode = SparqlTerm | SparqlTripleCollection


SparqlParseDefaults

SparqlParseDefaults = object

Properties

baseIRI?

optional baseIRI?: string

prefixes?

optional prefixes?: Record<string, string>


SparqlPath

SparqlPath = SparqlTermIri | PropertyPathChain | PathModified | PathNegated


SparqlPattern

SparqlPattern = SparqlPatternBgp | SparqlPatternGroup | PatternUnion | PatternOptional | PatternMinus | PatternGraph | PatternService | SparqlPatternFilter | PatternBind | PatternValues | SubSelect


SparqlPatternBgp

SparqlPatternBgp = PatternBase & object

Type Declaration

subType

subType: "bgp"

triples

triples: BasicGraphPattern

Only the first appearance of a subject and predicate have a string manifestation


SparqlPatternFilter

SparqlPatternFilter = PatternBase & object

Type Declaration

expression

expression: SparqlExpression

subType

subType: "filter"


SparqlPatternGroup

SparqlPatternGroup = PatternBase & object

Type Declaration

patterns

patterns: SparqlPattern[]

subType

subType: "group"


SparqlQuads

SparqlQuads = SparqlPatternBgp | GraphQuads


SparqlQuery

SparqlQuery = SparqlQueryNode | SparqlUpdate


SparqlQueryNode

SparqlQueryNode = QuerySelect | QueryConstruct | QueryDescribe | QueryAsk


SparqlQueryType

SparqlQueryType = "select" | "construct" | "describe" | "ask" | "update"


SparqlScope

SparqlScope = object

Properties

baseIRI

baseIRI: string | undefined

prefixes

prefixes: Record<string, string>


SparqlTerm

SparqlTerm = GraphTerm | SparqlTermVariable


SparqlTermBlank

SparqlTermBlank = TermBase & object & object

Type Declaration

subType

subType: "blankNode"

label

label: string


SparqlTermIri

SparqlTermIri = TermIriFull | TermIriPrefixed


SparqlTermVariable

SparqlTermVariable = TermBase & object

Type Declaration

subType

subType: "variable"

value

value: string


SparqlTriple

SparqlTriple = Node & object

Type Declaration

object

object: SparqlGraphNode

predicate

predicate: SparqlTermIri | SparqlTermVariable | SparqlPath

subject

subject: SparqlGraphNode

type

type: "triple"


SparqlTripleCollection

SparqlTripleCollection = TripleCollectionList | TripleCollectionBlankNodeProperties


SparqlUpdate

SparqlUpdate = Node & object

Type Declaration

type

type: "update"

updates

updates: object[]


SparqlUpdateOperation

SparqlUpdateOperation = UpdateOperationLoad | UpdateOperationClear | UpdateOperationDrop | UpdateOperationCreate | UpdateOperationAdd | UpdateOperationMove | UpdateOperationCopy | UpdateOperationInsertData | UpdateOperationDeleteData | UpdateOperationDeleteWhere | UpdateOperationModify


SparqlUpdateValidationResult

SparqlUpdateValidationResult = { allowed: true; operationTypes: DataManipulationSubType[]; } | { allowed: false; blockedOperations?: UpdateSubType[]; error: string; }


SparqlValidationResult

SparqlValidationResult = { isReadOnly: boolean; queryType: SparqlQueryType; valid: true; } | { error: string; valid: false; }


StrFunctionCstChildren

StrFunctionCstChildren = object

Properties

expression

expression: ExpressionCstNode[]

LPAREN

LPAREN: IToken[]

RPAREN

RPAREN: IToken[]

STR

STR: IToken[]


StringLiteralCstChildren

StringLiteralCstChildren = object

Properties

HAT?

optional HAT?: IToken[]

iri?

optional iri?: IriCstNode[]

LANGTAG?

optional LANGTAG?: IToken[]

STRING_LITERAL?

optional STRING_LITERAL?: IToken[]

STRING_LITERAL_LONG?

optional STRING_LITERAL_LONG?: IToken[]


TermCstChildren

TermCstChildren = object

Properties

BLANK_NODE?

optional BLANK_NODE?: IToken[]

iri?

optional iri?: IriCstNode[]

literal?

optional literal?: LiteralCstNode[]

VARIABLE?

optional VARIABLE?: IToken[]


TermExpression

TermExpression = object

Properties

term

term: DatalogTerm

type

type: "term"


TripleAtom

TripleAtom = object

Properties

graph?

optional graph?: DatalogTerm

object

object: DatalogTerm

predicate

predicate: DatalogTerm

subject

subject: DatalogTerm

type

type: "triple"


TupleTableAtomCstChildren

TupleTableAtomCstChildren = object

Properties

defaultGraphAtom?

optional defaultGraphAtom?: DefaultGraphAtomCstNode[]

generalAtom?

optional generalAtom?: GeneralAtomCstNode[]

graph?

optional graph?: GraphNameCstNode[]


UnaryAggregateBinding

UnaryAggregateBinding = AggregateBindingTarget & object

Type Declaration

distinct?

optional distinct?: boolean

expression

expression: DatalogExpression | "*"

function

function: UnaryAggregateFunction

percentile?

optional percentile?: never

secondExpression?

optional secondExpression?: never


UnaryAggregateFunction

UnaryAggregateFunction = "COUNT" | "MIN" | "MAX" | "SUM" | "MUL" | "AVG" | "COUNT_MIN" | "COUNT_MAX" | "VAR_POP" | "VAR_SAMP" | "STDDEV_POP" | "STDDEV_SAMP" | "MODE"


UnaryExpression

UnaryExpression = object

Properties

operand

operand: DatalogExpression

operator

operator: "!" | "+" | "-"

type

type: "unary"


UnaryExpressionCstChildren

UnaryExpressionCstChildren = object

Properties

EXCLAMATION?

optional EXCLAMATION?: IToken[]

MINUS?

optional MINUS?: IToken[]

PLUS?

optional PLUS?: IToken[]

primaryExpression

primaryExpression: PrimaryExpressionCstNode[]


UpdateSubType

UpdateSubType = SparqlUpdateOperation["subType"]


VariableTerm

VariableTerm = object

Properties

name

name: string

type

type: "variable"


VariableType

VariableType = object

Properties

source

source: VariableTypeSource

typeTerm

typeTerm: string

variable

variable: string


VariableTypeEvidence

VariableTypeEvidence = object

Properties

bodyClassTerm?

optional bodyClassTerm?: string

classTerm?

optional classTerm?: string

predicateEvidence

predicateEvidence: PredicateEvidence[]

variable

variable: string


VariableTypeSource

VariableTypeSource = "class" | PredicatePosition


XsdDatatypeLocalName

XsdDatatypeLocalName = keyof typeof xsdDatatypes

Variables

AGGREGATE

const AGGREGATE: TokenType


allTokens

const allTokens: TokenType[]


AND

const AND: TokenType


AS

const AS: TokenType


AT

const AT: TokenType


AVG

const AVG: TokenType


BaseDatalogVisitor

const BaseDatalogVisitor: new (…args) => ICstVisitor<any, any>

Parameters

args

…any[]

Returns

ICstVisitor<any, any>


BIND

const BIND: TokenType


BLANK_NODE

const BLANK_NODE: TokenType


booleanLiteralTokenTypes

const booleanLiteralTokenTypes: Set<TokenType>


builtinFunctionTokenTypes

const builtinFunctionTokenTypes: Set<TokenType>


COMMA

const COMMA: TokenType


COMMENT

const COMMENT: TokenType


CONCAT

const CONCAT: TokenType


COUNT

const COUNT: TokenType


COUNT_MAX

const COUNT_MAX: TokenType


COUNT_MIN

const COUNT_MIN: TokenType


DECIMAL

const DECIMAL: TokenType


DEFAULT_NS_IRI

const DEFAULT_NS_IRI: TokenType


delimiterTokenTypes

const delimiterTokenTypes: Set<TokenType>


DISTINCT

const DISTINCT: TokenType


DOT

const DOT: TokenType


DOUBLE

const DOUBLE: TokenType


EQUALS

const EQUALS: TokenType


EXCLAMATION

const EXCLAMATION: TokenType


EXISTS

const EXISTS: TokenType


FALSE

const FALSE: TokenType


FILTER

const FILTER: TokenType


GREATER_THAN

const GREATER_THAN: TokenType


GREATER_THAN_OR_EQUAL

const GREATER_THAN_OR_EQUAL: TokenType


HAT

const HAT: TokenType


IDENTIFIER

const IDENTIFIER: TokenType


IF

const IF: TokenType


IN

const IN: TokenType


INTEGER

const INTEGER: TokenType


INTERNAL_FUNCTION

const INTERNAL_FUNCTION: TokenType


IRI

const IRI: TokenType


IRI_REF

const IRI_REF: TokenType


iriBodyCharClass

const iriBodyCharClass: “[^\\s<>\”{}|^`\\\\]” = ‘[^\\s<>“{}|^`\\\\]’


iriTokenTypes

const iriTokenTypes: Set<TokenType>


keywordTokenTypes

const keywordTokenTypes: Set<TokenType>


LANGTAG

const LANGTAG: TokenType


LBRACKET

const LBRACKET: TokenType


LESS_THAN

const LESS_THAN: TokenType


LESS_THAN_OR_EQUAL

const LESS_THAN_OR_EQUAL: TokenType


LPAREN

const LPAREN: TokenType


MAX

const MAX: TokenType


MAX_ARGMAX

const MAX_ARGMAX: TokenType


MAX_ARGMIN

const MAX_ARGMIN: TokenType


MIN

const MIN: TokenType


MIN_ARGMAX

const MIN_ARGMAX: TokenType


MIN_ARGMIN

const MIN_ARGMIN: TokenType


MINUS

const MINUS: TokenType


MODE

const MODE: TokenType


MUL

const MUL: TokenType


namedGraphWriteMessage

const namedGraphWriteMessage: "This write may change only the default graph: GRAPH, WITH and USING are not permitted." = "This write may change only the default graph: GRAPH, WITH and USING are not permitted."


noFederation

const noFederation: SparqlFederationPolicy


NOT

const NOT: TokenType


NOT_EQUALS

const NOT_EQUALS: TokenType


numericLiteralTokenTypes

const numericLiteralTokenTypes: Set<TokenType>


ON

const ON: TokenType


operatorTokenTypes

const operatorTokenTypes: Set<TokenType>


OR

const OR: TokenType


PERCENTILE

const PERCENTILE: TokenType


PERCENTILE_CONT

const PERCENTILE_CONT: TokenType


PERCENTILE_DISC

const PERCENTILE_DISC: TokenType


PLUS

const PLUS: TokenType


PREFIX_ONLY

const PREFIX_ONLY: TokenType


PREFIXED_NAME

const PREFIXED_NAME: TokenType


RBRACKET

const RBRACKET: TokenType


REGEX

const REGEX: TokenType


ROUND

const ROUND: TokenType


RPAREN

const RPAREN: TokenType


RULE_ARROW

const RULE_ARROW: TokenType


SEMICOLON

const SEMICOLON: TokenType


serviceInUpdateMessage

const serviceInUpdateMessage: "SERVICE federation is not allowed in an update: a write may read only this datastore." = "SERVICE federation is not allowed in an update: a write may read only this datastore."


SKOLEM

const SKOLEM: TokenType


SLASH

const SLASH: TokenType


sparqlAstFactory

const sparqlAstFactory: AstFactory


STAR

const STAR: TokenType


STDDEV_POP

const STDDEV_POP: TokenType


STDDEV_SAMP

const STDDEV_SAMP: TokenType


STR

const STR: TokenType


STRING_LITERAL

const STRING_LITERAL: TokenType


STRING_LITERAL_LONG

const STRING_LITERAL_LONG: TokenType


stringLiteralTokenTypes

const stringLiteralTokenTypes: Set<TokenType>


SUM

const SUM: TokenType


termTokenTypes

const termTokenTypes: Set<TokenType>


TRUE

const TRUE: TokenType


VAR_POP

const VAR_POP: TokenType


VAR_SAMP

const VAR_SAMP: TokenType


VARIABLE

const VARIABLE: TokenType


WHITESPACE

const WHITESPACE: TokenType


xsdDatatypes

const xsdDatatypes: object

Type Declaration

boolean

readonly boolean: "xsd:boolean" = "xsd:boolean"

date

readonly date: "xsd:date" = "xsd:date"

dateTime

readonly dateTime: "xsd:dateTime" = "xsd:dateTime"

decimal

readonly decimal: "xsd:decimal" = "xsd:decimal"

double

readonly double: "xsd:double" = "xsd:double"

integer

readonly integer: "xsd:integer" = "xsd:integer"

string

readonly string: "xsd:string" = "xsd:string"

Functions

areRulesEquivalent()

areRulesEquivalent(rule1, rule2): boolean

Check if two rules are semantically equivalent (ignoring whitespace)

Parameters

rule1

string

rule2

string

Returns

boolean


assertNoGroundedTargets()

assertNoGroundedTargets(body): void

Parameters

body

DatalogBodyFormula[]

Returns

void


astBuilder()

astBuilder(): DatalogAstBuilder

Returns

DatalogAstBuilder


atomToDatalogText()

atomToDatalogText(atom, options?): string

Parameters

atom

DatalogAtom

options?

DatalogTextOptions = {}

Returns

string


binaryOperandNeedsParentheses()

binaryOperandNeedsParentheses(operand, parentOperator, side): boolean

Parameters

operand

DatalogExpression

parentOperator

"*" | “||” | "&&" | "=" | "!=" | "<" | ">" | "<=" | ">=" | "+" | "-" | "/"

side

"left" | "right"

Returns

boolean


canonicalRuleText()

canonicalRuleText(rule): string

Parameters

rule

string

Returns

string


checkSparqlFederation()

checkSparqlFederation(ast, policy, defaults?): SparqlFederationResult

Parameters

ast

SparqlQuery

policy

SparqlFederationPolicy

defaults?

SparqlParseDefaults = {}

Returns

SparqlFederationResult


classAssertionFromAtom()

classAssertionFromAtom(atom): ClassAssertion | null

Parameters

atom

DatalogAtom

Returns

ClassAssertion | null


collectVariableTypeEvidence()

collectVariableTypeEvidence(ast): VariableTypeEvidence[]

Parameters

ast

DatalogRule

Returns

VariableTypeEvidence[]


datalogBodyToSparqlSelect()

datalogBodyToSparqlSelect(bodyFormulas, prefixes?): SparqlSelectResult

Parameters

bodyFormulas

DatalogBodyFormula[]

prefixes?

Record<string, string>

Returns

SparqlSelectResult


datatypeToTermText()

datatypeToTermText(datatype): string

Parameters

datatype

string

Returns

string


expandedParserInstance()

expandedParserInstance(): ExpandedDatalogParser

Returns

ExpandedDatalogParser


explainInferenceFailure()

explainInferenceFailure(result): string

Generate meaningful error messages for inference verification failures

Parameters

result

InferenceVerificationResult

Returns

string


expressionToDatalogParts()

expressionToDatalogParts(expression, options?): DatalogTextPart[]

Parameters

expression

DatalogExpression

options?

DatalogTextOptions = {}

Returns

DatalogTextPart[]


expressionToDatalogText()

expressionToDatalogText(expression, options?): string

Parameters

expression

DatalogExpression

options?

DatalogTextOptions = {}

Returns

string


extractRuleVocabulary()

extractRuleVocabulary(ruleText): RuleVocabularyExtractionResult

Parameters

ruleText

string

Returns

RuleVocabularyExtractionResult


extractRuleVocabularyFromAst()

extractRuleVocabularyFromAst(rule): RuleVocabulary

Parameters

rule

DatalogRuleAst

Returns

RuleVocabulary


extractRuleVocabularyFromAtom()

extractRuleVocabularyFromAtom(atom): RuleVocabularyPosition

Parameters

atom

DatalogAtom

Returns

RuleVocabularyPosition


extractVariables()

extractVariables(rule): string[]

Parameters

rule

DatalogRule

Returns

string[]


flattenTriples()

flattenTriples(block): SparqlTriple[]

Parameters

block

BasicGraphPattern

Returns

SparqlTriple[]


formulaContainsSkolem()

formulaContainsSkolem(formula): boolean

Parameters

formula

DatalogBodyFormula

Returns

boolean


formulaSourceTexts()

formulaSourceTexts(rule): DatalogRuleSourceTexts | undefined

Parameters

rule

DatalogRule

Returns

DatalogRuleSourceTexts | undefined


generateSparql()

generateSparql(ast): string

Parameters

ast

SparqlQuery

Returns

string


getAggregateFunction()

getAggregateFunction(binding): UnaryAggregateFunction | BinaryAggregateFunction | PercentileAggregateFunction | undefined

Parameters

binding

AggregateBinding

Returns

UnaryAggregateFunction | BinaryAggregateFunction | PercentileAggregateFunction | undefined


getAtomType()

getAtomType(atom): string

Parameters

atom

DatalogAtom

Returns

string


getExpressionType()

getExpressionType(expr): string

Parameters

expr

DatalogExpression

Returns

string


getRelatedVariables()

getRelatedVariables(rule, targetVariableName): Set<string>

Parameters

rule

DatalogRule

targetVariableName

string

Returns

Set<string>


getTermType()

getTermType(term): string

Parameters

term

DatalogTerm

Returns

string


getVariablesFromAtom()

getVariablesFromAtom(atom): VariableTerm[]

Parameters

atom

DatalogAtom

Returns

VariableTerm[]


getVariablesFromAtomIncludingGraph()

getVariablesFromAtomIncludingGraph(atom): VariableTerm[]

Parameters

atom

DatalogAtom

Returns

VariableTerm[]


invertComparisonOperator()

invertComparisonOperator(operator): ComparisonOperator

Parameters

operator

ComparisonOperator

Returns

ComparisonOperator


isAggregateFormula()

isAggregateFormula(formula): formula is DatalogAggregate

Parameters

formula

DatalogBodyFormula

Returns

formula is DatalogAggregate


isBareNumericLiteral()

isBareNumericLiteral(literal): boolean

Parameters

literal

LiteralTerm

Returns

boolean


isBinaryExpression()

isBinaryExpression(expr): expr is BinaryExpression

Parameters

expr

DatalogExpression

Returns

expr is BinaryExpression


isBindFormula()

isBindFormula(formula): formula is DatalogBind

Parameters

formula

DatalogBodyFormula

Returns

formula is DatalogBind


isBlankNodeTerm()

isBlankNodeTerm(term): term is BlankNodeTerm

Parameters

term

DatalogTerm

Returns

term is BlankNodeTerm


isBooleanLiteral()

isBooleanLiteral(literal): boolean

Parameters

literal

LiteralTerm

Returns

boolean


isClassAtom()

isClassAtom(atom): atom is ClassAtom

Parameters

atom

DatalogAtom

Returns

atom is ClassAtom


isComparisonOperator()

isComparisonOperator(operator): operator is ComparisonOperator

Parameters

operator

"*" | “||” | "&&" | "=" | "!=" | "<" | ">" | "<=" | ">=" | "+" | "-" | "/"

Returns

operator is ComparisonOperator


isDatalogAtom()

isDatalogAtom(formula): formula is DatalogAtom

Parameters

formula

DatalogBodyFormula

Returns

formula is DatalogAtom


isDateLiteral()

isDateLiteral(literal): boolean

Parameters

literal

LiteralTerm

Returns

boolean


isDateTimeLiteral()

isDateTimeLiteral(literal): boolean

Parameters

literal

LiteralTerm

Returns

boolean


isFilterFormula()

isFilterFormula(formula): formula is DatalogFilter

Parameters

formula

DatalogBodyFormula

Returns

formula is DatalogFilter


isFullIri()

isFullIri(value): boolean

Parameters

value

string

Returns

boolean


isFunctionCallExpression()

isFunctionCallExpression(expr): expr is FunctionCallExpression

Parameters

expr

DatalogExpression

Returns

expr is FunctionCallExpression


isGeneralAtom()

isGeneralAtom(atom): atom is GeneralAtom

Parameters

atom

DatalogAtom

Returns

atom is GeneralAtom


isIriTerm()

isIriTerm(term): term is IriTerm

Parameters

term

DatalogTerm

Returns

term is IriTerm


isLiteralTerm()

isLiteralTerm(term): term is LiteralTerm

Parameters

term

DatalogTerm

Returns

term is LiteralTerm


isLogicalOperator()

isLogicalOperator(operator): boolean

Parameters

operator

"*" | “||” | "&&" | "=" | "!=" | "<" | ">" | "<=" | ">=" | "+" | "-" | "/"

Returns

boolean


isNegationFormula()

isNegationFormula(formula): formula is DatalogNegation

Parameters

formula

DatalogBodyFormula

Returns

formula is DatalogNegation


isNumericLiteral()

isNumericLiteral(literal): boolean

Parameters

literal

LiteralTerm

Returns

boolean


isNumericLiteralTerm()

isNumericLiteralTerm(term): term is LiteralTerm

Parameters

term

DatalogTerm

Returns

term is LiteralTerm


isNumericOperator()

isNumericOperator(operator): boolean

Parameters

operator

"*" | “||” | "&&" | "=" | "!=" | "<" | ">" | "<=" | ">=" | "+" | "-" | "/"

Returns

boolean


isNumericRdfValue()

isNumericRdfValue(value): boolean

Parameters

value

string

Returns

boolean


isPropertyAtom()

isPropertyAtom(atom): atom is PropertyAtom

Parameters

atom

DatalogAtom

Returns

atom is PropertyAtom


isQueryableTermIri()

isQueryableTermIri(iri): boolean

Parameters

iri

string

Returns

boolean


isReadOnlySparqlQuery()

isReadOnlySparqlQuery(query, options?): object

Parameters

query

string

options?

ReadOnlySparqlOptions = {}

Returns

object

allowed

allowed: boolean

error?

optional error?: string

queryType?

optional queryType?: SparqlQueryType

serviceEndpoints?

optional serviceEndpoints?: string[]


isSkolemFormula()

isSkolemFormula(formula): formula is DatalogSkolem

Parameters

formula

DatalogBodyFormula

Returns

formula is DatalogSkolem


isTermExpression()

isTermExpression(expr): expr is TermExpression

Parameters

expr

DatalogExpression

Returns

expr is TermExpression


isTripleAtom()

isTripleAtom(atom): atom is TripleAtom

Parameters

atom

DatalogAtom

Returns

atom is TripleAtom


isUnaryExpression()

isUnaryExpression(expr): expr is UnaryExpression

Parameters

expr

DatalogExpression

Returns

expr is UnaryExpression


isVariableTerm()

isVariableTerm(term): term is VariableTerm

Parameters

term

DatalogTerm

Returns

term is VariableTerm


isXsdDatatype()

isXsdDatatype(datatype, localName): boolean

Parameters

datatype

string | undefined

localName

"string" | "boolean" | "integer" | "decimal" | "double" | "date" | "dateTime"

Returns

boolean


literalSetComparisonFromExpression()

literalSetComparisonFromExpression(expression): LiteralSetComparison | null

Parameters

expression

DatalogExpression

Returns

LiteralSetComparison | null


literalToDisplayText()

literalToDisplayText(literal): string

Parameters

literal

LiteralTerm

Returns

string


mintedVariable()

mintedVariable(formula): string | null

Parameters

formula

DatalogBodyFormula

Returns

string | null


mintedVariableNames()

mintedVariableNames(rule): Set<string>

The variables a rule mints a new node for. An IRI(...) bind counts only when the head describes the node and no body atom binds it already, since it otherwise names or checks an existing node.

Parameters

rule

DatalogRule

Returns

Set<string>


parseBooleanLiteral()

parseBooleanLiteral(value): boolean | undefined

Parameters

value

string

Returns

boolean | undefined


parseDatalogRule()

parseDatalogRule(ruleText): DatalogRule

Parse a Datalog rule string into a type-safe AST

Parameters

ruleText

string

Returns

DatalogRule


parseDatalogRuleWithIssues()

parseDatalogRuleWithIssues(ruleText): DatalogParseResult

Parse a Datalog rule string, returning structured issues with source positions instead of throwing on invalid input

Parameters

ruleText

string

Returns

DatalogParseResult


parseDatalogTermText()

parseDatalogTermText(termText): DatalogTerm | undefined

Parse a single Datalog term (IRI, literal, blank node, or variable) from its text form.

Fact values reach the UI as Datalog term text rather than bare strings, so rendering one means recovering its structure first: a literal carries quotes and an optional datatype or language suffix around the value to display, while an IRI denotes an entity and is rendered as a chip instead. Literal source spans are relative to the input text.

Returns undefined when the text is not exactly one term.

Parameters

termText

string

Returns

DatalogTerm | undefined


parseGroundedDatalogRule()

parseGroundedDatalogRule(ruleText): GroundedDatalogRule

Parse a grounded rule returned by the engine, where AS targets have been substituted with the values they evaluated to. Authored rules must go through parseDatalogRule so that those substitutions stay invalid.

Parameters

ruleText

string

Returns

GroundedDatalogRule


parseGroundedRule()

parseGroundedRule(text): CstNode

Parse a grounded rule and return its CST, accepting values in AS target position. Use parseRule for anything a human or the agent authored.

Parameters

text

string

Returns

CstNode


parserInstance()

parserInstance(): DatalogParser

Returns

DatalogParser


parseRule()

parseRule(text): CstNode

Parameters

text

string

Returns

CstNode


parseRuleWith()

parseRuleWith(parser, text): CstNode

Lex and parse text with the given parser instance (strict or expanded).

Parameters

parser

DatalogParser

text

string

Returns

CstNode


parseSparql()

parseSparql(text, defaults?): SparqlQuery

Parameters

text

string

defaults?

SparqlParseDefaults = {}

Returns

SparqlQuery


plainDecimalText()

plainDecimalText(value): string

Parameters

value

string

Returns

string


positiveBodyContainsSkolem()

positiveBodyContainsSkolem(body): boolean

Parameters

body

DatalogBodyFormula[]

Returns

boolean


propertyAssertionFromAtom()

propertyAssertionFromAtom(atom): PropertyAssertion | null

Parameters

atom

DatalogAtom

Returns

PropertyAssertion | null


resolveSparqlIri()

resolveSparqlIri(term, scope): string

Parameters

term

SparqlTermIri

scope

SparqlScope

Returns

string


resolveVariableTypes()

resolveVariableTypes(evidence, lookupTerm): VariableType[]

Parameters

evidence

VariableTypeEvidence[]

lookupTerm

(term) => ResolvableTerm | undefined

Returns

VariableType[]


rewriteServiceEndpoints()

rewriteServiceEndpoints(ast, targets, defaults?): void

Parameters

ast

SparqlQuery

targets

ReadonlyMap<string, string>

defaults?

SparqlParseDefaults = {}

Returns

void


ruleSpans()

ruleSpans(cst): DatalogRuleSpans

Parameters

cst

CstNode

Returns

DatalogRuleSpans


simpleComparisonFromExpression()

simpleComparisonFromExpression(expression): SimpleComparison | null

Parameters

expression

DatalogExpression

Returns

SimpleComparison | null


simpleComparisonFromFilter()

simpleComparisonFromFilter(filter): SimpleComparison | null

Parameters

filter

DatalogFilter

Returns

SimpleComparison | null


sparqlRemoteFetchRefusal()

sparqlRemoteFetchRefusal(sparql, kind, policy?, defaults?): string | undefined

Parameters

sparql

string

kind

"query" | "update"

policy?

SparqlFederationPolicy = noFederation

defaults?

SparqlParseDefaults = {}

Returns

string | undefined


sparqlScope()

sparqlScope(ast, defaults?): SparqlScope

Parameters

ast

SparqlQuery

defaults?

SparqlParseDefaults = {}

Returns

SparqlScope


termsEqual()

termsEqual(left, right): boolean

Parameters

left

DatalogTerm

right

DatalogTerm

Returns

boolean


termTextsEqual()

termTextsEqual(left, right): boolean | undefined

Compare two serialized terms by meaning rather than by text, so 1.2, "1.2"^^xsd:decimal and "1.2"^^<http://www.w3.org/2001/XMLSchema#decimal> all count as the same value. Returns undefined when either side is not a single term, so callers can tell “different” apart from “not comparable”. Prefixed and absolute IRIs are not resolved against each other - normalize IRIs to one form before calling.

Parameters

left

string

right

string

Returns

boolean | undefined


termToDatalogText()

termToDatalogText(term, options?): string

Parameters

term

DatalogTerm

options?

DatalogTextOptions = {}

Returns

string


termToSparql()

termToSparql(term): string

Parameters

term

DatalogTerm

Returns

string


tokenizeDatalog()

tokenizeDatalog(text): ILexingResult

Parameters

text

string

Returns

ILexingResult


unaryOperandNeedsParentheses()

unaryOperandNeedsParentheses(operand): boolean

Parameters

operand

DatalogExpression

Returns

boolean


unwrapTermExpression()

unwrapTermExpression(expression): DatalogTerm | null

Parameters

expression

DatalogExpression

Returns

DatalogTerm | null


usesSparqlService()

usesSparqlService(ast): boolean

Parameters

ast

SparqlQuery

Returns

boolean


validateDatalogRule()

validateDatalogRule(ruleText): object

Validate Datalog rule syntax and that every required variable is bound.

Parameters

ruleText

string

Returns

object

error?

optional error?: string

valid

valid: boolean


validateDataManipulationUpdate()

validateDataManipulationUpdate(update, options?): SparqlUpdateValidationResult

Parameters

update

string

options?

DataManipulationOptions = {}

Returns

SparqlUpdateValidationResult


validateRuleSyntax()

validateRuleSyntax(text): object

Parameters

text

string

Returns

object

error?

optional error?: string

valid

valid: boolean


validateSparqlQuery()

validateSparqlQuery(query, defaults?): SparqlValidationResult

Parameters

query

string

defaults?

SparqlParseDefaults = {}

Returns

SparqlValidationResult


variableNameFromTermExpression()

variableNameFromTermExpression(expression): string | null

Parameters

expression

DatalogExpression

Returns

string | null


variableNamesFromAtom()

variableNamesFromAtom(atom): string[]

Parameters

atom

DatalogAtom

Returns

string[]


variableNamesFromExpression()

variableNamesFromExpression(expression): string[]

Parameters

expression

DatalogExpression

Returns

string[]


verifyRuleInference()

verifyRuleInference(rule, endpointUrl, datastoreId, authorization, testTriple?): Promise<InferenceVerificationResult>

Verify that a rule produces the expected inference

Parameters

rule

DatalogRule

endpointUrl

string

datastoreId

string

authorization

string

testTriple?
object

string

predicate

string

subject

string

Returns

Promise<InferenceVerificationResult>

References

remoteFetchInUpdateMessage

Re-exports remoteFetchInUpdateMessage


remoteFetchKeywords

Re-exports remoteFetchKeywords


RemoteFetchKeywords

Re-exports RemoteFetchKeywords


serviceEndpointOrigin

Re-exports serviceEndpointOrigin


unescapeSparqlCodepoints

Re-exports unescapeSparqlCodepoints