{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "integer",
      "default": 1
    },
    "generatedAt": {
      "type": "string"
    },
    "families": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "integer",
            "default": 1
          },
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9-]+$"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "summary": {
            "type": "string",
            "minLength": 1
          },
          "order": {
            "type": "integer"
          },
          "color": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "summary",
          "order"
        ],
        "additionalProperties": false
      }
    },
    "genres": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "integer",
            "default": 1
          },
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9-]+$"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "family": {
            "type": "string",
            "minLength": 1
          },
          "isMarketingLabel": {
            "type": "boolean",
            "default": false
          },
          "era": {
            "type": "object",
            "properties": {
              "start": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "startApprox": {
                "type": "boolean",
                "default": false
              },
              "peakStart": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "peakEnd": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "start"
            ],
            "additionalProperties": false
          },
          "origins": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "city": {
                  "type": "string",
                  "minLength": 1
                },
                "country": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "city",
                "country"
              ],
              "additionalProperties": false
            },
            "default": []
          },
          "bpm": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "min": {
                    "type": "number"
                  },
                  "max": {
                    "type": "number"
                  },
                  "typical": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                "required": [
                  "min",
                  "max"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "summary": {
            "type": "string",
            "minLength": 1
          },
          "history": {
            "type": "string",
            "minLength": 1
          },
          "sound": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "figures": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "role": {
                  "type": "string",
                  "minLength": 1
                },
                "sourceRefs": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "default": []
                }
              },
              "required": [
                "name",
                "role"
              ],
              "additionalProperties": false
            },
            "default": []
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "city": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "founded": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "sourceRefs": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "default": []
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            },
            "default": []
          },
          "tracks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "artist": {
                  "type": "string",
                  "minLength": 1
                },
                "title": {
                  "type": "string",
                  "minLength": 1
                },
                "year": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "label": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "catalogNumber": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "why": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "evidence": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "default": []
                },
                "discogsUrl": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "youtube": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 6
                        },
                        "channel": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "uploaderType": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "label",
                                "artist",
                                "topic",
                                "fan"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "official": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "embeddable": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "startSeconds": {
                          "type": "integer",
                          "minimum": 0,
                          "default": 0
                        },
                        "checkedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null
                },
                "backup": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 6
                        },
                        "channel": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "uploaderType": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "label",
                                "artist",
                                "topic",
                                "fan"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "official": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "embeddable": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "startSeconds": {
                          "type": "integer",
                          "minimum": 0,
                          "default": 0
                        },
                        "checkedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null
                }
              },
              "required": [
                "artist",
                "title"
              ],
              "additionalProperties": false
            },
            "default": []
          },
          "parents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "evolved_from",
                    "fusion_of",
                    "influenced",
                    "reaction_to",
                    "regional_variant",
                    "revival_of"
                  ]
                },
                "note": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "sourceRefs": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "default": []
                }
              },
              "required": [
                "id",
                "type"
              ],
              "additionalProperties": false
            },
            "default": []
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "title": {
                  "type": "string",
                  "minLength": 1
                },
                "author": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "publisher": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "year": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "url": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "article",
                    "book",
                    "interview",
                    "lecture",
                    "database",
                    "encyclopedia"
                  ],
                  "default": "article"
                },
                "accessed": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "title"
              ],
              "additionalProperties": false
            },
            "default": []
          },
          "l2djLinks": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "default": []
          },
          "confidence": {
            "type": "string",
            "enum": [
              "high",
              "medium",
              "low"
            ],
            "default": "medium"
          },
          "openQuestions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "default": []
          }
        },
        "required": [
          "id",
          "name",
          "family",
          "era",
          "summary",
          "history"
        ],
        "additionalProperties": false
      }
    },
    "edges": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "minLength": 1
          },
          "to": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "type": "string",
            "enum": [
              "evolved_from",
              "fusion_of",
              "influenced",
              "reaction_to",
              "regional_variant",
              "revival_of"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "from",
          "to",
          "type"
        ],
        "additionalProperties": false
      }
    },
    "positions": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          }
        },
        "required": [
          "x",
          "y"
        ],
        "additionalProperties": false
      },
      "default": {}
    }
  },
  "required": [
    "generatedAt",
    "families",
    "genres",
    "edges"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://eweb.learningtodj.com/web.schema.json",
  "title": "The Electronic Music Web — web.json",
  "description": "Merged, validated dataset of electronic music genres, families, relationship edges and 2D layout positions."
}
