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

    Function expand

    • Expands a compact URI to an IRI.

      Turns prefixed names such as rdfs:label into the IRIs they abbreviate, so that IRIs written in compact form can be used as identifiers. A name is expanded only if its prefix is declared and its local name is valid. Any other value is returned unchanged, including names with an undeclared prefix and full IRIs such as https://example.org/Book.

      Important

      Values returned unchanged must be validated at runtime with isIRI where an IRI is required.

      Parameters

      • lexicon: Lexicon

        The lexicon to expand against

      • name: string

        The prefixed name or IRI to expand

      Returns string

      The IRI abbreviated by name, or name itself if its prefix is undeclared or its local name is invalid

      compact for the reverse conversion