{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "contract": {
      "type": "string",
      "const": "OntologyDefinition"
    },
    "ontologyId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "dataSpaceId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "ownerRepo": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "bodySchemaRef": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "authority": {
      "type": "object",
      "properties": {
        "service": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "storage": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "scope": {
          "type": "string",
          "enum": [
            "tenant",
            "team",
            "user",
            "global"
          ]
        }
      },
      "required": [
        "service",
        "storage",
        "scope"
      ],
      "additionalProperties": false
    },
    "relationKinds": {
      "default": [],
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      }
    },
    "metricKinds": {
      "default": [],
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      }
    }
  },
  "required": [
    "contract",
    "ontologyId",
    "dataSpaceId",
    "ownerRepo",
    "bodySchemaRef",
    "authority",
    "relationKinds",
    "metricKinds"
  ],
  "additionalProperties": false,
  "$id": "https://schemas.infmonkeys.com/contracts/ontology-definition.schema.json",
  "title": "ontology-definition"
}
