{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A GBIF dataset registration record linking a PDS organization to its GBIF dataset UUID, installation, and archive blob.",
      "key": "tid",
      "record": {
        "properties": {
          "archiveBlob": {
            "accept": [
              "application/zip"
            ],
            "description": "Blob reference to the DwC-A archive ZIP. Storing as a proper blob ref prevents PDS garbage collection.",
            "type": "blob"
          },
          "archiveBlobCid": {
            "description": "CID of the most recently uploaded DwC-A blob",
            "maxGraphemes": 128,
            "type": "string"
          },
          "createdAt": {
            "description": "Timestamp of record creation in the ATProto PDS",
            "format": "datetime",
            "type": "string"
          },
          "datasetTitle": {
            "description": "Human-readable dataset title",
            "maxGraphemes": 256,
            "type": "string"
          },
          "gbifDatasetKey": {
            "description": "GBIF dataset UUID returned by POST /dataset",
            "maxGraphemes": 64,
            "type": "string"
          },
          "gbifEndpointKey": {
            "description": "GBIF endpoint integer key returned by POST /dataset/{key}/endpoint",
            "type": "integer"
          },
          "gbifInstallationKey": {
            "description": "GBIF installation UUID used when creating the dataset",
            "maxGraphemes": 64,
            "type": "string"
          },
          "lastCrawlFinishReason": {
            "description": "Result of last GBIF crawl (NORMAL, ABORT, etc.)",
            "maxGraphemes": 32,
            "type": "string"
          },
          "lastPublishedAt": {
            "description": "When the archive was last published to GBIF",
            "format": "datetime",
            "type": "string"
          },
          "organizationRef": {
            "description": "AT-URI of the organization info record this dataset belongs to",
            "format": "at-uri",
            "type": "string"
          }
        },
        "required": [
          "organizationRef",
          "gbifDatasetKey",
          "gbifInstallationKey",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "description": "Tracks a dataset registered with GBIF via the Registry API. Links a PDS organization to its GBIF dataset UUID, installation, and archive blob.",
  "id": "app.gainforest.gbif.dataset",
  "lexicon": 1
}
