{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://civilizationsci.org/framework/framework-schema.json",
  "title": "Civilization Science Framework 1.0 research record",
  "description": "Machine-readable structure for versioned propositions, evidence, models, reviews, and corrections.",
  "type": "object",
  "required": [
    "record_id",
    "framework_version",
    "academic_revision",
    "record_type",
    "status",
    "version",
    "created",
    "provenance"
  ],
  "additionalProperties": false,
  "properties": {
    "record_id": {
      "type": "string",
      "minLength": 1
    },
    "framework_version": {
      "const": "1.0"
    },
    "academic_revision": {
      "type": "string",
      "pattern": "^1\\.[0-9]+$"
    },
    "record_type": {
      "enum": [
        "source",
        "evidence",
        "claim",
        "model",
        "review",
        "erratum",
        "research_protocol"
      ]
    },
    "status": {
      "enum": [
        "draft",
        "preregistered",
        "under-review",
        "provisional",
        "supported",
        "contested",
        "falsified",
        "superseded",
        "withdrawn"
      ]
    },
    "language": {
      "type": "string"
    },
    "version": {
      "type": "string",
      "minLength": 1
    },
    "created": {
      "type": "string",
      "format": "date-time"
    },
    "modified": {
      "type": "string",
      "format": "date-time"
    },
    "title": {
      "type": "string"
    },
    "statement": {
      "type": "string"
    },
    "system_boundary": {
      "type": "string"
    },
    "time_window": {
      "type": "string"
    },
    "population": {
      "type": "string"
    },
    "variables": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "links": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/link"
      }
    },
    "provenance": {
      "$ref": "#/$defs/provenance"
    },
    "uncertainty": {
      "type": "string"
    },
    "falsification_condition": {
      "type": "string"
    },
    "conflicts_of_interest": {
      "type": "string"
    },
    "license": {
      "type": "string"
    }
  },
  "$defs": {
    "link": {
      "type": "object",
      "required": [
        "relation",
        "target_id"
      ],
      "additionalProperties": false,
      "properties": {
        "relation": {
          "enum": [
            "supports",
            "contradicts",
            "qualifies",
            "uses",
            "tests",
            "reviews",
            "supersedes",
            "corrects",
            "disputes"
          ]
        },
        "target_id": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      }
    },
    "provenance": {
      "type": "object",
      "required": [
        "creator",
        "method"
      ],
      "additionalProperties": false,
      "properties": {
        "creator": {
          "type": "string"
        },
        "institution": {
          "type": "string"
        },
        "method": {
          "type": "string"
        },
        "source_url": {
          "type": "string",
          "format": "uri"
        },
        "source_identifier": {
          "type": "string"
        },
        "geography": {
          "type": "string"
        },
        "rights": {
          "type": "string"
        },
        "transformations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "software": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}
