{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://petrhauschwitz.com/authority-data.schema.json",
  "title": "Petr Hauschwitz public authority data",
  "type": "object",
  "required": [
    "schemaVersion",
    "updated",
    "person",
    "expertise",
    "scholarMetrics",
    "organization",
    "institutions",
    "events",
    "publications",
    "recognition",
    "media"
  ],
  "properties": {
    "schemaVersion": {
      "const": 3
    },
    "updated": {
      "type": "string",
      "format": "date"
    },
    "person": {
      "type": "object",
      "required": [
        "name",
        "displayName",
        "role",
        "publicRole",
        "publicRoleSource",
        "jobTitles",
        "orcid",
        "shortBio",
        "portrait",
        "heroImage",
        "sameAs"
      ]
    },
    "expertise": {
      "type": "object",
      "required": [
        "primaryField",
        "summary",
        "leadershipSource",
        "terms",
        "methods",
        "materials",
        "surfaceFunctions",
        "evidence"
      ],
      "properties": {
        "primaryField": {
          "type": "string",
          "minLength": 1
        },
        "summary": {
          "type": "string",
          "minLength": 1
        },
        "leadershipSource": {
          "type": "string",
          "format": "uri"
        },
        "terms": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": [
              "name",
              "alternateNames"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "alternateNames": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          }
        },
        "methods": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "materials": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "surfaceFunctions": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "evidence": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": [
              "value",
              "label",
              "summary",
              "source"
            ],
            "properties": {
              "value": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "summary": {
                "type": "string",
                "minLength": 1
              },
              "source": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    },
    "scholarMetrics": {
      "type": "object",
      "required": [
        "provider",
        "profileUrl",
        "authorId",
        "asOf",
        "sinceYear",
        "citations",
        "hIndex",
        "i10Index",
        "graph"
      ],
      "properties": {
        "provider": {
          "const": "Google Scholar"
        },
        "profileUrl": {
          "type": "string"
        },
        "authorId": {
          "type": "string"
        },
        "asOf": {
          "type": "string",
          "format": "date"
        },
        "sinceYear": {
          "type": "integer"
        },
        "citations": {
          "$ref": "#/$defs/scholarMetric"
        },
        "hIndex": {
          "$ref": "#/$defs/scholarMetric"
        },
        "i10Index": {
          "$ref": "#/$defs/scholarMetric"
        },
        "graph": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "year",
              "citations"
            ],
            "properties": {
              "year": {
                "type": "integer"
              },
              "citations": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        }
      }
    },
    "organization": {
      "type": "object",
      "required": [
        "name",
        "legalName",
        "url",
        "description",
        "technologyUrl",
        "collectionUrl",
        "journalUrl"
      ]
    },
    "institutions": {
      "type": "object"
    },
    "events": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/record"
      }
    },
    "publications": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/record"
      }
    },
    "recognition": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/record"
      }
    },
    "media": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/record"
      }
    }
  },
  "$defs": {
    "scholarMetric": {
      "type": "object",
      "required": [
        "all",
        "since"
      ],
      "properties": {
        "all": {
          "type": "integer",
          "minimum": 0
        },
        "since": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "record": {
      "type": "object",
      "required": [
        "id",
        "year",
        "category",
        "title",
        "status",
        "sourceType",
        "claimScope",
        "holoringRelevance"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9-]+$"
        },
        "year": {
          "type": "string"
        },
        "category": {
          "enum": [
            "talk",
            "publication",
            "recognition",
            "media"
          ]
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "enum": [
            "verified",
            "corroborated",
            "listed",
            "pending"
          ]
        },
        "sourceType": {
          "type": "string",
          "minLength": 1
        },
        "source": {
          "type": "string"
        },
        "mediaUrl": {
          "type": "string"
        },
        "mediaLabel": {
          "type": "string"
        },
        "lastVerified": {
          "type": [
            "string",
            "null"
          ]
        },
        "claimScope": {
          "type": "string",
          "minLength": 1
        },
        "holoringRelevance": {
          "type": "string",
          "minLength": 1
        }
      }
    }
  }
}
