{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "collection": {
      "properties": {
        "nsid": {
          "format": "nsid",
          "type": "string"
        },
        "records": {
          "type": "integer"
        }
      },
      "required": [
        "nsid",
        "records"
      ],
      "type": "object"
    },
    "file": {
      "properties": {
        "blob": {
          "accept": [
            "application/gzip"
          ],
          "type": "blob"
        },
        "description": {
          "type": "string"
        },
        "format": {
          "description": "What's inside the gzip.",
          "knownValues": [
            "json",
            "sqlite"
          ],
          "type": "string"
        },
        "name": {
          "description": "e.g. 'members.json.gz', 'contributions.sqlite.gz'.",
          "type": "string"
        },
        "records": {
          "description": "Entities in a JSON file; rows across all tables in a SQLite one.",
          "type": "integer"
        },
        "sha256": {
          "description": "Hex SHA-256 of the uncompressed file.",
          "type": "string"
        }
      },
      "required": [
        "name",
        "blob",
        "records",
        "sha256"
      ],
      "type": "object"
    },
    "link": {
      "properties": {
        "name": {
          "type": "string"
        },
        "url": {
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "name",
        "url"
      ],
      "type": "object"
    },
    "main": {
      "description": "Describes the contributions.fyi dataset and links the complete data files, so one getRecord and one getBlob per file downloads everything.",
      "key": "literal:self",
      "record": {
        "properties": {
          "collections": {
            "description": "The per-entity record collections in this repository.",
            "items": {
              "ref": "lex:fyi.contributions.dataset#collection",
              "type": "ref"
            },
            "type": "array"
          },
          "cycles": {
            "description": "Election cycles covered, named for the year each ends.",
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "description": {
            "type": "string"
          },
          "files": {
            "description": "The complete data files, gzipped: JSON, the same data as SQLite, and the source records behind it as SQLite.",
            "items": {
              "ref": "lex:fyi.contributions.dataset#file",
              "type": "ref"
            },
            "type": "array"
          },
          "generatedAt": {
            "description": "When the data was built.",
            "format": "datetime",
            "type": "string"
          },
          "license": {
            "type": "string"
          },
          "links": {
            "items": {
              "ref": "lex:fyi.contributions.dataset#link",
              "type": "ref"
            },
            "type": "array"
          },
          "methodology": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "recordsComplete": {
            "description": "False while the per-entity records are still being brought in line with this generation of the data; the files are always complete.",
            "type": "boolean"
          },
          "sources": {
            "items": {
              "ref": "lex:fyi.contributions.dataset#source",
              "type": "ref"
            },
            "type": "array"
          },
          "updatedAt": {
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "name",
          "description",
          "generatedAt",
          "cycles",
          "files",
          "collections",
          "sources",
          "license",
          "updatedAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "source": {
      "properties": {
        "name": {
          "type": "string"
        },
        "url": {
          "format": "uri",
          "type": "string"
        },
        "usedFor": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "url"
      ],
      "type": "object"
    }
  },
  "id": "fyi.contributions.dataset",
  "lexicon": 1
}
