{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.peptideschool.org/data/peptideschool-research-source-taxonomy-v1.0.0.schema.json",
  "title": "PeptideSchool Research Source Taxonomy v1.0.0",
  "type": "object",
  "additionalProperties": false,
  "required": ["$schema", "dataset", "scope", "records", "sources"],
  "properties": {
    "$schema": { "type": "string", "format": "uri" },
    "dataset": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "title", "version", "datePublished", "dateModified", "canonical", "license", "publisher", "author", "language"],
      "properties": {
        "id": { "const": "peptideschool-research-source-taxonomy" },
        "title": { "type": "string", "minLength": 20 },
        "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
        "datePublished": { "type": "string", "format": "date" },
        "dateModified": { "type": "string", "format": "date" },
        "canonical": { "type": "string", "format": "uri" },
        "license": { "type": "string", "format": "uri" },
        "publisher": { "const": "PeptideSchool" },
        "author": { "const": "PeptideSchool Editorial Desk" },
        "language": { "const": "en-US" }
      }
    },
    "scope": {
      "type": "object",
      "additionalProperties": false,
      "required": ["purpose", "included", "excluded", "interpretation"],
      "properties": {
        "purpose": { "type": "string", "minLength": 40 },
        "included": { "type": "string", "minLength": 20 },
        "excluded": { "type": "string", "minLength": 20 },
        "interpretation": { "type": "string", "minLength": 40 }
      }
    },
    "records": {
      "type": "array",
      "minItems": 14,
      "uniqueItems": true,
      "items": { "$ref": "#/$defs/taxonomyRecord" }
    },
    "sources": {
      "type": "array",
      "minItems": 10,
      "uniqueItems": true,
      "items": { "$ref": "#/$defs/source" }
    }
  },
  "$defs": {
    "taxonomyRecord": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "claimFamily", "claimQuestion", "preferredSourceClass", "minimumRecordSet", "evidenceRole", "requiredContext", "insufficientAlone", "reviewTriggers", "exampleSourceIds"],
      "properties": {
        "id": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" },
        "claimFamily": { "type": "string", "minLength": 10 },
        "claimQuestion": { "type": "string", "minLength": 30 },
        "preferredSourceClass": { "type": "string", "minLength": 20 },
        "minimumRecordSet": { "type": "string", "minLength": 30 },
        "evidenceRole": { "type": "string", "minLength": 40 },
        "requiredContext": { "type": "string", "minLength": 40 },
        "insufficientAlone": { "type": "string", "minLength": 40 },
        "reviewTriggers": { "type": "string", "minLength": 30 },
        "exampleSourceIds": { "type": "array", "uniqueItems": true, "items": { "type": "string", "pattern": "^[a-z0-9]+$" } }
      }
    },
    "source": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "name", "publisher", "url", "role"],
      "properties": {
        "id": { "type": "string", "pattern": "^[a-z0-9]+$" },
        "name": { "type": "string", "minLength": 5 },
        "publisher": { "type": "string", "minLength": 5 },
        "url": { "type": "string", "format": "uri" },
        "role": { "type": "string", "minLength": 20 }
      }
    }
  }
}
