{
  "$id": "https://www.hestia.earth/schema-data/json-schema/Actor.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$comment": "Schema version 39.0.1",
  "title": "Actor",
  "description": "A person or institution.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string",
      "description": "My local unique ID",
      "examples": [
        "my-unique-id-1"
      ],
      "exportDefaultCSV": true,
      "pattern": "^[\\w\\u00C0-\\u017F\\-\\.\\s\\(\\),+]+$"
    },
    "@id": {
      "type": "string",
      "description": "Unique id assigned by HESTIA",
      "examples": [
        "@hestia-unique-id-1"
      ],
      "extend": true,
      "exportDefaultCSV": true
    },
    "type": {
      "type": "string",
      "description": "Type of the Node",
      "default": "Actor",
      "enum": [
        "Actor"
      ]
    },
    "@type": {
      "type": "string",
      "description": "Type of the Node",
      "default": "Actor",
      "enum": [
        "Actor"
      ],
      "extend": true
    },
    "name": {
      "type": "string",
      "description": "An automatically generated field made up of: firstName initial, lastName, primaryInstitution. If the Actor is an institution, the lastName only.",
      "examples": [
        "J. Poore, University of Oxford"
      ],
      "extend": true,
      "internal": true,
      "searchable": true
    },
    "firstName": {
      "type": "string",
      "description": "The Actor's first name.",
      "examples": [
        "Joseph"
      ]
    },
    "lastName": {
      "type": "string",
      "description": "The Actor's last name or the name of the institution.",
      "examples": [
        "Poore"
      ]
    },
    "orcid": {
      "type": "string",
      "description": "The Actor's ORCiD identifier.",
      "examples": [
        "0000-0002-2527-7466"
      ],
      "unique": true,
      "searchable": true
    },
    "scopusID": {
      "type": "string",
      "description": "The Actor's Scopus identifier.",
      "examples": [
        "6506007033"
      ],
      "unique": true,
      "searchable": true
    },
    "primaryInstitution": {
      "type": "string",
      "description": "The Actor's primary institution.",
      "examples": [
        "University of Oxford"
      ]
    },
    "city": {
      "type": "string",
      "description": "A city or town.",
      "examples": [
        "Oxford"
      ]
    },
    "country": {
      "$ref": "./Term-deep.json#",
      "description": "The country from the Glossary, following GADM naming conventions.",
      "examples": [
        {
          "@id": "GADM-GBR",
          "@type": "Term",
          "name": "United Kingdom",
          "termType": "region"
        }
      ]
    },
    "email": {
      "type": "string",
      "description": "The email address of the Actor.",
      "examples": [
        "joseph.poore@biology.ox.ac.uk"
      ],
      "format": "email",
      "extend": true,
      "searchable": true,
      "unique": true
    },
    "website": {
      "type": "object",
      "required": [
        "@id"
      ],
      "properties": {
        "@id": {
          "type": "string"
        }
      },
      "description": "A link to a website describing the Actor.",
      "examples": [
        {
          "@id": "https://www.oxfordmartin.ox.ac.uk/people/joseph-poore/"
        }
      ]
    },
    "dataPrivate": {
      "type": "boolean",
      "description": "If these data are private. Private means that HESTIA administrators can access these data and you can grant access to other platform users, but these data will not be made available to any other users of the platform or distributed to third parties.",
      "examples": [],
      "default": false
    },
    "originalId": {
      "type": "string",
      "description": "The identifier for these data in the source database (e.g., if the data were converted from openLCA or ecoinvent, the id field from that database).",
      "examples": [],
      "internal": true
    },
    "schemaVersion": {
      "type": "string",
      "description": "The version of the schema when these data were created.",
      "examples": [],
      "internal": true,
      "searchable": true
    },
    "createdAt": {
      "type": "string",
      "description": "Date created on HESTIA in ISO 8601 format (YYYY-MM-DD).",
      "examples": [],
      "format": "date",
      "internal": true,
      "searchable": true
    },
    "updatedAt": {
      "type": "string",
      "description": "Last update date on HESTIA in ISO 8601 format (YYYY-MM-DD).",
      "examples": [],
      "format": "date",
      "internal": true,
      "searchable": true
    }
  },
  "allOf": [
    {
      "if": {
        "required": [
          "country"
        ]
      },
      "then": {
        "properties": {
          "country": {
            "properties": {
              "termType": {
                "enum": [
                  "region"
                ]
              }
            }
          }
        }
      }
    }
  ],
  "oneOf": [
    {
      "required": [
        "@type",
        "@id"
      ]
    },
    {
      "required": [
        "type",
        "id"
      ]
    }
  ],
  "required": [
    "lastName",
    "dataPrivate"
  ]
}