bible-technology / scripture-burrito

Scripture Burrito Schema & Docs 🌯
http://docs.burrito.bible/
MIT License
21 stars 13 forks source link

Roles; Normalization; Less oneOf; Enums for Audio; Template Schema; Braille Example #177

Closed mvahowe closed 4 years ago

mvahowe commented 4 years ago

This PR aims to complete the immediate, outstanding 0.2 issues.

Roles

In last week's episode, we made roles and scope independent, so that an ingredient can have either, both or neither. In this PR I've reworked the roles to make sense alongside scope, eg

    "release/text/USX_1/OTINT.usx": {
      "checksum": {
        "md5": "0123456789abcdef0123456789abcdef"
      },
        "mimeType": "text/x-usx+xml",
        "scope": {
            "GEN": [],
            "EXO": [],
            "LEV": [],
...
        },
      "role": "introduction",
      "size": 1234
    }

We still have the full list USX peripherals (including values that make no sense without knowledge of Paratext internals):

                "abbreviations",
                "alphacontents",
                "chron",
                "cnc",
                "contents",
                "cover",
                "foreword",
                "glo",
                "halftitle",
                "imprimatur",
                "lxxquotes",
                "maps",
                "measures",
                "ndx",
                "preface",
                "promo",
                "pubdata",
                "spine",
                "tdx",
                "title"

I expanded the list of audiovisual-oriented values to cover everything I've seen in CBT translations:

                "background",
                "bridge",
                "credits",
                "diagram",
                "gloss",
                "illustration",
                "introduction",
                "scripture",
                "teaching",
                "timing"

I made the list of PoD-oriented roles shorter by reusing values from other lists:

                "body",
                "thumbnail"

There are also regex patterns for systems where resources are intended to be indexed (eg SL word definition videos):

^(name|sign|word|concept|place)(\\s.*\\S)?$

I added a regex pattern for labelling story-like units in CBT:

^unit\\s.*\\S$

and - in the expectation that this list will grow, I added x-roles:

^x-\\S.*\\S$

Normalization

This is now an optional field in the meta section:

"normalization": "NFC"

Less oneOf

I reworked the schema at three levels to replace oneOf constructs with enums of a key plus conditional subschemas. The main benefit of this is shorter and more readable error messages. (It may make things faster too.)

Template metadata subschema

While I was reworking the top-level schema I added a "template" option. Right now it's extremely lax, but at least it exists.

Enums for audio

I replaced the tristate dramatization field with an array of tags:

"performance": ["multipleVoice", "drama", "withMusic"]

The array must contain:

Other permitted values are

"withMusic",
"withEffects",
"withHeadings"

Braille Example Document

I thought I copied this over last time, but apparently I didn't. It's definitely here this time.


I think all the example docs validate. I haven't prettyprinted since I realised, after starting to edit, that the files still have inconsistent indents, and fixing that in the PR would hide all the interesting changes.