@faubulous/mentor-rdf-parsers
    Preparing search index...

    Class TrigParser

    A W3C compliant parser for the TriG syntax. https://www.w3.org/TR/trig

    Hierarchy

    • TurtleParserBase
      • TrigParser

    Implements

    Index

    Constructors

    Properties

    annotation: ParserMethod<[], CstNode> = ...

    https://www.w3.org/TR/rdf12-turtle/#grammar-production-annotation annotation ::= (reifier | annotationBlock)*

    annotationBlock: ParserMethod<[], CstNode> = ...

    https://www.w3.org/TR/rdf12-turtle/#grammar-production-annotationBlock annotationBlock ::= '{|' predicateObjectList '|}'

    anon: ParserMethod<[], CstNode> = ...
    base: ParserMethod<[], CstNode> = ...
    blank: ParserMethod<[], CstNode> = ...
    blankNode: ParserMethod<[], CstNode> = ...
    blankNodePropertyList: ParserMethod<[], CstNode> = ...
    block: ParserMethod<[], CstNode> = ...
    booleanLiteral: ParserMethod<[], CstNode> = ...
    collection: ParserMethod<[], CstNode> = ...
    datatype: ParserMethod<[], CstNode> = ...
    directive: ParserMethod<[], CstNode> = ...

    An array of recognition exceptions that occurred during parsing. This can be used to identify and handle any syntax errors in the input document.

    iri: ParserMethod<[], CstNode> = ...
    labelOrSubject: ParserMethod<[], CstNode> = ...
    literal: ParserMethod<[], CstNode> = ...
    namespaces: Record<string, string> = {}

    A map of prefixes to their namespace IRI.

    numericLiteral: ParserMethod<[], CstNode> = ...
    object: ParserMethod<[], CstNode> = ...
    objectList: ParserMethod<[], CstNode> = ...

    https://www.w3.org/TR/rdf12-turtle/#grammar-production-objectList objectList ::= object annotation ( ',' object annotation )*

    predicate: ParserMethod<[], CstNode> = ...
    predicateObjectList: ParserMethod<[], CstNode> = ...
    prefix: ParserMethod<[], CstNode> = ...
    prefixedName: ParserMethod<[], CstNode> = ...
    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:

    reifiedTriple: ParserMethod<[], CstNode> = ...

    https://www.w3.org/TR/rdf12-turtle/#grammar-production-reifiedTriple reifiedTriple ::= '<<' rtSubject verb rtObject reifier? '>>'

    reifier: ParserMethod<[], CstNode> = ...
    rtObject: ParserMethod<[], CstNode> = ...

    https://www.w3.org/TR/rdf12-turtle/#grammar-production-rtObject rtObject ::= iri | BlankNode | literal | tripleTerm | reifiedTriple

    rtSubject: ParserMethod<[], CstNode> = ...

    https://www.w3.org/TR/rdf12-turtle/#grammar-production-rtSubject rtSubject ::= iri | BlankNode | reifiedTriple

    semanticErrors: any[] = []

    Semantic errors collected during parsing (e.g., UndefinedNamespacePrefixError).

    sparqlBase: ParserMethod<[], CstNode> = ...
    sparqlPrefix: ParserMethod<[], CstNode> = ...
    sparqlVersion: ParserMethod<[], CstNode> = ...

    https://www.w3.org/TR/rdf12-turtle/#grammar-production-sparqlVersion sparqlVersion ::= "VERSION" VersionSpecifier

    string: ParserMethod<[], CstNode> = ...
    stringLiteral: ParserMethod<[], CstNode> = ...
    subject: ParserMethod<[], CstNode> = ...
    trigDoc: ParserMethod<[], CstNode> = ...
    triples: ParserMethod<[], CstNode> = ...
    triples2: ParserMethod<[], CstNode> = ...
    triplesBlock: ParserMethod<[], CstNode> = ...
    triplesOrGraph: ParserMethod<[], CstNode> = ...
    tripleTerm: ParserMethod<[], CstNode> = ...

    https://www.w3.org/TR/rdf12-turtle/#grammar-production-tripleTerm tripleTerm ::= '<<(' ttSubject verb ttObject ')>>'

    ttObject: ParserMethod<[], CstNode> = ...

    https://www.w3.org/TR/rdf12-turtle/#grammar-production-ttObject ttObject ::= iri | BlankNode | literal | tripleTerm

    ttSubject: ParserMethod<[], CstNode> = ...
    version: ParserMethod<[], CstNode> = ...

    https://www.w3.org/TR/rdf12-turtle/#grammar-production-version version ::= '@version' VersionSpecifier '.'

    versionSpecifier: ParserMethod<[], CstNode> = ...

    https://www.w3.org/TR/rdf12-turtle/#grammar-production-VersionSpecifier VersionSpecifier ::= STRING_LITERAL_QUOTE | STRING_LITERAL_SINGLE_QUOTE

    wrappedGraph: ParserMethod<[], CstNode> = ...

    Accessors

    • get input(): IToken[]

      An array of tokens that were created by the lexer and used as input for the parser. This can be used to inspect the tokens that were processed during parsing, and to identify any issues with the tokenization process.

      Returns IToken[]

    • set input(value: IToken[]): void

      An array of tokens that were created by the lexer and used as input for the parser. This can be used to inspect the tokens that were processed during parsing, and to identify any issues with the tokenization process.

      Parameters

      • value: IToken[]

      Returns void

    Methods

    • Type Parameters

      • IN = any
      • OUT = any

      Returns new (...args: any[]) => ICstVisitor<IN, OUT>

    • Type Parameters

      • IN = any
      • OUT = any

      Returns new (...args: any[]) => ICstVisitor<IN, OUT>

    • Returns Record<string, Rule>

    • Returns ISerializedGast[]

    • Parses a set of tokens created by the lexer into a concrete syntax tree (CST) representing the parsed document.

      Parameters

      • tokens: IToken[]

        A set of tokens created by the lexer.

      • throwOnErrors: boolean = true

        Whether to throw an error if any parsing errors are detected. Defaults to true.

      Returns CstNode

      A concrete syntax tree (CST) object.

    • Parameters

      • prefixToken: IToken
      • iriToken: IToken

      Returns 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