{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.peptideschool.org/data/peptideschool-research-change-timeline-v1.0.0.schema.json",
  "title": "PeptideSchool Research and Regulatory Change Timeline",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "dataset",
    "scope",
    "summary",
    "records"
  ],
  "properties": {
    "dataset": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "version",
        "canonicalPage",
        "license",
        "publisher",
        "author",
        "language",
        "publicationDate",
        "reviewDate",
        "coverageEndDate",
        "citation"
      ],
      "properties": {
        "id": {
          "const": "peptideschool-research-change-timeline"
        },
        "version": {
          "const": "1.0.0"
        },
        "canonicalPage": {
          "const": "https://www.peptideschool.org/research-change-timeline"
        },
        "license": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "spdx",
            "url"
          ],
          "properties": {
            "spdx": {
              "const": "CC-BY-4.0"
            },
            "url": {
              "const": "https://creativecommons.org/licenses/by/4.0/"
            }
          }
        },
        "publisher": {
          "const": "PeptideSchool"
        },
        "author": {
          "const": "PeptideSchool Editorial Desk"
        },
        "language": {
          "const": "en-US"
        },
        "publicationDate": {
          "type": "string",
          "format": "date"
        },
        "reviewDate": {
          "type": "string",
          "format": "date"
        },
        "coverageEndDate": {
          "type": "string",
          "format": "date"
        },
        "citation": {
          "type": "string",
          "minLength": 80
        }
      }
    },
    "scope": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "purpose",
        "selectionRule",
        "included",
        "excluded",
        "interpretation"
      ],
      "properties": {
        "purpose": {
          "type": "string",
          "minLength": 80
        },
        "selectionRule": {
          "type": "string",
          "minLength": 80
        },
        "included": {
          "type": "string",
          "minLength": 80
        },
        "excluded": {
          "type": "string",
          "minLength": 80
        },
        "interpretation": {
          "type": "string",
          "minLength": 80
        }
      }
    },
    "summary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "eventCount",
        "scientificRecordCount",
        "regulatoryRecordCount",
        "eventTypeCounts",
        "uniqueSubjectCount",
        "uniqueSourceUrlCount",
        "earliestDate",
        "latestDate"
      ],
      "properties": {
        "eventCount": {
          "const": 12
        },
        "scientificRecordCount": {
          "type": "integer",
          "minimum": 1
        },
        "regulatoryRecordCount": {
          "type": "integer",
          "minimum": 1
        },
        "eventTypeCounts": {
          "type": "object",
          "minProperties": 7,
          "additionalProperties": {
            "type": "integer",
            "minimum": 1
          }
        },
        "uniqueSubjectCount": {
          "type": "integer",
          "minimum": 6
        },
        "uniqueSourceUrlCount": {
          "const": 12
        },
        "earliestDate": {
          "const": "2015-03-03"
        },
        "latestDate": {
          "const": "2026-07-24"
        }
      }
    },
    "records": {
      "type": "array",
      "minItems": 12,
      "maxItems": 12,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "date",
          "lane",
          "eventType",
          "subject",
          "jurisdiction",
          "evidenceScope",
          "title",
          "whatChanged",
          "whyItMatters",
          "boundary",
          "source",
          "relatedPaths"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "endDate": {
            "type": "string",
            "format": "date"
          },
          "lane": {
            "enum": [
              "scientific_record",
              "regulatory_record"
            ]
          },
          "eventType": {
            "enum": [
              "preclinical_publication",
              "randomized_trial_publication",
              "long_term_extension_publication",
              "trial_registry_posting",
              "regulatory_approval",
              "regulatory_label_expansion",
              "advisory_committee_meeting"
            ]
          },
          "subject": {
            "type": "string",
            "minLength": 4
          },
          "jurisdiction": {
            "type": "string",
            "minLength": 8
          },
          "evidenceScope": {
            "type": "string",
            "minLength": 20
          },
          "title": {
            "type": "string",
            "minLength": 30
          },
          "whatChanged": {
            "type": "string",
            "minLength": 80
          },
          "whyItMatters": {
            "type": "string",
            "minLength": 80
          },
          "boundary": {
            "type": "string",
            "minLength": 80
          },
          "source": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "title",
              "publisher",
              "url",
              "sourceClass",
              "recordId",
              "accessedAt"
            ],
            "properties": {
              "title": {
                "type": "string",
                "minLength": 20
              },
              "publisher": {
                "type": "string",
                "minLength": 10
              },
              "url": {
                "type": "string",
                "pattern": "^https://"
              },
              "sourceClass": {
                "enum": [
                  "primary_research_record",
                  "official_trial_registry",
                  "official_regulatory_record"
                ]
              },
              "recordId": {
                "type": "string",
                "minLength": 8
              },
              "accessedAt": {
                "type": "string",
                "format": "date"
              }
            }
          },
          "relatedPaths": {
            "type": "array",
            "minItems": 3,
            "maxItems": 3,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^/(?:research|news)/"
            }
          }
        }
      }
    }
  }
}
