{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://yottabyte.ir/assets/data/knowledge/v1/dataset-schema.json",
  "title": "Yottabyte Knowledge Dataset v1",
  "description": "Schema for the complete initial taxonomy snapshot.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "updated",
    "mission_en",
    "mission_fa",
    "fields",
    "records"
  ],
  "properties": {
    "schema_version": {
      "const": "1.0.0"
    },
    "updated": {
      "type": "string",
      "format": "date"
    },
    "mission_en": {
      "type": "string",
      "minLength": 1
    },
    "mission_fa": {
      "type": "string",
      "minLength": 1
    },
    "fields": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "$ref": "#/$defs/field"
      }
    },
    "records": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "schema.json"
      }
    }
  },
  "$defs": {
    "field": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name_en",
        "name_fa",
        "description_en",
        "description_fa"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
        },
        "name_en": {
          "type": "string",
          "minLength": 1
        },
        "name_fa": {
          "type": "string",
          "minLength": 1
        },
        "description_en": {
          "type": "string",
          "minLength": 1
        },
        "description_fa": {
          "type": "string",
          "minLength": 1
        }
      }
    }
  }
}
