{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://mydatashelf.com/items/citation-schema.json",
  "title": "MyDataShelf Agent citation object",
  "description": "Minimum fields when quoting or summarizing a MyDataShelf item. Do not drop sources or relabel analyst constructs as official statistics.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "title",
    "updated_at",
    "license",
    "quote",
    "attribution",
    "sources"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9-]+$",
      "description": "Shelf item id, e.g. source-priority, industry-sample."
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "updated_at": {
      "type": "string",
      "format": "date",
      "description": "Item revision date, YYYY-MM-DD."
    },
    "license": {
      "type": "string",
      "const": "free-to-read, cite-with-attribution, no-paid-redistribution"
    },
    "html": {
      "type": "string",
      "format": "uri"
    },
    "quote": {
      "type": "string",
      "minLength": 1,
      "description": "Verbatim span or a one-sentence paraphrase that still carries the original labels."
    },
    "attribution": {
      "type": "string",
      "minLength": 8,
      "description": "Human-readable credit, including MyDataShelf and the item URL."
    },
    "accessed_at": {
      "type": "string",
      "format": "date"
    },
    "sources": {
      "type": "array",
      "minItems": 1,
      "items": { "$ref": "#/$defs/source" }
    }
  },
  "$defs": {
    "source": {
      "type": "object",
      "additionalProperties": false,
      "required": ["source_url", "publisher", "accessed_at", "label"],
      "properties": {
        "source_url": { "type": "string", "format": "uri" },
        "publisher": { "type": "string", "minLength": 1 },
        "title": { "type": "string" },
        "date": { "type": "string" },
        "accessed_at": { "type": "string", "format": "date" },
        "label": {
          "type": "string",
          "enum": [
            "[官方统计]",
            "[政策法规]",
            "[协会统计]",
            "[公司披露]",
            "[推断]",
            "[观点]"
          ]
        }
      }
    }
  }
}
