{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Biodiversity contribution to THE Sustainability Impact Ratings SDG 15 — Schema",
  "description": "Canonical format for an IMT Atlantique biodiversity contribution to a potential Times Higher Education (THE) Sustainability Impact Ratings submission for SDG 15 (Life on Land). Structured to be ingested by an LLM under human supervision when re-generating responses from an updated THE questionnaire. Evidence items map to THE indicator IDs (15.x.y).",
  "type": "object",
  "required": ["meta", "scoring_rules", "metrics", "evidence"],
  "properties": {
    "meta": {
      "type": "object",
      "required": ["ranking", "sdg", "methodology_version", "institution", "campuses", "generated"],
      "properties": {
        "ranking": { "type": "string", "examples": ["THE Sustainability Impact Ratings"] },
        "sdg": { "type": "integer", "examples": [15] },
        "sdg_title": { "type": "string", "examples": ["Life on Land"] },
        "methodology_version": { "type": "string", "examples": ["2026 v1.0"] },
        "methodology_url": { "type": "string", "format": "uri" },
        "institution": { "type": "string", "examples": ["IMT Atlantique"] },
        "contribution_scope": {
          "type": "string",
          "description": "Explicit statement that this is a sub-contribution, not the full institutional submission."
        },
        "campuses": {
          "type": "array",
          "items": { "type": "string", "enum": ["Brest", "Nantes", "Rennes"] },
          "description": "MUST be listed alphabetically (Brest, Nantes, Rennes)."
        },
        "generated": { "type": "string", "format": "date" },
        "author": { "type": "object", "properties": {
          "name": { "type": "string" },
          "role": { "type": "string" },
          "url": { "type": "string", "format": "uri" }
        }}
      }
    },
    "scoring_rules": {
      "type": "object",
      "required": ["per_question_max", "breakdown"],
      "properties": {
        "per_question_max": { "type": "integer", "examples": [3, 4] },
        "breakdown": {
          "type": "object",
          "properties": {
            "statement": { "type": "number" },
            "evidence": { "type": "number" },
            "evidence_is_public": { "type": "number" },
            "reviewed_2020_2024": { "type": "number" }
          }
        },
        "evidence_scoring": {
          "type": "object",
          "properties": {
            "specific": { "type": "number" },
            "general": { "type": "number" },
            "not_relevant": { "type": "number" }
          }
        },
        "llm_validation": {
          "type": "string",
          "description": "2026 rule: evidence must be self-contained on the page. No link-following by validator."
        }
      }
    },
    "metrics": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id", "title", "weight_in_sdg", "questions"],
        "properties": {
          "id": { "type": "string", "pattern": "^15\\.[1-4]$" },
          "title": { "type": "string" },
          "weight_in_sdg": { "type": "number", "minimum": 0, "maximum": 1 },
          "weight_overall": { "type": "number", "minimum": 0, "maximum": 1 },
          "covered_by_this_contribution": { "type": "boolean" },
          "coverage_note": { "type": "string" },
          "questions": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["id", "label", "year", "question_text", "max_points", "weight_in_sdg", "coverage", "evidence_ids"],
              "properties": {
                "id": { "type": "string", "pattern": "^15\\.[1-4]\\.[0-9]+$" },
                "label": { "type": "string" },
                "year": { "type": "string", "examples": ["2024", "in place by 2024"] },
                "question_text": { "type": "string", "description": "Exact wording from THE methodology." },
                "max_points": { "type": "number" },
                "weight_in_sdg": { "type": "number", "minimum": 0, "maximum": 1 },
                "weight_overall": { "type": "number", "minimum": 0, "maximum": 1 },
                "scoring_breakdown": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "criterion": { "type": "string" },
                      "points": { "type": "number" }
                    }
                  }
                },
                "coverage": {
                  "type": "string",
                  "enum": ["covered", "partial", "not_covered_by_contribution", "research_dept_required"]
                },
                "response_text": {
                  "type": "string",
                  "description": "The actual answer IMT Atlantique would submit, written to maximise score (specific, concrete, evidence-based, self-contained)."
                },
                "evidence_ids": {
                  "type": "array",
                  "items": { "type": "string", "pattern": "^E-SDG15-[0-9]{3}$" }
                },
                "estimated_score": {
                  "type": "object",
                  "properties": {
                    "value": { "type": "number" },
                    "justification": { "type": "string" }
                  }
                },
                "gap": { "type": "string", "description": "What is missing or who should provide it." }
              }
            }
          }
        }
      }
    },
    "evidence": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id", "title", "type", "campus", "the_questions", "self_contained"],
        "properties": {
          "id": { "type": "string", "pattern": "^E-SDG15-[0-9]{3}$" },
          "title": { "type": "string" },
          "type": {
            "type": "string",
            "enum": ["monitoring", "policy", "education", "partnership", "planning", "land_management", "outreach", "research"]
          },
          "campus": {
            "type": "array",
            "items": { "type": "string", "enum": ["Brest", "Nantes", "Rennes", "all"] }
          },
          "the_questions": {
            "type": "array",
            "items": { "type": "string", "pattern": "^15\\.[1-4]\\.[0-9]+$" }
          },
          "url": { "type": "string", "format": "uri-reference" },
          "self_contained": {
            "type": "boolean",
            "description": "True if the linked page contains the evidence inline (2026 THE rule)."
          },
          "description": { "type": "string" },
          "species_mentioned": { "type": "array", "items": { "type": "string" } },
          "partner_organisations": { "type": "array", "items": { "type": "string" } },
          "year": { "type": "string" },
          "date_iso": { "type": "string", "format": "date" },
          "quantitative_data": { "type": "object", "description": "Free-form numeric facts (surface_m2, observations, species_count, etc.)" }
        }
      }
    }
  }
}
