{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openadhkar.org/v1/schema/translation.schema.json",
  "title": "Open Adhkar translation layer",
  "type": "object",
  "required": [
    "collection_id",
    "version",
    "language",
    "source_language",
    "translator",
    "divisions",
    "entries"
  ],
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "type": "string"
    },
    "collection_id": {
      "type": "string",
      "minLength": 1
    },
    "version": {
      "type": "string",
      "minLength": 1
    },
    "language": {
      "type": "string",
      "minLength": 1
    },
    "source_language": {
      "type": "string",
      "minLength": 1
    },
    "translator": {
      "type": "object",
      "required": [
        "kind",
        "reviewed"
      ],
      "properties": {
        "kind": {
          "enum": [
            "machine",
            "human"
          ]
        },
        "model": {
          "type": "string",
          "minLength": 1
        },
        "rules": {
          "type": "string",
          "minLength": 1
        },
        "reviewed": {
          "type": "boolean"
        }
      }
    },
    "divisions": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[a-z0-9-]+:[a-z][0-9]+$"
      },
      "additionalProperties": {
        "type": "object",
        "required": [
          "title"
        ],
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "entries": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[a-z0-9-]+:[a-z][0-9]+$"
      },
      "additionalProperties": {
        "type": "object",
        "required": [
          "text",
          "status"
        ],
        "additionalProperties": false,
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1
          },
          "citation": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "enum": [
              "machine",
              "machine-retranslated",
              "reviewed"
            ]
          }
        }
      }
    }
  }
}
