Tags

From openZIM
Jump to navigation Jump to search

Tags are text slugs stored in the Tags Article of the "M" namespace of a ZIM file.

A ZIM file can have zero, one or many Tags. Should there be more than one, those are separated by the ; character.

Goal

Tags are used by publishers to classify ZIM files.

Setting Tags

Tags should help represent, classify or identify a ZIM. ZIM readers are responsible for making use of Tags or not.

Tags are commonly displayed to reader users at ZIM-selection stage and not when using a ZIM file.

Tags are free text and can thus contain any UTF-8 character except for the ; separator. It is common to restrict Tags to single or two-words combination. Concision is important for users to remember and identify content.

Private Tags

Any Tag starting with the _ (underscore) character is considered a private tag. Private tagging is a convention and nor par of the specification.

Private tags are usually hidden by readers and used as flexible metadata.

Common private tags used by kiwix Publishers:

  • _sw:<no|yes>: indicates wheter the ZIM file relies on Service Workers.
  • _ftindex:<no|yes>: indicates wheter the ZIM file includes a full-text index.
  • _pictures:<no|yes>: indicates whether the ZIM file includes pictures.
  • _videos:<no|yes>: indicates whether the ZIM file includes videos.
  • _details:<no|yes>: indicates whether the ZIM file includes detailed content.
  • _category:<xxx>: indicates how the ZIM file is categorized. See details below

_category

Categories of the ZIM content, as defined by the openZIM content classification system.

  • Value: the category identifier without its https:// scheme, e.g. _category:id.openzim.org/categories/health-medicine. The canonical identifier is obtained by prepending https://; it resolves to the category description (HTML, Turtle or JSON-LD through content negotiation), including translated labels.
  • The list of categories is available at id.openzim.org/categories.
  • A ZIM should have one category; two are tolerated when needed; three or more are discouraged and must be clearly justified. When a ZIM has several categories, the tag is repeated, e.g. _category:id.openzim.org/categories/science-mathematics;_category:id.openzim.org/categories/courses-textbooks.
  • All ZIMs of a same family (same name except the language code, e.g. wikipedia_en_chemistry and wikipedia_fr_chemistry) should have the same categories.

Nota: We are just starting the project implementation in October 2026, so expect to have ZIMs and readers with legacy values below.

Legacy values

Before the content classification system, _category held the content source (e.g. _category:wikipedia,_category:stack_exchange, _category:gutenberg). This information belongs to the Source metadata.

  • Any _category value not starting with id.openzim.org/categories/ is a legacy value and must not be interpreted as a category.
  • Transition: current readers only consider the first _category tag. Until they are updated, ZIMs should keep their legacy value first, followed by their categories, e.g. _category:wikipeditegories/encyclopedias-general-reference.
  • Readers display ZIMs without any category under the Other category (id.openzim.org/categories/other).