Metreeca Keep
    Preparing search index...

    Reads the identifier carried by entry, optionally mapping it to a result value.

    • Reads the identifier of entry from the entry named by shape's kind: "id" property.

      Lets the triple encoders derive a resource's identifier from its shape instead of receiving it threaded through as a separate argument.

      Parameters

      • entry: Resource

        The resource state to read the identifier from

      • shape: Lazy<ResourceShape>

        The resource shape whose kind: "id" property names the identifier entry

      Returns string

      The absolute IRI identifier carried by entry

      Error When shape declares no id entry, or entry carries no identifier under that entry

    • Reads the identifier of entry and maps it through mapper.

      Type Parameters

      • V

        The type the identifier is mapped to

      Parameters

      • entry: Resource

        The resource state to read the identifier from

      • shape: Lazy<ResourceShape>

        The resource shape whose kind: "id" property names the identifier entry

      • mapper: (id: string) => V

        Maps the absolute IRI identifier to the result value

      Returns V

      The result of applying mapper to the identifier carried by entry

      Error When shape declares no id entry, or entry carries no identifier under that entry