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 the URL of 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 this locator as a JSON serializable object. Use LocatorFactory.parse() to deserialize this data back to a Locator.
Method used to convert a locator to a ILegacyAnnotationTarget
that is compatible with older versions of the Colibrio framework.
Note that the format
and type
fields will not be set, so if you need them, you have to set them manually.
Get this Locator as an URL string.
Get this Locator as an URL.
Returns this Locator as an External Web Resource as described by the Web Annotation Data Model. See IWebAnnotationResourceData for more information.
Returns this Locator as a Specific Resource described by the Web Annotation Data Model. See IWebAnnotationSpecificResourceData for more information.
Generated using TypeDoc
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:
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