EPUB Accessibility Metadata

This metadata as outlined in the 1.0 Accessibility Specification Conformance and Discoverability can be found in the EPUB Package Document

Schema.org Examples

Schema.org metadata describing an EPUB

Here is an example of embedded Schema.org embedded metadata within the OPF file, which will be used as a reference point for the following examples on EPUB accessibility metadata: the results of the XPath shown are based on this example.

Schema.org metadata describing an audiobook

Here is an example of an Schema.org OPF Metadata for describing an audiobook, which will be used as a reference point for the some of the following examples on EPUB accessibility metadata: the results of the XPath shown are based on this example.

Conventions for implementations

The code conventions used in the provided code snippet follow a structure commonly found in programming languages like Python, Java, or C++. Here's an explanation of the conventions:

Conditionals and Control Flow:
IF, ELSE IF, and ELSE (in bold and capital letters) statements are used to define different conditions and the corresponding actions to be taken.
Operators:
Written operators (is present) are used to check if a particular code or codelist is present (or not) in the metadata record.
Logical operators:
Logical operators (AND, OR, NOT, in bold and capital letters) are used to combine conditions.
String Literals:
String literals are used to represent the text that should be displayed when a particular condition is met.
Variable Naming:
The terms like "property" and "value" are used in a way that suggests a variable or data structure representing the metadata record.
Indentation:
The code uses consistent indentation to define blocks of code within conditional statements. This is crucial for readability and maintaining a clear structure.
Readability:
The code is written in a way that is intended to be easily readable and understandable even by non-coders.

Common Functions

In this section we define the functions common to all techniques, which are called by them during execution.

Pre Processing

Before working directly with the metadata we must read the metadata in the Package document (OPF file) inside the EPUB. This is a common starting point for all techniques that allows us to query the metadata directly.

This algorithm takes the package_document_as_text argument: a UTF-8 string representing the Package document.

To generate the internal representation, run the following steps:

  1. LET package_document_content be textual representation of the Package document for the publication given package_document_as_text.
  2. LET package_document be the DOM tree that results from parsing package_document_content using an XML DOM parser.
  3. Return package_document.

Check for Node

Many of the techniques rely on checking for the presence or absence of metadata in the metadata section of the Package document.

This algorithm takes:

To check for node, run the following steps:

  1. IF package_document contains path: THEN return True.
  2. ELSE return False.

Techniques

Supports nonvisual reading

This technique relates to Supports nonvisual reading key information.

Pre-recorded audio

This technique relates to Pre-recorded audio key information.

Visual adjustments

This technique relates to Visual adjustments key information.

This algorithm takes the package_document_as_text argument: a UTF-8 string representing the Package document.

Variables setup

  1. LET package_document be the result of calling pre processing given package_document_as_text.
  2. LET all_textual_content_can_be_modified be the result of calling check for node on package_document, /package/metadata/meta[@property="schema:accessibilityFeature" and text()="displayTransformability"].
  3. LET real_text be the result of calling check for node on package_document, /package/metadata/meta[@property="schema:accessModeSufficient" and text()="textual"] OR the result of calling check for node on package_document, /package/metadata/meta[@property="schema:accessMode" and text()="textual"].
  4. LET text_within_images be the result of calling check for node on package_document, /package/metadata/meta[@property="schema:accessMode" and text()="textOnVisual"] OR the result of calling check for node on package_document, /package/metadata/meta[@property="schema:accessMode" and text()="mathOnVisual"].
  5. LET images_of_text be the result of calling check for node on package_document, /package/metadata/meta[@property="schema:accessModeSufficient" and text()="visual"] OR the result of calling check for node on package_document, /package/metadata/meta[@property="schema:accessMode" and text()="visual"].

Instructions

  1. IF all_textual_content_can_be_modified: THEN display "Appearance can be modified".
  2. ELSE IF real_text AND NOT all_textual_content_can_be_modified: THEN display "Appearance cannot be modified".
  3. ELSE IF text_within_images OR images_of_text: THEN display "Appearance cannot be modified for all textual content".
  4. ELSE display "Appearance modifiability not known".
Understanding Visual adjustments technique
all_textual_content_can_be_modified

If true it indicates that the accessibilityFeature="displayTransformability" (All textual content can be modified) is present in the OPF file, otherwise if false it means that the metadata is not present.

All textual content can be modified means that the digital publication does not restrict the ability of users to modify and reflow the display of any textual content to the full extent allowed by the reading system (i.e. to change the text size or typeface, line height and word spacing, colors).

real_text

If true it indicates that the accessModeSufficient="textual" OR accessMode="textual" (Text) is present in the OPF file, otherwise if false it means that the metadata is not present.

Text means that digital publication contains "real" text (user-selectable) as its main content (or as secondary content).

text_within_images

If true it indicates that the accessMode="textOnVisual" OR accessMode="mathOnVisual" (Text within images) is present in the OPF file, otherwise if false it means that the metadata is not present.

Text within images means that digital publication contains text within images (i.e. text in diagrams, charts or balloons on which the user will not be able to change the display settings) as its main content (or as secondary content).

images_of_text

If true it indicates that the accessModeSufficient = "visual" OR accessMode="visual" (Images of text) is present in the OPF file, otherwise if false it means that the metadata is not present.

Images of text means that digital publication contains images of text (i.e. pictures of text on which the user will not be able to change the display settings) as its main content (or as secondary content).

Charts, diagrams, and formulas

This technique relates to Charts, diagrams, and formulas key information.

Hazards

This technique relates to Hazards key information.

Conformance

This technique relates to Conformance key information.

Accessibility summary

This technique relates to Accessibility summary key information.

Additional accessibility information

This technique relates to Additional accessibility information key information.

Acknowledgements

Contributors

Reviewers

Intellectual Property Rights