{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://bibleverse-generator.org/datasets/life-situations-v0.1.schema.json",
  "title": "KJV–RV1909 Life Situations Dataset v0.1",
  "description": "Schema for the deterministic public dataset generated by Bible Verse Generator.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "datasetVersion",
    "generatedAt",
    "name",
    "description",
    "landingPage",
    "license",
    "sourceInputChecksums",
    "topicCount",
    "membershipCount",
    "uniqueCanonicalReferenceCount",
    "recordCount",
    "records"
  ],
  "properties": {
    "datasetVersion": {
      "const": "0.1"
    },
    "generatedAt": {
      "const": "2026-07-22T00:00:00.000Z",
      "type": "string",
      "format": "date-time"
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "description": {
      "type": "string",
      "minLength": 1
    },
    "landingPage": {
      "type": "string",
      "format": "uri"
    },
    "license": {
      "type": "string",
      "format": "uri"
    },
    "sourceInputChecksums": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "data/situations.ts",
        "data/situation-content.ts",
        "public/kjv-map.json",
        "public/rv1909-map.json"
      ],
      "properties": {
        "data/situations.ts": {
          "const": "e929f90d4a0c96396f834074555de201812f7e219aa80466e067a633f0a2e590"
        },
        "data/situation-content.ts": {
          "const": "85041c7596388309dbcc2258a35db2a9601314ccc8b0f46679d36c13502e1d99"
        },
        "public/kjv-map.json": {
          "const": "db2a5cfd08bf8c4d750c7d8a8127e2f8601acce5a619e712bc0ba4da1d1c2da3"
        },
        "public/rv1909-map.json": {
          "const": "9917f2327e82d3a44a671ab5a43cc8985981ddb65441540ad560d9f3f745aee7"
        }
      }
    },
    "topicCount": {
      "const": 10,
      "type": "integer"
    },
    "membershipCount": {
      "const": 180,
      "type": "integer"
    },
    "uniqueCanonicalReferenceCount": {
      "const": 163,
      "type": "integer"
    },
    "recordCount": {
      "const": 360,
      "type": "integer"
    },
    "records": {
      "type": "array",
      "minItems": 360,
      "maxItems": 360,
      "items": {
        "$ref": "#/$defs/record"
      }
    }
  },
  "$defs": {
    "record": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "datasetVersion",
        "generatedAt",
        "situationSlug",
        "subtopic",
        "canonicalReference",
        "locale",
        "text",
        "edition",
        "sourceId",
        "sourceUrl",
        "sourceReference",
        "annotationStatus",
        "annotationReviewerName",
        "annotationReviewerRole",
        "annotationReviewedAt",
        "annotationUpdatedAt",
        "whyIncluded",
        "contextNote",
        "subtopicLabel"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "locale": {
                "const": "en"
              }
            },
            "required": [
              "locale"
            ]
          },
          "then": {
            "properties": {
              "edition": {
                "const": "KJV"
              },
              "sourceId": {
                "const": "eng-kjv2006"
              },
              "sourceUrl": {
                "const": "https://ebible.org/details.php?id=eng-kjv2006"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "locale": {
                "const": "es"
              }
            },
            "required": [
              "locale"
            ]
          },
          "then": {
            "properties": {
              "edition": {
                "const": "RV1909"
              },
              "sourceId": {
                "const": "spaRV1909"
              },
              "sourceUrl": {
                "const": "https://ebible.org/details.php?id=spaRV1909"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "situationSlug": {
                "const": "anxiety"
              }
            },
            "required": [
              "situationSlug"
            ]
          },
          "then": {
            "properties": {
              "annotationStatus": {
                "const": "provisional"
              },
              "annotationUpdatedAt": {
                "type": "string",
                "minLength": 1
              },
              "whyIncluded": {
                "type": "string",
                "minLength": 1
              },
              "contextNote": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "else": {
            "properties": {
              "annotationStatus": {
                "type": "null"
              },
              "annotationUpdatedAt": {
                "type": "null"
              },
              "whyIncluded": {
                "type": "null"
              },
              "contextNote": {
                "type": "null"
              }
            }
          }
        }
      ],
      "properties": {
        "datasetVersion": {
          "const": "0.1"
        },
        "generatedAt": {
          "const": "2026-07-22T00:00:00.000Z",
          "type": "string",
          "format": "date-time"
        },
        "situationSlug": {
          "type": "string",
          "enum": [
            "anxiety",
            "healing",
            "sleep",
            "loneliness",
            "hard-times",
            "guidance",
            "relationships",
            "forgiveness",
            "temptation",
            "new-beginnings"
          ]
        },
        "subtopic": {
          "type": "string",
          "enum": [
            "section-1",
            "section-2",
            "section-3"
          ]
        },
        "canonicalReference": {
          "type": "string",
          "pattern": "^[1-3]?[A-Za-z' ]+ [0-9]+:[0-9]+$"
        },
        "locale": {
          "type": "string",
          "enum": [
            "en",
            "es"
          ]
        },
        "text": {
          "type": "string",
          "minLength": 1
        },
        "edition": {
          "type": "string",
          "enum": [
            "KJV",
            "RV1909"
          ]
        },
        "sourceId": {
          "type": "string",
          "enum": [
            "eng-kjv2006",
            "spaRV1909"
          ]
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "sourceReference": {
          "type": "string",
          "pattern": "^[1-3]?[A-Za-z' ]+ [0-9]+:[0-9]+$"
        },
        "annotationStatus": {
          "enum": [
            "provisional",
            null
          ]
        },
        "annotationReviewerName": {
          "type": "null"
        },
        "annotationReviewerRole": {
          "type": "null"
        },
        "annotationReviewedAt": {
          "type": "null"
        },
        "annotationUpdatedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "whyIncluded": {
          "type": [
            "string",
            "null"
          ]
        },
        "contextNote": {
          "type": [
            "string",
            "null"
          ]
        },
        "subtopicLabel": {
          "type": "string",
          "minLength": 1
        }
      }
    }
  }
}
