{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A sampling or collecting event. Multiple dwc.occurrence records can reference the same event via eventRef, sharing location and protocol metadata.",
      "key": "tid",
      "record": {
        "properties": {
          "coordinateUncertaintyInMeters": {
            "description": "Uncertainty radius in meters around the coordinates.",
            "minimum": 1,
            "type": "integer"
          },
          "country": {
            "description": "The name of the country.",
            "maxGraphemes": 128,
            "type": "string"
          },
          "countryCode": {
            "description": "ISO 3166-1 alpha-2 country code.",
            "maxLength": 2,
            "minLength": 2,
            "type": "string"
          },
          "county": {
            "description": "Second-level administrative division.",
            "maxGraphemes": 256,
            "type": "string"
          },
          "createdAt": {
            "description": "Timestamp of record creation in the ATProto PDS.",
            "format": "datetime",
            "type": "string"
          },
          "decimalLatitude": {
            "description": "Geographic latitude in decimal degrees (WGS84). Range: -90 to 90.",
            "maxGraphemes": 32,
            "type": "string"
          },
          "decimalLongitude": {
            "description": "Geographic longitude in decimal degrees (WGS84). Range: -180 to 180.",
            "maxGraphemes": 32,
            "type": "string"
          },
          "eventDate": {
            "description": "The date or date range during which the event occurred. ISO 8601 format (e.g., '2024-03-15', '2024-03-15/2024-03-17').",
            "maxGraphemes": 64,
            "type": "string"
          },
          "eventID": {
            "description": "An identifier for the event. Should be globally unique or unique within the dataset.",
            "maxGraphemes": 256,
            "type": "string"
          },
          "eventRemarks": {
            "description": "Comments or notes about the event.",
            "maxGraphemes": 5000,
            "type": "string"
          },
          "eventTime": {
            "description": "The time or time range during which the event occurred. ISO 8601 format (e.g., '06:30:00', '06:30:00/09:00:00').",
            "maxGraphemes": 64,
            "type": "string"
          },
          "fieldNotes": {
            "description": "Notes or a reference to notes taken in the field about the event.",
            "maxGraphemes": 10000,
            "type": "string"
          },
          "geodeticDatum": {
            "description": "The spatial reference system. Recommended: 'EPSG:4326'.",
            "maxGraphemes": 64,
            "type": "string"
          },
          "habitat": {
            "description": "A category or description of the habitat in which the event occurred (e.g., 'primary tropical rainforest', 'degraded pasture', 'riparian zone').",
            "maxGraphemes": 512,
            "type": "string"
          },
          "locality": {
            "description": "Specific locality description.",
            "maxGraphemes": 1024,
            "type": "string"
          },
          "locationID": {
            "description": "Identifier for the location where the event occurred.",
            "maxGraphemes": 256,
            "type": "string"
          },
          "locationRemarks": {
            "description": "Comments about the location.",
            "maxGraphemes": 2048,
            "type": "string"
          },
          "maximumElevationInMeters": {
            "description": "Upper limit of elevation range in meters above sea level.",
            "type": "integer"
          },
          "minimumElevationInMeters": {
            "description": "Lower limit of elevation range in meters above sea level.",
            "type": "integer"
          },
          "municipality": {
            "description": "Third-level administrative division.",
            "maxGraphemes": 256,
            "type": "string"
          },
          "parentEventID": {
            "description": "An identifier for the broader event that this event is part of (e.g., a survey campaign that contains multiple transects).",
            "maxGraphemes": 256,
            "type": "string"
          },
          "parentEventRef": {
            "description": "AT-URI reference to the parent app.gainforest.dwc.event record.",
            "format": "at-uri",
            "type": "string"
          },
          "sampleSizeUnit": {
            "description": "The unit of measurement for the sampleSizeValue (e.g., 'square meters', 'hectares', 'trap-nights').",
            "maxGraphemes": 128,
            "type": "string"
          },
          "sampleSizeValue": {
            "description": "A numeric value for a measurement of the size of a sample in the event (e.g., '20', '0.25').",
            "maxGraphemes": 64,
            "type": "string"
          },
          "samplingEffort": {
            "description": "The amount of effort expended during the event (e.g., '3 person-hours', '14 trap-nights', '2 km transect walked').",
            "maxGraphemes": 256,
            "type": "string"
          },
          "samplingProtocol": {
            "description": "The names of, references to, or descriptions of the methods used during the event (e.g., 'camera trap array', 'line transect distance sampling', 'audio point count 10-min').",
            "maxGraphemes": 1024,
            "type": "string"
          },
          "stateProvince": {
            "description": "First-level administrative division.",
            "maxGraphemes": 256,
            "type": "string"
          }
        },
        "required": [
          "eventID",
          "eventDate",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "description": "A sampling event record aligned with Darwin Core Event class. Enables star-schema pattern where multiple occurrences reference a shared event context (location, protocol, effort).",
  "id": "app.gainforest.dwc.event",
  "lexicon": 1
}
