@metreeca/core - v0.13.0
    Preparing search index...

    Type Alias Lexicon

    Lexicon: {
        readonly [prefix: string]: { "": IRI; readonly [term: string]: string };
    }

    Namespace prefixes for writing IRIs as compact URIs.

    Maps each prefix to the Namespace it abbreviates. The empty prefix declares the default namespace, whose IRIs are compacted to and expanded from prefixed names such as :name, with nothing before the colon.

    Local names are restricted to an ASCII letter or _, followed by ASCII letters, digits, _ or -. This is a subset of the SPARQL and Turtle prefixed name grammars and of the compact URI syntax, so every prefixed name produced can be pasted verbatim into SPARQL or Turtle text, with no escaping of reserved characters.

    Lexicons must be created with createLexicon, which validates their prefixes: a malformed prefix then fails where the lexicon is declared, rather than later, when IRIs are compacted or expanded against it.

    Type Declaration

    • readonly [prefix: string]: { "": IRI; readonly [term: string]: string }
    • createLexicon for creating validated lexicons
    • compact for compacting IRIs to prefixed names
    • expand for expanding prefixed names to IRIs