{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schema.humancellatlas.org/module/biomaterial/0.0.0/residence",
  "description": "Donor's residence location information.",
  "additionalProperties": false,
  "minProperties": 1,
  "dependencies": {
    "granular_location": [
      "country"
    ]
  },
  "title": "Residence",
  "name": "residence.json",
  "type": "object",
  "properties": {
    "describedBy": {
      "description": "The URL reference to the schema.",
      "type": "string",
      "pattern": "^(http|https)://schema.(.*?)humancellatlas.org/module/biomaterial/(([0-9]{1,}.[0-9]{1,}.[0-9]{1,})|([a-zA-Z]*?))/human_specific"
    },
    "schema_version": {
      "description": "The version number of the schema in major.minor.patch format.",
      "type": "string",
      "pattern": "^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}$",
      "example": "4.6.1"
    },
    "country": {
      "description": "Country and state of donor's residence.",
      "type": "string",
      "user_friendly": "Country",
      "example": "Singapore; United Kingdom; Massachusetts USA; New South Wales Australia; Bauchi State; Nigeria",
      "guidelines": "Enter the country or state and country if available.",
      "bionetworks": [
        "genetic diversity"
      ]
    },
    "granular_location": {
      "description": "Nearest city, town, or village to location of donor's residence.",
      "type": "string",
      "user_friendly": "Location",
      "example": "Singapore; Cambridge; Boston; Kingston",
      "bionetworks": [
        "genetic diversity"
      ]
    },
    "duration": {
      "description": "Duration of residence, in years, rounded up to the nearest whole number.",
      "type": "string",
      "pattern": "^[0-9]+-?[0-9]*$",
      "user_friendly": "Duration of residence",
      "example": "20; 37; 45-65",
      "guidelines": "Enter either a single value or a range of values. Indicate a range using a hyphen.",
      "bionetworks": [
        "genetic diversity"
      ]
    },
    "area_type": {
      "description": "Urban, suburban, or rural descriptor of residence.",
      "type": "string",
      "enum": [
        "urban",
        "suburban",
        "rural"
      ],
      "user_friendly": "Area type of residence",
      "example": "urban; suburban; rural",
      "guidelines": "Should be one of: urban; suburban; rural",
      "bionetworks": [
        "genetic diversity"
      ]
    }
  }
}
