Colibrio Reader Framework API - Cloud license
    Preparing search index...

    Locator instances are used for referencing specific locations (including ranges) in publications.

    The Locator type is modeled after and compatible with the "External Web Resource" and "Specific Resource" types defined by the Web Annotations specification: https://www.w3.org/TR/annotation-model

    Locator can be serialized into various formats such as:

    • IWebAnnotationResourceData - modeling the Web annotation "External Web Resource" type.
    • IWebAnnotationSpecificResourceData - modeling the Web annotation "Specific Resource" type.
    • URL - (non-fragment selectors are serialized according to the Selectors and States Note: https://www.w3.org/TR/selectors-states/

    Legacy Colibrio IAnnotationTarget objects are not valid with the "External Web Resource" or "Specific Resource" types due to using "id" instead of "source" while also specifying a "selector". For backwards compatibility, these object can still be parsed into Locators.

    NOTE: JSON-LD processing is NOT supported. Ensure that the data used to instantiate Locators follows the recommended serialization format specified in https://www.w3.org/TR/annotation-vocab/#json-ld-context

    core.locator

    Implements

    Constructors

    • Creates a new Locator instance. No validation is performed on the supplied arguments. NOTE: Clients should use the LocatorFactory.parse() to create Locators from URLs or JSON data.

      Parameters

      • _sourceUrl: string

        The URL to the target resource without the hash fragment part if any.

      • _selectors: ISelector[]

        The selectors for this Locator.

      Returns Locator

    Methods

    • Get the Selectors for this Locator. Multiple Selectors should select the same content, however some Selectors will not have the same precision as others. The first selector in the array has the highest precision.

      Returns ISelector[]

    • Returns the URL to the Locator without the hash fragment part if any. This can be a http URL, an isbn identifier (isbn:4636...) or any other URL, URI, IRI, URN identifier

      Returns string

    • Get this Locator as an URL string.

      Parameters

      • OptionalsourceUrl: string

      Returns string

    • Get this Locator as an URL.

      Parameters

      • OptionalsourceUrl: string

      Returns URL