{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agrodt.github.io/agrotool-knowledge-portal/schemas/v1/evidence_summaries.schema.json",
  "title": "PublicEvidenceSummaries",
  "type": "array",
  "items": {
    "type": "object",
    "allOf": [
      { "$ref": "common.schema.json#/$defs/recordMetadata" },
      {
        "type": "object",
        "required": [
          "evidence_summary_id",
          "claim_type",
          "subject_id",
          "object_id",
          "summary",
          "source_id",
          "public_url",
          "locator",
          "confidence",
          "checked_at",
          "quote_license_class",
          "redaction_note"
        ],
        "properties": {
          "evidence_summary_id": {
            "type": "string",
            "pattern": "^E[A-Z0-9_-]{3,63}$"
          },
          "claim_type": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$" },
          "subject_id": { "$ref": "common.schema.json#/$defs/stableId" },
          "object_id": {
            "anyOf": [
              { "$ref": "common.schema.json#/$defs/stableId" },
              { "type": "null" }
            ]
          },
          "summary": { "$ref": "common.schema.json#/$defs/localizedText" },
          "source_id": { "type": "string", "pattern": "^S[A-Z0-9_-]{3,63}$" },
          "public_url": { "type": "string", "format": "uri" },
          "locator": { "type": "string", "minLength": 1 },
          "confidence": { "enum": ["low", "medium", "high"] },
          "checked_at": { "type": "string", "format": "date" },
          "short_quote": { "type": ["string", "null"], "maxLength": 500 },
          "quote_license_class": {
            "enum": [
              "none",
              "short_quote_permitted",
              "public_domain",
              "project_authored"
            ]
          },
          "redaction_note": { "type": ["string", "null"] }
        }
      }
    ],
    "unevaluatedProperties": false
  }
}
