{
  "$id": "https://learnaboutpearls.com/data/pearl-types.schema.json",
  "title": "Learn About Pearls: pearl types",
  "type": "array",
  "items": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "id": {
        "type": "string"
      },
      "names": {
        "type": "object",
        "properties": {
          "value": {
            "type": "object",
            "properties": {
              "common": {
                "type": "string"
              },
              "trade": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "synonyms": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "common"
            ]
          },
          "sources": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]*$"
            }
          },
          "asOf": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {}
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "sources"
        ]
      },
      "mollusk": {
        "type": "object",
        "properties": {
          "value": {
            "type": "object",
            "properties": {
              "scientific": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "common": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "scientific"
            ]
          },
          "sources": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]*$"
            }
          },
          "asOf": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {}
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "sources"
        ]
      },
      "water": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "enum": [
              "saltwater",
              "freshwater",
              "both"
            ]
          },
          "sources": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]*$"
            }
          },
          "asOf": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {}
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "sources"
        ]
      },
      "origin": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "enum": [
              "natural",
              "cultured",
              "both"
            ]
          },
          "sources": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]*$"
            }
          },
          "asOf": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {}
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "sources"
        ]
      },
      "regions": {
        "type": "object",
        "properties": {
          "value": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]*$"
            }
          },
          "asOf": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {}
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "sources"
        ]
      },
      "sizeMm": {
        "type": "object",
        "properties": {
          "value": {
            "type": "object",
            "properties": {
              "typical": {
                "type": "object",
                "properties": {
                  "min": {
                    "type": "number"
                  },
                  "max": {
                    "type": "number"
                  }
                },
                "required": [
                  "min",
                  "max"
                ]
              },
              "range": {
                "type": "object",
                "properties": {
                  "min": {
                    "type": "number"
                  },
                  "max": {
                    "type": "number"
                  }
                },
                "required": [
                  "min",
                  "max"
                ]
              },
              "text": {
                "type": "string"
              }
            }
          },
          "sources": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]*$"
            }
          },
          "asOf": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {}
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "sources"
        ]
      },
      "shapes": {
        "type": "object",
        "properties": {
          "value": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]*$"
            }
          },
          "asOf": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {}
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "sources"
        ]
      },
      "colors": {
        "type": "object",
        "properties": {
          "value": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]*$"
            }
          },
          "asOf": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {}
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "sources"
        ]
      },
      "growingTime": {
        "type": "object",
        "properties": {
          "value": {
            "type": "object",
            "properties": {
              "months": {
                "type": "object",
                "properties": {
                  "min": {
                    "type": "number"
                  },
                  "max": {
                    "type": "number"
                  }
                },
                "required": [
                  "min",
                  "max"
                ]
              },
              "note": {
                "type": "string"
              }
            },
            "required": [
              "months"
            ]
          },
          "sources": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]*$"
            }
          },
          "asOf": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {}
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "sources"
        ]
      },
      "nacre": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          },
          "sources": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]*$"
            }
          },
          "asOf": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {}
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "sources"
        ]
      },
      "priceTier": {
        "type": "object",
        "properties": {
          "value": {
            "type": "object",
            "properties": {
              "tier": {
                "type": "integer",
                "minimum": 1,
                "maximum": 5
              },
              "basis": {
                "type": "string"
              }
            },
            "required": [
              "basis"
            ]
          },
          "sources": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]*$"
            }
          },
          "asOf": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {}
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "sources"
        ]
      },
      "identification": {
        "type": "object",
        "properties": {
          "value": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]*$"
            }
          },
          "asOf": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {}
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "sources"
        ]
      },
      "wikidata": {
        "type": "string",
        "pattern": "^Q\\d+$"
      }
    },
    "required": [
      "id",
      "names",
      "mollusk",
      "water",
      "origin",
      "regions",
      "sizeMm",
      "shapes",
      "colors",
      "nacre",
      "identification"
    ]
  }
}
