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

    Function createLexicon

    • Creates an immutable Lexicon.

      Validates prefix declarations at creation, so that a malformed one fails immediately rather than producing invalid prefixed names when IRIs are later compacted or expanded against the resulting lexicon.

      A prefix is an ASCII letter followed by ASCII letters, digits, _ or -, as admitted by the SPARQL and Turtle grammars. The empty prefix is also accepted, and declares the default namespace of the lexicon.

      Parameters

      • lexicon: {
            readonly [prefix: string]:
                | string
                | { "": string; readonly [term: string]: string };
        }

        The namespaces to declare, keyed by prefix, as absolute IRIs or Namespace objects

      Returns Lexicon

      An immutable lexicon with the same prefixes, and IRI namespaces converted to Namespace objects

      TypeError If a prefix is malformed

      RangeError If a namespace IRI is not absolute