{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "ZeroExternal curated knowledge history",
  "description": "A bounded, bilingual graph of sourced historical records. Status describes the kind of assertion, not a blanket truth rating. Directed edge semantics read: source extends/tests/supplies evidence for target. compares_question is an editorial comparison, never evidence of influence.",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "reviewed_on", "scope", "nodes", "edges"],
  "properties": {
    "schema": {"const": "0ex.knowledge-history.v1"},
    "reviewed_on": {"type": "string", "format": "date", "pattern": "^\\d{4}-\\d{2}-\\d{2}$"},
    "scope": {"$ref": "#/$defs/bilingual"},
    "nodes": {"type": "array", "minItems": 1, "maxItems": 5000, "items": {"$ref": "#/$defs/node"}},
    "edges": {"type": "array", "maxItems": 50000, "items": {"$ref": "#/$defs/edge"}}
  },
  "$defs": {
    "bilingual": {
      "type": "object",
      "additionalProperties": false,
      "required": ["en", "ru"],
      "properties": {
        "en": {"type": "string", "minLength": 1, "maxLength": 1600},
        "ru": {"type": "string", "minLength": 1, "maxLength": 1600}
      }
    },
    "id": {"type": "string", "pattern": "^[a-z][a-z0-9-]{1,99}$"},
    "httpsUrl": {"type": "string", "format": "uri", "pattern": "^https://[^\\s]+$", "maxLength": 2048},
    "date": {
      "type": "object",
      "additionalProperties": false,
      "required": ["label", "sort_year", "precision"],
      "properties": {
        "label": {"$ref": "#/$defs/bilingual"},
        "sort_year": {"type": "integer", "minimum": -100000, "maximum": 9999, "description": "Chronological sorting key: negative values denote BCE, positive values CE. Use the label and precision for uncertain, bounded or range dates; year zero is not used by this catalogue."},
        "precision": {"enum": ["approximate", "year", "range"], "description": "Precision of the chronology key, not an assertion that a surviving copy is an original. Exact event dates may be supplied in the label."}
      }
    },
    "source": {
      "type": "object",
      "additionalProperties": false,
      "required": ["title", "url", "kind", "locator"],
      "properties": {
        "title": {"type": "string", "minLength": 1, "maxLength": 500},
        "url": {"$ref": "#/$defs/httpsUrl"},
        "kind": {"enum": ["primary_text", "primary_paper", "critical_edition", "digitized_manuscript", "institutional_archive", "official_dataset", "official_program"]},
        "locator": {"type": "string", "minLength": 1, "maxLength": 600}
      }
    },
    "node": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "title", "date", "domain", "region", "kind", "status", "claim", "limits", "sources", "related_source_ids"],
      "properties": {
        "id": {"$ref": "#/$defs/id"},
        "title": {"$ref": "#/$defs/bilingual"},
        "date": {"$ref": "#/$defs/date"},
        "domain": {"enum": ["philosophy", "mathematics", "astronomy", "physics", "biology", "chemistry", "oceanography"]},
        "region": {"type": "string", "minLength": 1, "maxLength": 160},
        "kind": {"enum": ["text", "theory", "observation", "experiment", "dataset"]},
        "status": {"enum": ["historical", "theoretical", "observational", "model_prediction"], "description": "Classifies the stated claim. None of these values means that every part of a theory or historical source is established."},
        "claim": {"$ref": "#/$defs/bilingual"},
        "limits": {"$ref": "#/$defs/bilingual"},
        "sources": {"type": "array", "minItems": 1, "maxItems": 12, "items": {"$ref": "#/$defs/source"}},
        "related_source_ids": {"type": "array", "maxItems": 30, "uniqueItems": true, "items": {"type": "string", "minLength": 1, "maxLength": 128}, "description": "Only verified IDs from the existing source catalogue; empty when no correspondence has been reviewed."}
      }
    },
    "edge": {
      "type": "object",
      "additionalProperties": false,
      "required": ["source", "target", "type", "note", "evidence_urls"],
      "properties": {
        "source": {"$ref": "#/$defs/id"},
        "target": {"$ref": "#/$defs/id"},
        "type": {"enum": ["compares_question", "extends", "tests_prediction", "supplies_observation", "contradicts"]},
        "note": {"$ref": "#/$defs/bilingual"},
        "evidence_urls": {"type": "array", "minItems": 1, "maxItems": 12, "uniqueItems": true, "items": {"$ref": "#/$defs/httpsUrl"}}
      },
      "description": "Node references must resolve and cannot refer to the same node. Evidence URLs must be reviewed sources for the connected records. Every comparison must state its limited meaning; influence is not a supported relation. Cross-record constraints are checked by the catalogue tests."
    }
  }
}
