{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Public allegations and evidence milestones research corpus",
  "description": "Structural schema. Use scripts/validate.py for chronology, references, and eligibility invariants.",
  "type": "object",
  "properties": {
    "metadata": {
      "type": "object"
    },
    "cases": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/case"
      }
    },
    "families": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/family"
      }
    },
    "sources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/source"
      }
    },
    "screening_register": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/screen"
      }
    },
    "suppression_episodes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/episode"
      }
    },
    "mechanism_studies": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/study"
      }
    },
    "research_notes": {
      "type": "array"
    }
  },
  "required": [
    "metadata",
    "cases",
    "families",
    "sources",
    "screening_register",
    "suppression_episodes",
    "mechanism_studies",
    "research_notes"
  ],
  "additionalProperties": true,
  "$defs": {
    "case": {
      "type": "object",
      "properties": {
        "case_id": {
          "type": "string"
        },
        "case_name": {
          "type": "string"
        },
        "family_id": {
          "type": "string"
        },
        "country_or_region": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "domain": {
          "type": "string"
        },
        "claim": {
          "type": "string"
        },
        "claim_scope_notes": {
          "type": "string"
        },
        "outcome": {
          "enum": [
            "substantiated",
            "partly_substantiated",
            "refuted",
            "unresolved",
            "unsubstantiated",
            "unassessable"
          ]
        },
        "outcome_as_of": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$"
        },
        "outcome_summary": {
          "type": "string"
        },
        "label_status": {
          "enum": [
            "documented_conspiracy_label",
            "documented_dismissal_or_denial",
            "retrospective_conspiracy_label_only",
            "no_label_documented",
            "not_applicable"
          ]
        },
        "conspiracy_label_timing": {
          "enum": [
            "verified_contemporaneous",
            "retrospective_or_unspecified",
            "not_established"
          ]
        },
        "label_evidence": {
          "type": "string"
        },
        "label_source_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "allegation": {
          "type": "object",
          "properties": {
            "date": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$"
            },
            "date_precision": {
              "enum": [
                "day",
                "month",
                "year",
                "unknown"
              ]
            },
            "description": {
              "type": "string"
            },
            "source_ids": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "uniqueItems": true
            },
            "date_basis": {
              "enum": [
                "earliest_located",
                "specified_landmark",
                "unknown"
              ]
            },
            "first_ever_claimed": {
              "const": false
            }
          },
          "required": [
            "date",
            "date_precision",
            "description",
            "source_ids",
            "date_basis",
            "first_ever_claimed"
          ],
          "additionalProperties": true
        },
        "resolution": {
          "type": "object",
          "properties": {
            "date": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$"
            },
            "date_precision": {
              "enum": [
                "day",
                "month",
                "year",
                "unknown"
              ]
            },
            "description": {
              "type": "string"
            },
            "source_ids": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "uniqueItems": true
            },
            "basis": {
              "enum": [
                "documents",
                "admission",
                "judicial_finding",
                "independent_inquiry",
                "scholarly_consensus",
                "scientific_assessment",
                "mixed",
                "none"
              ]
            }
          },
          "required": [
            "date",
            "date_precision",
            "description",
            "source_ids",
            "basis"
          ],
          "additionalProperties": true
        },
        "additional_milestones": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/milestone"
          }
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/event"
          }
        },
        "suppression": {
          "type": "object",
          "properties": {
            "status": {
              "enum": [
                "documented",
                "alleged",
                "not_documented_in_review",
                "not_applicable"
              ]
            },
            "mechanisms": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "source_ids": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "uniqueItems": true
            }
          },
          "required": [
            "status",
            "mechanisms",
            "description",
            "source_ids"
          ],
          "additionalProperties": true
        },
        "media": {
          "type": "object",
          "properties": {
            "initial_channel": {
              "type": "string"
            },
            "digital_role": {
              "enum": [
                "documented_material",
                "plausible_not_identified",
                "none_documented",
                "pre_internet",
                "unknown"
              ]
            },
            "description": {
              "type": "string"
            },
            "source_ids": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "uniqueItems": true
            }
          },
          "required": [
            "initial_channel",
            "digital_role",
            "description",
            "source_ids"
          ],
          "additionalProperties": true
        },
        "eligibility": {
          "type": "object",
          "properties": {
            "tier": {
              "enum": [
                "core",
                "sensitivity",
                "context_only",
                "exclude"
              ]
            },
            "reason": {
              "type": "string"
            },
            "positive_latency_eligible": {
              "type": "boolean"
            },
            "strict_label_eligible": {
              "type": "boolean"
            },
            "disclosure_context_sensitivity_eligible": {
              "type": "boolean"
            }
          },
          "required": [
            "tier",
            "reason",
            "positive_latency_eligible",
            "strict_label_eligible",
            "disclosure_context_sensitivity_eligible"
          ],
          "additionalProperties": true
        },
        "confidence": {
          "type": "string"
        },
        "uncertainties": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "source_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "research_module": {
          "type": "string"
        },
        "public_acceptance": {
          "type": "object",
          "properties": {
            "measured": {
              "const": false
            },
            "date": {
              "type": "null"
            },
            "date_precision": {
              "const": "unknown"
            },
            "reason": {
              "type": "string"
            }
          },
          "required": [
            "measured",
            "date",
            "date_precision",
            "reason"
          ],
          "additionalProperties": true
        },
        "internet_exposure": {
          "type": "object",
          "properties": {
            "measured": {
              "const": false
            },
            "internet_users_percent": {
              "type": "null"
            },
            "broadband_penetration": {
              "type": "null"
            },
            "distribution_reach": {
              "type": "null"
            },
            "replication_count": {
              "type": "null"
            },
            "reason": {
              "type": "string"
            }
          },
          "required": [
            "measured",
            "internet_users_percent",
            "broadband_penetration",
            "distribution_reach",
            "replication_count",
            "reason"
          ],
          "additionalProperties": true
        },
        "analysis": {
          "type": "object",
          "properties": {
            "temporal_bin": {
              "type": "string"
            },
            "resolution_event_type": {
              "type": "string"
            },
            "recorded_interval": {
              "anyOf": [
                {
                  "$ref": "#/$defs/interval"
                },
                {
                  "type": "null"
                }
              ]
            },
            "positive_interval": {
              "anyOf": [
                {
                  "$ref": "#/$defs/interval"
                },
                {
                  "type": "null"
                }
              ]
            },
            "quality_flags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "uniqueItems": true
            },
            "endpoint_variants": {
              "type": "object",
              "properties": {
                "selected": {
                  "$ref": "#/$defs/endpoint"
                },
                "earlier_public_support": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/endpoint"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "selected",
                "earlier_public_support"
              ],
              "additionalProperties": true
            }
          },
          "required": [
            "temporal_bin",
            "resolution_event_type",
            "recorded_interval",
            "positive_interval",
            "quality_flags",
            "endpoint_variants"
          ],
          "additionalProperties": true
        }
      },
      "required": [
        "case_id",
        "case_name",
        "family_id",
        "country_or_region",
        "domain",
        "claim",
        "claim_scope_notes",
        "outcome",
        "outcome_as_of",
        "outcome_summary",
        "label_status",
        "conspiracy_label_timing",
        "label_evidence",
        "label_source_ids",
        "allegation",
        "resolution",
        "additional_milestones",
        "events",
        "suppression",
        "media",
        "eligibility",
        "confidence",
        "uncertainties",
        "source_ids",
        "research_module",
        "public_acceptance",
        "internet_exposure",
        "analysis"
      ],
      "additionalProperties": true
    },
    "source": {
      "type": "object",
      "properties": {
        "source_id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "publisher": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "publication_date": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$"
        },
        "document_date": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$"
        },
        "source_type": {
          "enum": [
            "primary_record",
            "official_retrospective",
            "original_reporting",
            "scholarly_research",
            "secondary_history",
            "fact_check"
          ]
        },
        "accessed_date": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$"
        },
        "retrieval": {
          "enum": [
            "opened",
            "search_excerpt_only"
          ]
        },
        "supports": {
          "type": "string"
        },
        "limitations": {
          "type": "string"
        },
        "research_module": {
          "type": "string"
        }
      },
      "required": [
        "source_id",
        "title",
        "publisher",
        "url",
        "publication_date",
        "source_type",
        "accessed_date",
        "retrieval",
        "supports",
        "limitations",
        "research_module"
      ],
      "additionalProperties": true
    },
    "interval": {
      "type": "object",
      "properties": {
        "valid_order": {
          "type": "boolean"
        },
        "min_days": {
          "type": [
            "number",
            "null"
          ]
        },
        "max_days": {
          "type": [
            "number",
            "null"
          ]
        },
        "exact_days": {
          "type": [
            "number",
            "null"
          ]
        }
      },
      "required": [
        "valid_order",
        "min_days",
        "max_days",
        "exact_days"
      ],
      "additionalProperties": true
    },
    "endpoint": {
      "type": "object",
      "properties": {
        "date": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$"
        },
        "date_precision": {
          "enum": [
            "day",
            "month",
            "year",
            "unknown"
          ]
        },
        "description": {
          "type": "string"
        },
        "source_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        }
      },
      "required": [
        "date",
        "date_precision",
        "description",
        "source_ids"
      ],
      "additionalProperties": true
    },
    "milestone": {
      "type": "object",
      "properties": {
        "date": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$"
        },
        "event_type": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "source_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        }
      },
      "required": [
        "date",
        "event_type",
        "description",
        "source_ids"
      ],
      "additionalProperties": true
    },
    "event": {
      "type": "object",
      "properties": {
        "date": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$"
        },
        "date_precision": {
          "enum": [
            "day",
            "month",
            "year",
            "unknown"
          ]
        },
        "description": {
          "type": "string"
        },
        "source_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "event_id": {
          "type": "string"
        },
        "event_type": {
          "type": "string"
        },
        "date_min": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$"
        },
        "date_max": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$"
        },
        "is_selected_allegation": {
          "type": "boolean"
        },
        "is_selected_resolution": {
          "type": "boolean"
        }
      },
      "required": [
        "date",
        "date_precision",
        "description",
        "source_ids",
        "event_id",
        "event_type",
        "date_min",
        "date_max",
        "is_selected_allegation",
        "is_selected_resolution"
      ],
      "additionalProperties": true
    },
    "family": {
      "type": "object",
      "properties": {
        "family_id": {
          "type": "string"
        },
        "case_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "case_count": {
          "type": "integer",
          "minimum": 1
        },
        "crosses_temporal_bins": {
          "type": "boolean"
        },
        "description": {
          "type": "string"
        }
      },
      "required": [
        "family_id",
        "case_ids",
        "case_count",
        "crosses_temporal_bins",
        "description"
      ],
      "additionalProperties": true
    },
    "screen": {
      "type": "object",
      "properties": {
        "screening_id": {
          "type": "string"
        },
        "candidate": {
          "type": "string"
        },
        "family_id": {
          "type": "string"
        },
        "decision": {
          "enum": [
            "exclude",
            "defer",
            "context_only",
            "covered_by_case"
          ]
        },
        "reason": {
          "type": "string"
        },
        "source_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "follow_up": {
          "type": "string"
        },
        "research_depth": {
          "enum": [
            "source_screen",
            "scope_screen_only"
          ]
        },
        "case_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "not_an_outcome_observation": {
          "const": true
        },
        "research_module": {
          "type": "string"
        }
      },
      "required": [
        "screening_id",
        "candidate",
        "family_id",
        "decision",
        "reason",
        "source_ids",
        "follow_up",
        "research_depth",
        "case_ids",
        "not_an_outcome_observation",
        "research_module"
      ],
      "additionalProperties": true
    },
    "episode": {
      "type": "object",
      "properties": {
        "episode_id": {
          "type": "string"
        },
        "episode_name": {
          "type": "string"
        },
        "start_date": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$"
        },
        "end_date": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$"
        },
        "evidence_date": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$"
        },
        "country_or_region": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "distribution_environment": {
          "type": "string"
        },
        "suppression_attempt": {
          "type": "string"
        },
        "observed_result": {
          "type": "string"
        },
        "inference_for_hypothesis": {
          "type": "string"
        },
        "limitations": {
          "type": "string"
        },
        "source_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "related_family_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "related_case_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "pool_with_claim_latency": {
          "const": false
        },
        "start_event_type": {
          "type": "string"
        },
        "end_event_type": {
          "type": "string"
        }
      },
      "required": [
        "episode_id",
        "episode_name",
        "start_date",
        "end_date",
        "evidence_date",
        "country_or_region",
        "distribution_environment",
        "suppression_attempt",
        "observed_result",
        "inference_for_hypothesis",
        "limitations",
        "source_ids",
        "related_family_ids",
        "related_case_ids",
        "pool_with_claim_latency",
        "start_event_type",
        "end_event_type"
      ],
      "additionalProperties": true
    },
    "study": {
      "type": "object",
      "properties": {
        "study_id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "design": {
          "type": "string"
        },
        "finding": {
          "type": "string"
        },
        "relation_to_hypothesis": {
          "type": "string"
        },
        "limitations": {
          "type": "string"
        },
        "source_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        }
      },
      "required": [
        "study_id",
        "title",
        "design",
        "finding",
        "relation_to_hypothesis",
        "limitations",
        "source_ids"
      ],
      "additionalProperties": true
    }
  }
}
