{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://publicschema.org/agri/AnimalResidence.schema.json",
  "title": "AnimalResidence",
  "description": "A period during which an individual animal or animal group is kept at an identified agricultural facility. A change of keeper need not change residence, and a residence does not itself record a movement.",
  "type": "object",
  "properties": {
    "animal_subject": {
      "oneOf": [
        {
          "$ref": "https://publicschema.org/IdentifiedAnimalUnit.schema.json"
        },
        {
          "type": "string",
          "description": "URI or identifier reference"
        }
      ],
      "description": "The individual animal or animal group to which the residence or responsibility applies, rather than a tag or a registry entry."
    },
    "animal_residence_site": {
      "oneOf": [
        {
          "$ref": "https://publicschema.org/agri/AgriculturalFacility.schema.json"
        },
        {
          "type": "string",
          "description": "URI or identifier reference"
        }
      ],
      "description": "The agricultural facility where the animal or group is kept during the residence. A holding or a keeper's home address does not identify it."
    },
    "start_date": {
      "type": "string",
      "format": "date",
      "description": "The date on which this became effective."
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "The last day on which this is effective. A period includes both its start date and its end date, so a period that applies only on 30 June 2026 has start date 2026-06-30 and end date 2026-06-30."
    },
    "recorded_at": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time the statement or event was entered into its source record. It can differ from when the fact took effect."
    }
  }
}
