Copyright © 2026 World Wide Web Consortium. W3C® liability, trademark and permissive document license rules apply.
This document defines a profile of the Web Annotation Data Model [annotation-model] by specifying a subset of the terms, and adding terms deemed useful to satisfy the entries in the EPUB Annotations Use Cases and Requirements [epub-anno-ucr] document.
This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the W3C standards and drafts index.
This document was published by the Publishing Maintenance Working Group as a Working Draft using the Recommendation track.
Publication as a Working Draft does not imply endorsement by W3C and its Members.
This is a draft document and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to cite this document as other than a work in progress.
This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent that the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
This document is governed by the 18 August 2025 W3C Process Document.
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.
The key words MAY, MUST, MUST NOT, RECOMMENDED, and SHOULD in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
This section is non-normative.
This section defines a profile of the Web Annotation Data Model [annotation-model], as used for EPUB Annotations.
In the Web Annotation model, the core structure is the Annotation object, which contains properties defining the annotation's Body and Target. EPUB Annotations reuse the same model with some restrictions specified in this document. Subsequent sections provide more formal definitions for the terms used by this specification.
This document does not define how annotations are created, stored, or synchronized in a reading system.
To be consistent with EPUB 3.4, this specification refers to the [url] standard for terminology and processing related to URLs expressed in EPUB publications and in Annotations Objects. The additional constraints expressed in EPUB 3.4 also apply. Note that this is a difference with the Web Annotation Data Model which uses the term IRI [rfc3987]. This difference does not alter the structure of the Data Model used by this specification.
The Annotation object retains the following annotation properties from the Web Annotation object [annotation-model]:
| Name | Description | Format | Required? |
|---|---|---|---|
id
|
The identity of the annotation. A uuid formatted as a URN is RECOMMENDED. | URI | Yes |
type
|
The RDF structure type. It MUST be "Annotation". | string | Yes |
motivation
|
The motivation for the annotation's creation. | "bookmarking" | "highlighting" | No |
created
|
The time when the annotation was created. | ISO 8601 datetime | Yes |
modified
|
The time the annotation was modified after creation. | ISO 8601 datetime | No |
creator
|
The creator of the annotation. This may be a human, an
organization or a software agent. |
Creator object | No |
target
|
The target content of the annotation. | Target object | Yes |
body
|
The annotation body. | Body object | No |
The [annotation-model] specification is fairly open ended as for the value of, for
example, the body property. This specification restricts the value by defining specific classes that
must be used, see the definitions for
Creator, Target, and Body below.
The type of annotation should be considered when determining the value of the
motivation property.
An annotation is a highlight if its motivation is set to "highlighting". In this case, its Selector should reference a range of characters, a region of an image or a time period.
An annotation is a bookmark if its motivation is set to "bookmarking".
In this case, its Selector should reference a single point in the publication, not a range.
If the Selector references a range, only the start of the range is used as a placeholder for the bookmark.
An annotation that does not include an explicit motivation is considered a bookmark.
Both highlights and bookmarks can have a Body, which is usually called a note or comment.
We should specify whether a property may appear at most once (body, target) because that is also part of the profile definition. This can be a separate column ("cardinality") or be added to the description. This remark may be valid for all the tables in the document.
No response
In the section titled "Subset of the Web Annotation Data Model" we say:
The Target of an EPUB Annotation is the content being annotated, which is a specific segment in a document within the EPUB package defined by its relative Source URL and a Selector.
However, we do not require the target to be a specific segment in a document, unless we are including the entire document with no range specified as a "segment in" that document. I am actually not sure why we need to define target here at all? There are a lot of nuances (for instance, I am not sure from this definition if selector is required), and this is just a list of changes from web annotations, which is really only interesting to people that know what is in web annotations, and hence are likely aware of how target is used.
I propose deleting the second sentence of this bullet point.
The Creator object of an annotation is a person, an organization or a software agent.
This document defines the following creator properties:
| Name | Description | Format | Required? |
|---|---|---|---|
id
|
The identity of the creator. | URL | Yes |
type
|
Type of the creator. It MUST be "Person", "Organization" or "Software". | string | Yes |
name
|
The name of the creator. | Localizable text | No |
The Target object of an annotation associates the annotation with a specific segment of a resource in the current publication.
This document defines three target sub-properties:
| Name | Description | Format | Required? |
|---|---|---|---|
source
|
The identity of the target EPUB resource. | URL | Yes |
selector
|
The segment of the target EPUB resource that is annotated. | Array of Selector objects | No |
A Target with no Selector indicates that the annotation applies to the entire target resource.
A future version of the specification may add a way to reference another annotation by its unique identifier. This would allow annotations to target other annotations, enabling more complex annotation structures. In that case, we might introduce new [=Motivation] properties to indicate the relationship between annotations.
The target resource MUST be identified by the relative URL of an existing EPUB top-level content document, as defined in [epub-34].
An annotation refers to a segment of a resource, which is identified by one or more Selectors. The nature of the Selectors and methods to describe segments depend on the resource type. Providing more than one Selector allows an annotation software to choose the most accurate selector from those it can handle and helps to accommodate evolutions on the annotated resource.
Several annotation selectors are specified in the Web Annotation Data Model. This specification retains selectors (with possible restrictions) deemed useful for annotating EPUB publications, and details on how to use these selectors.
The Fragment Selector object uses the fragment part of an URL defined by the representation's media type. This object is identical in structure to the Fragment Selector defined by Web Annotation Data Model, except that it restricts the media types it may use.
| Name | Description | Format | Required? |
|---|---|---|---|
type
|
The RDF structure type. It MUST be "FragmentSelector". | string | Yes |
|
The contents of the fragment component of an URL that describes the selection.
The selector MUST have exactly 1 value property. |
string | Yes |
conformsTo
|
Provides the reference to the specification that defines the syntax of the URL
fragment in the
value property. The selector SHOULD have exactly 1 conformsTo link
to
the specification that defines the syntax of the fragment and MUST NOT have more
than 1.
|
One of the URL strings listed in the table below. | No |
The following URLs are the specifications that define the semantics of fragments, and hence
may be used with the
property. Other URLs MUST NOT be used.
conformsTo
| Name | Fragment Specification | Description |
|---|---|---|
| HTML | http://tools.ietf.org/rfc/rfc3236 | [rfc3236]. Example: namedSection |
| Media | http://www.w3.org/TR/media-frags/ | [media-frags]. Example: xywh=50,50,640,480 or
t=10,20
|
| SVG | http://www.w3.org/TR/SVG/ | [svg11]. Example: svgView(viewBox(50,50,640,480)) |
| Text fragment | https://wicg.github.io/scroll-to-text-fragment/ | [scroll-to-text-fragment]. Example:
:~:text=an%20example,text%20fragment
|
This selector, used with text fragments, must be used with great care when the number of characters that can be copied from the publication is constrained by the publisher.
The integration of text fragments into the specification is AT RISK. The reason is two-fold:
This section is non-normative.
One of the most common ways to select elements in the HTML Document Object Model is to use CSS Selectors [CSS3-selectors].
This specification reuses the CssSelector, as defined in
the Web Annotation Data Model specification, but lists it here for an easier readability.
| Name | Description | Format | Required? |
|---|---|---|---|
type
|
The RDF structure type. It must be "CssSelector". | string | Yes |
value
|
The CSS selection path to the target.
The selector must have exactly 1 value property. |
string | Yes |
This section is non-normative.
This Selector describes a range of text by recording the start and end positions of the selection in the stream. Position 0 would be immediately before the first character, position 1 would be immediately before the second character, and so on.
This specification reuses the TextPositionSelector,
as defined in the Web Annotation Data Model specification, but lists it here for an easier
readability.
| Name | Description | Format | Required? |
|---|---|---|---|
type
|
The RDF structure type. It must be TextPositionSelector. |
string | Yes |
start
|
The starting position of the segment of text. The first character in the full
text is character position 0, and the character is included within the segment.
Each TextPositionSelector must have exactly 1 start
property, and the value must be a non-negative integer.
|
non-negative integer | Yes |
end
|
The end position of the segment of text. The character is not included within
the segment.
Each TextPositionSelector must have exactly 1 end
property, and the value must be a non-negative integer.
|
non-negative integer | Yes |
When a Text Position Selector is used on an HTML resource, it operates on a plain text serialization of the content using the Document Object Model textContent algorithm.
Character 0: Refers to the position immediately before the first character of the textContent of the scope. If the selector is a refinement, the scope is the element identified by the parent Selector; otherwise, the scope is the HTML <body> element.
Cross-Boundary Selection: When a selection spans multiple HTML elements, the parent Selector must identify a common ancestor of all involved nodes. The character stream is the concatenation of all text nodes within that ancestor, in tree order.
Robustness: To ensure persistence against DOM changes, the TextPositionSelector should be accompanied by a selector resistant to content modification and using the same serialization algorithm, e.g. the Text Fragment Selector. In cases of conflict (e.g., if the text has been modified), the latter should be used to re-calculate the correct offsets within the scope.
It may be more efficient or simpler to specify the segment of interest of a resource as a selection inside a selection, rather than as a selection of the complete resource. This is accomplished by having selectors chained together, where each refines the results of the previous one.
The Web Annotation Data Model specification defines the refinedBy
property. This specification restricts the possible values of the property to include only
those selectors that are specified by, or listed in this specification.
| Name | Description | Format | Required? |
|---|---|---|---|
| refinedBy | The relationship between a broader selector and the more specific selector that SHOULD be applied to the results of the first. A Selector MAY be refined by 1 or more other Selectors. If more than 1 is given, then they are considered to be alternatives that will result in the same selection. | "FragmentSelector" | "CssSelector" | "TextPositionSelector" |
No |
This selects "q" from "quick" as start position and "x" from "fox" as end position in the following HTML snippet:
<div id="intro">
<p>Some text.</p>
<p>The quick <em>brown</em> fox jumps over the lazy dog.</p>
<p>The lazy <em>white</em> dog sleeps with the crazy fox.</p>
</div>
The Body object of an annotation contains either plain text and style information, or a reference to an external audiovisual resource. It can also include optional tags.
This document specifies the following sub-properties of annotations:
| Name | Description | Format | Required? |
|---|---|---|---|
type
|
The body type. | "TextualBody" | "Image" | "Audio" | "Video" | Yes |
format
|
The media-type of the note. Only plain text is allowed for textual notes. Audiovisual notes can be of any media type supported by EPUB, see EPUB Media Types . | string | No |
value
|
The content of a textual note. | Localizable text | Yes, if type is "TextualBody". Not applicable for audiovisual notes. |
id
|
The relative URL of the audiovisual note. | URL | Yes, if type is "Image", "Audio", or "Video". Not applicable for textual notes. |
color
|
The color of the annotation; yellow by default. | "pink" | "orange" | "yellow" | "green" | "blue" | "purple" | No |
highlight
|
The style of the annotation; solid background by default. | "solid" | "underline" | "strikethrough" | "outline" | No |
tags
|
Free text categorizing the annotation. | Array of string | No |
The terms used for color and highlight (e.g., "pink", "orange",
"solid", etc.) are only labels.
They are not meant to denote precise values (e.g., #ffc0cb for "pink").
Instead, they represent the terms usually used by Reading Systems.
The terms are mapped onto real values depending on factors like user
preference (e.g. color themes) or device characteristics (e.g. display type).
The format for a "TextualBody" is restricted to plain text. Markdown was also considered, but current practice among Reading Systems is to use text without any formatting in annotations. Consequently, defining Markdown as an alternative in the exchange format would have very little chance of being implemented. A further issue is the great variety of Markdown-based formats, without any one being stable enough to be referenced normatively. Future versions of this specification may reconsider this.
Read “Best practices for Reading Systems” about using tags in an annotation.
An Annotation Set is an unordered collection of annotations.
An Annotation does not contain information about its associated publication. If a set of annotations is shared as a detached file, it is mandatory to also export information that will help find the associated publication, even if the publication is not adequately identified.
The AnnotationCollection defined
in the Web Annotation Data Model does not provide an adequate
structure for sharing annotations either as a detached file or in an EPUB package.
The AnnotationCollection provides a
way to retrieve annotations via a REST API and is, therefore, intrinsically paginated.
The AnnotationSet contains:
| Name | Description | Format | Required? |
|---|---|---|---|
id
|
The identity of the annotation set. A uuid formatted as a URN is RECOMMENDED. | URL | Yes |
type
|
It MUST be AnnotationSet. |
string | Yes |
generated
|
The time when the set was generated. | ISO 8601 datetime | No |
about
|
Information relative to the publication. | About |
Yes |
items
|
The set of annotations. | Array of Annotation objects | Yes |
The About object contains information relative to the publication. The following table lists recommended metadata fields, directly extracted from the metadata of the publication. They are intended to help associate an annotation set with a publication:
| Name | Description | Format | Required? |
|---|---|---|---|
dc:title
|
The title of the publication. | Localizable text | No |
dc:publisher
|
The publisher of the publication. | Localizable text | No |
dc:creator
|
The author(s) of the publication. | array of Localizable texts | No |
dc:date
|
The publication date of the EPUB publication. | string (a W3C Date and Time Format is recommended but not required) | No |
All properties are from the Dublin Core Vocabulary [dcterms], also referenced
in the Web Annotation Data Model as well as in the EPUB package
document metadata.
Implementers are free to add other properties from the Dublin Core Vocabulary, or to use properties from
other vocabularies, as long as they are properly declared in the context file.
The metadata of the publication may differ from the EPUB package document metadata. This happens when the publication metadata is manually updated by the user of the reading system, or when the reading system fetches metadata from an external source.
Following the Web Annotation Data Model [annotation-model] specification, EPUB Annotations are
expressed as JSON-LD [json-ld11] (a variant of JSON [ecma-404] for linked data).
The model is informally defined through a JSON Schema [json-schema]; see 8. JSON Schema
for further details.
The media type of this model is
application/ld+json;profile="http://www.w3.org/ns/anno.jsonld"
The data model is inherently extensible: implementations may add reading system dependent terms, e.g., a reference to user color profiles.
Implementations that do not rely on the linked data aspects of annotations may rely on bespoke processing based on the shape of the annotation or the annotation set. Such implementations may safely ignore the context declarations and are not required to dereference the respective URLs.
This section is non-normative.
While this specification primarily defines an interchange format for EPUB annotations, this section outlines the expected behaviors, capabilities, or affordances of Reading Systems to ensure a consistent user experience and data interoperability across different environments.
To provide a useful user interface for managing annotations, Reading Systems are expected to:
motivation (e.g., distinguishing between a highlight and a bookmark), creator, color, highlight, and user-defined tags.color) to help users manage large sets of annotations.Because a publication may be modified or updated over time, the generation and robust processing of selectors are key to ensuring annotations remain attached to their correct positions.
When generating annotations, Reading Systems are expected to:
When processing annotations, Reading Systems are expected to:
FragmentSelector or CssSelector before falling back to broader text or range selectors).CssSelector, which is universally usable for both text and multimedia annotations.The expectations for matching an annotation set to its target vary depending on how the data is delivered:
To support this import workflow, Reading Systems are expected to:
id of each Annotation to detect collisions once the publication context is verified. If an incoming annotation shares an id with an existing one, the system is expected to either update the existing entry or prompt the user for resolution, rather than creating a duplicate.The AnnotationSet structure does not exist natively inside a reading system; it is a serialization artifact used during the export process. When generating this structure for export, Reading Systems are expected to:
color) rather than forcing the serialization of all internal annotation data.The Web Annotation Data Model allows for rich media types that not all reading environments can parse. Reading Systems are expected to:
There may be cases where annotations are associated with foreign top-level content documents that the current reading environment cannot render. This is for instance the case if the annotation points to a section of image used as top-level content document, this image has a textual or svg fallback, and the reading system only supports textual or svg content as top-level content documents.
If a reading system encounters such a case, it is recommended to associate the annotation with the selected fallback representation, by mapping the annotation Selector to a representation supported by this content document. It is not recommended to store this mapped selector permanently.
No response
From a comment by @iherman on issue #3070:
Just be on the safe side I want to clarify something. If I take Example 48 then images/infographic.svg may also be target of an annotation, because it is also a top-level content document per #3070 (comment). Which is o.k. from a definition point of view. But I wonder whether it is realistic in practice. Let us say RS A displays the fallback svg file instead of the jpg file and the reader puts an annotation with that file as a target. The annotation is then transferred to RS B that does not really implement fallbacks, displays the jpg file instead. What is the fate of that annotation? Is it ignored? Is it "transformed" into an annotation on the jpg file?
Maybe something should be added to the RS consideration section on this, e.g., that RS A should give a warning on this.
No response
To ensure visual consistency across different reading environments, Reading Systems are expected to:
color value outside of the standard enumerated profile (or one unsupported by the application's current theme), map it to a neutral fallback color (such as grey).color key.T.B.D.
This section is non-normative.
The EPUB Annotation model inherits the string
internationalization features defined by JSON-LD 1.1.
These may be used for values that are defined as
localizable texts.
To set the right language metadata, the value is a separate
object with the string value set explicitly through the stringValue property.
The language and direction properties can be used to set the
language tag
and the string direction, respectively.
The value for language is a string representing a [BCP47] language tag.
The value for direction is a string whose value must be either "ltr" or "rtl".
In the example below, two annotations within the same AnnotationSet use different languages. In the second annotation the string direction is also set to ensure the correct rendering of the text with mixed Latin and Hebrew characters.
The default values for language and direction may be set as part of the context
declaration of the Annotation Set. The value of the top-level @context must be
extended with an extra context object (using the JSON array notation) containing the default setting using the the @language and @direction keywords. See the example below as an alternative for the previous example.
The extra object in the context can be used whenever a context is set. For example, it is possible to set the default value for a single annotation.
T.B.D.
The EPUB Annotations specification provides a standardized data model for importing, exporting,
and displaying annotations. Because annotations can originate from untrusted external sources—such as
downloaded detached files (AnnotationSet) or crowd-sourced annotation servers—implementations
must treat all incoming annotation data as potentially malicious.
Implementers should design reading systems and processing tools defensively to mitigate the risks of injection attacks, malicious resource loading, and denial-of-service, aligning with the guidelines in the W3C Self-Review Questionnaire: Security and Privacy.
This specification restricts textual annotation bodies to plain text. Consequently, reading systems MUST NOT
parse, interpret, or render HTML, XML, or script markup contained within an annotation's body.
<script> or <iframe>) strictly as
raw text strings. When displaying annotation content within a web-based context or DOM element,
reading systems must safely escape text or use plain-text insertion methods
(e.g., textContent in JavaScript) to ensure that embedded code cannot execute.
https:) to prevent execution of malicious schemes
such as javascript: or file:.
Annotations can reference external Web resources (e.g., in the target property or when
referencing external media for audiovisual notes).
https:) and blocking dangerous schemes (e.g., javascript:, file:, or OS-specific application handlers).
The [=Target] object utilizes a source property, which must be the URL of an existing resource within the EPUB package (e.g., an HTML document).
source URL against the EPUB package, reading systems must prevent path traversal attacks. Implementations must ensure that malicious paths (e.g., ../../../../etc/passwd or ../outside-container.html) cannot be used to escape the bounds of the EPUB container or access local system files.
Processing deeply nested annotation data or calculating complex selectors can be weaponized to consume excessive CPU or memory, leading to a Denial of Service.
Selector object (particularly CSS Selectors and Text Position Selectors) requires the reading system to traverse the Document Object Model (DOM) to locate specific segments. Attackers may craft overly complex CSS selectors or extreme text coordinate ranges designed to hang the rendering engine. Implementations should enforce execution time limits and depth limits when applying selectors.
When annotations are imported from a detached AnnotationSet, reading systems have no inherent guarantee of the data's authenticity.
Creator object can be easily forged. An attacker could craft an annotation file that appears to come from a trusted source (such as a teacher, publisher, or known peer) but contains misleading or offensive notes.
Creator metadata in detached files as unverified unless the annotation set is transmitted over a secure, authenticated channel (like an authenticated API) or is cryptographically signed. Reading systems should visually distinguish between locally authored annotations and untrusted imported annotations.
about
§4.body
§3.1color
§3.4conformsTo
§3.3.2.1created
§3.1creator
§3.1highlight
§3.4items
§4.modified
§3.1motivation
§3.1selector
§3.3source
§3.3tags
§3.4target
§3.1Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in: