{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Registry entry for a document publisher or repository. One record per source, using a fixed slug as the record key. Referenced by tech.transparencia.document.item records via strongRef.",
      "key": "any",
      "record": {
        "properties": {
          "baseUrl": {
            "description": "Base URL of the source's public website or repository.",
            "format": "uri",
            "type": "string"
          },
          "country": {
            "description": "ISO 3166-1 alpha-2 country code, when the source is national in scope (e.g., 'MX', 'BR'). Omit for international or multinational sources.",
            "maxLength": 2,
            "type": "string"
          },
          "createdAt": {
            "description": "When this source was registered in the AT Protocol network.",
            "format": "datetime",
            "type": "string"
          },
          "description": {
            "description": "Short description of the source, its mandate, and what kind of documents it publishes.",
            "maxGraphemes": 1000,
            "maxLength": 5000,
            "type": "string"
          },
          "displayName": {
            "description": "Human-readable name (e.g., 'Diario Oficial de la Federación', 'United Nations Framework Convention on Climate Change').",
            "maxGraphemes": 128,
            "maxLength": 512,
            "type": "string"
          },
          "identifier": {
            "description": "Persistent identifier for the source (e.g., Wikidata QID, ROR ID, LEI, or canonical slug).",
            "maxLength": 256,
            "type": "string"
          },
          "identifierType": {
            "description": "Identifier system used for identifier.",
            "knownValues": [
              "wikidata",
              "ror",
              "lei",
              "isni",
              "internal",
              "other"
            ],
            "maxLength": 64,
            "type": "string"
          },
          "jurisdiction": {
            "description": "Legal or administrative scope this source publishes for.",
            "knownValues": [
              "local",
              "municipal",
              "state",
              "federal",
              "national",
              "regional",
              "international",
              "supranational",
              "unknown"
            ],
            "maxGraphemes": 64,
            "maxLength": 256,
            "type": "string"
          },
          "language": {
            "description": "Primary language used by this source (BCP-47, e.g., 'es-MX', 'en').",
            "format": "language",
            "type": "string"
          },
          "license": {
            "description": "Default license, copyright status, or terms of use that apply to documents from this source (e.g., 'public-domain', 'public-sector', 'CC-BY-4.0').",
            "maxGraphemes": 128,
            "maxLength": 512,
            "type": "string"
          },
          "logoUrl": {
            "description": "URL to the source's logo or seal.",
            "format": "uri",
            "type": "string"
          },
          "name": {
            "description": "Machine-readable slug (e.g., 'dof', 'unfccc', 'scjn', 'inegi').",
            "maxGraphemes": 64,
            "maxLength": 256,
            "type": "string"
          },
          "publisherName": {
            "description": "Official publishing body name, if different from displayName (e.g., displayName 'DOF', publisherName 'Secretaría de Gobernación').",
            "maxGraphemes": 128,
            "maxLength": 512,
            "type": "string"
          },
          "sourceType": {
            "description": "Kind of publishing source. Open set; consumers should tolerate unknown values.",
            "knownValues": [
              "official-gazette",
              "government-website",
              "legislative-portal",
              "judicial-portal",
              "regulatory-agency",
              "environmental-registry",
              "education-registry",
              "procurement-portal",
              "statistics-agency",
              "international-organization",
              "academic-repository",
              "manual-upload",
              "other"
            ],
            "maxLength": 64,
            "type": "string"
          },
          "updatedAt": {
            "description": "When this record was last materially updated.",
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "name",
          "displayName",
          "sourceType",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "description": "A document source: an official gazette, government repository, institutional archive, court system, registry, or other publisher of public-interest documents tracked by TransparencIA.",
  "id": "tech.transparencia.document.source",
  "lexicon": 1
}
