{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Metkagram public datasets",
  "type": "object",
  "description": "Catalog and record shapes for annotated documents, canonical annotations, complete advanced patterns, quality metadata, and study sets.",
  "properties": {
    "catalog": {
      "type": "object",
      "required": [
        "schemaVersion",
        "version",
        "collections",
        "advancedPatterns"
      ]
    },
    "canonicalAnnotation": {
      "type": "object",
      "required": [
        "schema_version",
        "id",
        "kind",
        "text",
        "language",
        "spans",
        "source",
        "validation"
      ],
      "properties": {
        "schema_version": {
          "const": "1.0.0"
        },
        "text": {
          "type": "string"
        },
        "spans": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "start",
              "end",
              "type",
              "label"
            ]
          }
        }
      }
    },
    "annotatedDocument": {
      "type": "object",
      "required": [
        "id",
        "language",
        "title",
        "annotations"
      ]
    },
    "advancedPattern": {
      "type": "object",
      "required": [
        "id",
        "group_id",
        "set_id",
        "title_ru",
        "langs",
        "quality"
      ]
    },
    "patternQuality": {
      "type": "object",
      "required": [
        "status",
        "indexable",
        "min_unique_examples",
        "translations_complete",
        "languages"
      ]
    },
    "studySets": {
      "type": "object",
      "required": [
        "sets",
        "learningPaths"
      ]
    },
    "move": {
      "type": "object",
      "required": [
        "id",
        "kind",
        "name",
        "language",
        "language_independent",
        "pattern_ids",
        "frame_ids"
      ],
      "properties": {
        "kind": {
          "const": "move"
        },
        "language": {
          "type": "null"
        },
        "language_independent": {
          "const": true
        }
      }
    },
    "frame": {
      "type": "object",
      "required": [
        "id",
        "kind",
        "pattern_id",
        "language",
        "formula",
        "example",
        "translations",
        "source_kind"
      ],
      "properties": {
        "kind": {
          "const": "frame"
        },
        "language": {
          "type": "string"
        },
        "translations": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "source_kind": {
          "enum": [
            "canonical_pattern",
            "language_extension"
          ]
        }
      }
    },
    "bridge": {
      "type": "object",
      "required": [
        "id",
        "kind",
        "from_frame_id",
        "to_frame_id",
        "from_language",
        "to_language",
        "relation",
        "review_status",
        "literal_equivalence"
      ],
      "properties": {
        "kind": {
          "const": "bridge"
        },
        "review_status": {
          "const": "reviewed"
        },
        "literal_equivalence": {
          "const": false
        }
      }
    }
  }
}
