Library Book Format

JSON schema for books in data-library — split-chapter layout, paragraph refIds, and i18n slots.

≈ 12 min read 2274 words Updated 2026-11-28

On this page

The library uses a split-chapter JSON format for paragraph-level content and deep linking.

Directory structure#

data-library/
├── catalog.json
└── the-book-which-tells-the-truth/
    ├── _meta.json           # book metadata
    ├── chapter-1.json       # chapter content
    ├── chapter-2.json
    ├── chapter-3.json
    ├── chapter-4.json
    ├── chapter-5.json
    ├── chapter-6.json
    └── chapter-7.json

Book metadata (_meta.json)#

{
  "slug": "the-book-which-tells-the-truth",
  "code": "TBWTT",
  "refId": "TBWTT",
  "titles": {
    "fr": "Le Livre Qui Dit la Vérité",
    "en": "The Book Which Tells the Truth",
    "de": "Das Buch, das die Wahrheit verkündet"
  },
  "publicationYear": 1973,
  "primaryLang": "fr",
  "schema": ["book", "chapters", "paragraphs"],
  "revision": 1,
  "updated": "2026-01-24T08:57:31Z",
  "chapterCount": 7,
  "paragraphCount": 1029,
  "portraits": [
    { "id": "rael", "role": "recipient / narrator" },
    { "id": "yahweh", "role": "principal speaker" }
  ],
  "chapterFiles": [
    { "n": 1, "file": "chapter-1.json", "title": "La Rencontre", "paragraphs": 62 },
    { "n": 2, "file": "chapter-2.json", "title": "La Vérité", "paragraphs": 113 }
  ]
}

Portrait metadata#

Books may declare a top-level portraits array when named people or figures should be surfaced in the website sidebar. Each item references an id from www.wheelofheaven.world/data/personality_portraits.json and adds the book-specific role label.

{
  "portraits": [
    { "id": "rael", "role": "recipient / narrator" },
    { "id": "yahweh", "role": "principal speaker" },
    { "id": "elohim", "role": "civilization described" }
  ]
}

Known paragraph-level speaker values are also matched against the same registry, so Raelian books can show a compact speaker avatar beside verses spoken by figures such as Yahweh or Rael.

Version provenance metadata#

Books may include a structured version object in _meta.json. This describes the edition or translation being displayed, separately from the work title. The public API exposes this object, and the website renders a sidebar provenance panel when it is present.

{
  "versionTitles": {
    "en": "Wheel of Heaven Translation"
  },
  "shortVersionTitles": {
    "en": "WoH, 2026"
  },
  "version": {
    "schemaVersion": 1,
    "title": "Wheel of Heaven Translation",
    "shortTitle": "WoH, 2026",
    "type": "curated-translation",
    "language": "en",
    "sourceLanguage": "arc",
    "refSystem": "chapter-verse",
    "scope": "1 Enoch 1-36 and 72-82",
    "license": {
      "status": "project-cc0",
      "spdx": "CC0-1.0",
      "url": "https://creativecommons.org/publicdomain/zero/1.0/"
    },
    "provenance": {
      "sourceRecordId": "book-of-enoch",
      "baseText": "Layered Aramaic, Greek, and Ge'ez witness reconstruction",
      "method": "Best-effort reconstruction with per-verse layered witness attribution.",
      "citation": "See sourceCitation for bibliography.",
      "witnesses": [
        {
          "role": "primary",
          "language": "arc",
          "label": "Aramaic Dead Sea Scrolls fragments"
        },
        {
          "role": "secondary",
          "language": "grc",
          "label": "Greek Akhmim Panopolitanus witness where extant"
        }
      ]
    },
    "responsibility": {
      "translator": "Wheel of Heaven",
      "reviewer": "zarazinsfuss"
    }
  },
  "sourceCitation": "Milik, J. T., The Books of Enoch..."
}
FieldTypeDescription
version.schemaVersionnumberVersion-provenance schema revision. Current value is 1.
version.titlestringHuman-readable edition or translation title.
version.shortTitlestringCompact label for chips and dense UI.
version.typestringEdition class, such as translation or curated-translation.
version.languagestringBCP-47 language code for the rendered version.
version.sourceLanguagestringBCP-47 language code for the source language or primary source witness.
version.refSystemstringReference system used by the record, such as chapter-verse.
version.scopestringCoverage statement for partial or staged editions.
version.licenseobjectLicense metadata. Prefer SPDX identifiers when available.
version.provenance.sourceRecordIdstringLibrary slug for the source or base record when one exists.
version.provenance.sourceUrlstringExternal source URL when there is no internal source record, or when the record needs an upstream issue/source link.
version.provenance.baseTextstringSource text, critical edition, or witness stack used as the base.
version.provenance.methodstringConcise statement of how the version was produced.
version.provenance.citationstringShort citation note. Long bibliography belongs in top-level sourceCitation.
version.provenance.witnessesarrayOrdered witness list for layered reconstructions.
version.responsibilityobjectTranslator, editor, reviewer, or other responsibility labels.

Licensing metadata#

The library’s default dedication is CC0-1.0 — every Wheel of Heaven text is public-domain unless a book declares otherwise. Books may add an optional top-level licensing object to _meta.json to state their rights explicitly and, when the underlying source text is not CC0, to disclose the source licence and the reason the WoH text inherits it.

The website renders a Licensing section in the book sidebar for every book. When no licensing object is present the output licence resolves to version.license → flat versionLicense → CC0-1.0, so the panel never goes silent. The source row and the “About this licence” note appear only when declared.

{
  "licensing": {
    "output": {
      "spdx": "CC-BY-NC-SA-4.0",
      "label": "CC BY-NC-SA 4.0",
      "url": "https://creativecommons.org/licenses/by-nc-sa/4.0/"
    },
    "source": {
      "spdx": "CC-BY-NC-SA-4.0",
      "label": "CC BY-NC-SA 4.0",
      "url": "https://creativecommons.org/licenses/by-nc-sa/4.0/",
      "attribution": "electronic Babylonian Library (eBL), LMU München"
    },
    "model": "share-alike-inherited",
    "note": "The Akkadian source transliteration is published by the electronic Babylonian Library under CC BY-NC-SA 4.0. Wheel of Heaven's use is non-commercial; under the source's ShareAlike term this translation inherits the same licence — a documented exception to the library's CC0 dedication. Attribution and non-commercial / share-alike terms pass to downstream reusers."
  }
}
FieldTypeDescription
licensing.outputobjectLicence of the WoH text itself (spdx, optional label, optional url). Defaults to CC0-1.0 when the whole block is absent.
licensing.sourceobjectLicence of the underlying source text, when it differs from CC0. Adds attribution (who to credit). Renders a “Source text” row.
licensing.modelstringMachine-readable tag for the licensing situation, e.g. cc0-default, public-domain-source, share-alike-inherited.
licensing.notestringHuman-readable explanation, shown in an “About this licence” disclosure. Use for any non-CC0 exception so the reasoning is transparent to readers.

When to add it. Most books need nothing — CC0 is the default and renders automatically. Add a licensing block only when a book’s source text carries terms the WoH text must inherit (the first such case is the Atrahasis translation, whose eBL source transliteration is CC-BY-NC-SA). Be explicit and open: the note exists so a reader can see exactly why a text departs from the library’s public-domain norm.

Schema ladder (per-corpus structure)#

_meta.json.schema declares the structural ladder of the book — the names of the levels above the paragraph/verse leaf — and schemaLabels maps each level to display strings per language.

The biblical default is ["book", "chapters", "verses"]; other corpora use different ladders to honour their native structure:

CorpusLadderExample book
Biblical / Christian / LDS / Apocrypha["book", "chapters", "verses"]obadiah, book-of-abraham
Akkadian epic["composition", "tablets", "lines"]gilgamesh-woh (Tablet XI)
Sumerian composition["composition", "lines"] (or ["composition", "segments", "lines"] for damaged compositions)song-of-the-hoe-woh, flood-story-woh
Ugaritic["composition", "tablets", "lines"]baal-cycle-woh
Hittite myth["composition", "tablets", "lines"] with CTH number in metadata(planned)
Avestan["book", "fargards", "verses"] for Vendidad; ["book", "yasna", "stanzas"] for Yasna; ["book", "yashts", "stanzas"] for Yashts(planned)
Greek poetry["composition", "lines"](planned)
Plato["dialogue", "stephanus"](planned)
Coptic Thomas["book", "logia"](planned)
Hidden Words["book", "parts", "words"](planned)
Caodai messages["book", "messages", "paragraphs"](planned)
{
  "schema": ["composition", "tablets", "lines"],
  "schemaLabels": {
    "en": ["Composition", "Tablet", "Line"]
  }
}

Refid conventions per corpus#

The refId is the canonical citation identifier — stable across versions and used by the website, the API, and downstream links. Conventions per corpus:

CorpusPatternExample
Biblical chapter:verse{CODE}-{chapter}:{verse}GEN-1:1, MAT-13:3
Akkadian{CODE}-{tablet-roman}:{line}GILG-XI:14, ATRA-I:1
Sumerian{CODE}-{line} (composite-text line)HOE-25, SKL-1
UgariticKTU-anchored {CODE}-{tablet}:{col}:{line}BAAL-1.3.i:5
Hittite (with CTH number in meta){CODE}-{tablet}:{line}EMRG-1:18 (CTH 344)
Avestan Vendidad{CODE}-{fargard}:{verse}VID-2:21
Avestan YasnaYAS-{chapter}:{stanza}YAS-30:3
Avestan YashtsYT-{n}:{stanza}YT-19:35
Greek poetry{CODE}-{line}THEO-116, ERGA-109
Plato{CODE}-{stephanus-page+letter}TIM-22b, CRI-113c
Greek prose{CODE}-{book}.{chapter}.{section}DIOD-1.10.1
Fragment corporaF-number + carrier locus in commentaryBER-F1 (Berossus, FGrH 680)
Coptic NHC{CODE}-{page}.{line} or {CODE}-{logion}THOM-77, AJOH-11:18
Pyramid Texts{CODE}-{utterance}:{line}PT-261:1
Bahá’í aphoristicHWA-{n} (Arabic), HWP-{n} (Persian)HWA-7
Bahá’í treatises{CODE}-{paragraph}IQAN-13
Caodai messages{CODE}-{vol}:{paragraph}TNHT-1:12
Oomoto Shin’yuOSHIN-{year}:{n}OSHIN-1892:1
Oomoto Reikai MonogatariRM-{volume}:{chapter}:{n}RM-1:4:7
LDS{CODE}-{chapter}:{verse}ABR-3:9, MOSES-1:33, DC-76:24
VedicRV-{maṇḍala}.{sūkta}:{ṛc}RV-10.129:4

Book codes are stable: once a book’s code is set in catalog.json it is referenced by every external link and never renamed.

Source file format (Translation-track only)#

For books in the WoH Translation track, the source language layer lives in immutable source-{lang}-{N}.json files alongside the translation chapter files. The source file is the ground truth — never edited after commit; if the upstream edition is updated, a new source file is created with a new fetch date.

data-library/vendidad-woh/
├── _meta.json
├── source-ave-2.json          # immutable Avestan source — Fargard 2
└── chapter-2.json             # the WoH English translation of fargard 2
{
  "schemaVersion": 2,
  "bookSlug": "vendidad-woh",
  "chapter": 2,
  "source": {
    "type": "avestan-transliteration",
    "versionTitle": "Geldner Avesta (1886-96)",
    "license": "Public Domain (Geldner)…",
    "versionSource": "Geldner, Avesta…",
    "fetchedFrom": "https://www.avesta.org/vendidad/vd.htm#chapter2",
    "fetchedAt": "2026-06-12"
  },
  "verses": [
    {
      "n": 1,
      "refId": "VID-2:1",
      "ave": "<Avestan verbatim>"
    }
  ]
}

source.type should be one of the documented type strings (see Source acquisition). Free-form provenance fields (witnessHeader, lineNumberingNote, verseDivisionNote, transliterationNote, editorialMarkupNote, siglaNote, fragmentationNote, scriptNote, messages, entries) are encouraged when they help future readers reproduce or audit the file.

Chapter format (chapter-N.json)#

{
  "n": 1,
  "bookSlug": "the-book-which-tells-the-truth",
  "bookCode": "TBWTT",
  "refId": "TBWTT-1",
  "title": "La Rencontre",
  "i18n": {
    "en": "The Encounter",
    "de": "Die Begegnung"
  },
  "paragraphs": [
    {
      "n": 1,
      "speaker": "Narrator",
      "text": "Depuis l'âge de neuf ans...",
      "i18n": {
        "en": "Since the age of nine...",
        "de": ""
      },
      "refId": "TBWTT-1:1"
    },
    {
      "n": 2,
      "speaker": "Narrator",
      "text": "Si j'allais, ce matin...",
      "i18n": {
        "en": "On the morning of...",
        "de": ""
      },
      "refId": "TBWTT-1:2"
    }
  ]
}

Reference ID format#

{BOOK_CODE}-{chapter}:{paragraph}

Examples:

  • TBWTT-1:5 — Book TBWTT, chapter 1, paragraph 5
  • TBWTT-3:100 — chapter 3, paragraph 100

Paragraph schema#

FieldTypeDescription
nnumberParagraph number (1-indexed)
speakerstringWho is speaking (Narrator, Yahweh, etc.)
textstringOriginal-language text
i18nobjectTranslations keyed by language code
refIdstringCanonical reference ID
kindstringOptional body (default), title, or continuation
preserveLineBreaksbooleanOptional; render each newline in this record’s source and translations as a visible line break
headingBeforeobjectOptional unnumbered heading before this reference: { "text": "Source heading", "i18n": { "en": "Translated heading" } }

The API’s library chapter endpoints preserve kind when it is present, so clients can reconstruct reading paragraphs without merging reference IDs. They also preserve preserveLineBreaks and resolve headingBefore to a string in the requested language, falling back to the source heading.

Use preserveLineBreaks only for verified verse, stanzas, or line-separated lists. Ordinary prose keeps its existing whitespace behavior. Bifrost applies the flag in the translation, source, and parallel-reference views. An unnumbered headingBefore renders as an h3 with an anchor such as c3p4-heading, immediately before the existing c3p4 reference. It does not add a reference, renumber paragraphs, or create an audio target.

The ETTMTTP print-layout repair is recorded in data-library/curation/2026-10-20-ett-print-layout.json. It restores the five stanzas at 1:41–45, the four list lines at 3:5, and the source headings before 1:41 and 3:4 in all ten languages. Reviewed narration overrides retain the exact inputs used by existing recordings, including their pause punctuation. The restored standalone headings remain unspoken in those recordings; all 475 reference targets and all 30 chapter/language narration sidecars stay unchanged.

Reading paragraphs and reference units#

Published reference numbers are stable, even when an OCR or ingestion error split one source paragraph into several records. Mark the second and subsequent records kind: "continuation" to join them to the preceding record in the reader. For example, TBWTT 2:69–70 reads as one continuous quotation, while both #c2p69 and #c2p70 remain valid selection, bookmark, and audio targets.

Bifrost groups consecutive continuation records in .library-book__reading-paragraph. Normal reading mode flows their text inline and shows the first record’s gutter. Interlinear mode keeps each translation beside its own source record, with normal row spacing.

When a translated sentence belongs to the neighboring reference, move only that sentence and retain the complete wording and order of each language. Do not infer corresponding boundaries from relative character positions. Use the reviewed manifests in data-library/curation/ and scripts/repair_paragraph_boundaries.py (dry-run by default, --apply to write). It checks source text, reference identities, and wording conservation before writing. Rebuild any tracked single-file book bundle after chapter edits.

Existing recordings may require regeneration after text moves between reference units: keeping IDs preserves the targets, but does not update audio timestamps.

Interlinear fields#

The reader’s interlinear always shows the original script on top and a transliteration beneath, word by word. It reads these verse fields:

FieldHolds
textThe original script (Hebrew, Greek, Geʿez, Coptic, Avestan, Arabic, …).
translitA Latin transliteration with the same number of space-separated words as text, so each word pairs with its transliteration. For lines/segments/tablets cuneiform books it is the source transliteration.
cuneiform + cuneiform_confidenceUnicode cuneiform back-rendered from translit (full / partial / low); the reader badges partial and low lines.
heLegacy Hebrew original (Shiʿur Qomah); text is preferred.
originalThe original-language text in public-domain editions, whose text is a translation (ASV Genesis, KJV Matthew). Added by scripts/add_pd_originals.py from the Westminster Leningrad Codex and SBLGNT, aligned to the English verse numbering.
text_langThe line’s own language in books that mix witnesses (1 Enoch, Jubilees, Daniel). It sets the line’s lang and direction; otherwise the book’s language applies.

Whether text is the original is decided per book: _meta.primaryLang == _meta.originalLang. When they differ, text stays the reading line and only original (or he) feeds the interlinear; _meta.originalText (edition, license, licenseUrl, url) is credited in the Licensing panel. Pages with no original-script block hide the interlinear control.

Right-to-left lines (he, hbo, arc, ar, arb, fa, syr, sam, ave) put dir="rtl" on the original block, so the word row itself runs right to left; the transliteration under each word stays left to right.

Generators in data-library scripts/: fill_translit.py fills any missing translit from text (hebrew_translit.py for pointed Hebrew, SBL academic; script_translit.py for Geʿez, Coptic and Greek, and for rendering an avesta.org transliteration into Avestan script); translit_to_cuneiform.py back-renders cuneiform. Books carrying generated material say so in _meta.interlinearNote.

Speaker types#

  • Narrator — narrative text
  • Yahweh — Yahweh speaking
  • Elohim — Elohim (collective)
  • Claude — Claude Vorilhon
  • Dialogue — conversation marker

URL deep-linking#

The reader supports both refId and short-format anchors:

/library/the-book-which-tells-the-truth/#TBWTT-1:5    (refId)
/library/the-book-which-tells-the-truth/#c1p5         (short form)

Translation status#

Empty string "" indicates a translation is not yet complete:

"i18n": {
  "en": "Translated text here",
  "de": "",
  "es": ""
}

Adding new content#

1. Create metadata#

Create _meta.json with book info and the chapter index.

2. Create chapters#

Create chapter-N.json for each chapter with a paragraph array.

3. Update catalog#

Add the book entry to catalog.json. See Library Book for the catalog schema.

4. Validate#

python -m json.tool book-name/_meta.json
python -m json.tool book-name/chapter-1.json

5. Deploy#

Update submodule pointers in www and api, then push.

Alignment between published editions#

A translation’s paragraph boundaries can differ from the source’s. Keep n and refId stable; align by the passage’s content, never by proportional paragraph counts. paragraph.alignment.en records exceptional English correspondences:

{"status": "group", "refIds": ["LWTE-4:34", "LWTE-4:35", "LWTE-4:36"]}
{"status": "covered-by", "refId": "LWTE-4:34"}
{"status": "not-in-witness", "note": "This passage is absent from the English edition."}

A group stores the shared English passage once in i18n.en. A covered-by or not-in-witness unit has an empty i18n.en; it must not contain an invented translation or a neighboring passage. The reader shows an explicit notice and keeps the French source accessible. This metadata is optional; existing translation fallback remains unchanged for unannotated books.

Reviewed assignments live in data-library/reviews/lwte-alignment-2026-10-18/. The application script verifies source-text conservation and exact before/after chapter hashes. The first LWTE alignment retains all 836 French references and restores English headings and list items omitted by the retired importer.

Book metadata may also contain audioHold, a language-keyed map of public explanations. A nonempty message withholds that language’s Listen controls while recordings or reference timings are being corrected. For example, {"en": "English audio is being updated to match the corrected paragraph references."} leaves French playback available. Remove the entry after replacement recordings, timings, and ambient variants have been validated and published.

When published editions have different paragraph boundaries, kindByLang may override kind for a specific language (for example, {"en": "continuation"}). The reader and audio assembler resolve this override before the shared kind value. Book metadata preserveParagraphBreaks is an optional language-keyed boolean map; enabled languages render double newlines within their translation as visible paragraph breaks. LWTE uses both fields to preserve English EPUB paragraph flow while keeping French reference units stable.

The localized API chapter endpoint resolves kindByLang into its returned kind. For exceptional correspondences it exposes the requested language’s alignment record and sourceText; missing counterparts return empty text instead of silently falling back to French.

Edit this page on GitHub