{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schema.humancellatlas.org/system/1.1.2/links",
  "description": "A schema for a links bundle.",
  "additionalProperties": false,
  "required": [
    "describedBy",
    "schema_type"
  ],
  "title": "links",
  "type": "object",
  "definitions": {
    "protocol_links": {
      "type": "object",
      "properties": {
        "protocol_type": {
          "description": "Type of protocol entity.",
          "type": "string"
        },
        "protocol_id": {
          "description": "UUID of the protocol entity.",
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        }
      }
    },
    "bundle_links": {
      "type": "object",
      "properties": {
        "process": {
          "description": "UUID of the process entity.",
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "inputs": {
          "description": "Array of UUIDs for the input entities.",
          "type": "array",
          "items": {
            "description": "UUID of the input entity.",
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
          }
        },
        "input_type": {
          "description": "The type of the input entity.",
          "type": "string",
          "enum": [
            "biomaterial",
            "file"
          ]
        },
        "outputs": {
          "description": "Array of UUIDs for the output entities.",
          "type": "array",
          "items": {
            "description": "UUID of the output entity.",
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
          }
        },
        "output_type": {
          "description": "The type of the output entity.",
          "type": "string",
          "enum": [
            "biomaterial",
            "file"
          ]
        },
        "protocols": {
          "description": "Array of protocol entities.",
          "type": "array",
          "items": {
            "description": "Type and UUID of a protocol entity.",
            "type": "object",
            "$ref": "core/links.json#/definitions/protocol_links"
          }
        }
      }
    }
  },
  "properties": {
    "describedBy": {
      "description": "The URL reference to the schema.",
      "type": "string",
      "pattern": "^(http|https)://schema.(.*?)humancellatlas.org/core/(([0-9]{1,}.[0-9]{1,}.[0-9]{1,})|([a-zA-Z]*?))/links"
    },
    "schema_version": {
      "description": "The version number of the schema in major.minor.patch format.",
      "type": "string",
      "pattern": "^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}$"
    },
    "schema_type": {
      "description": "The type of the metadata schema entity.",
      "type": "string",
      "enum": [
        "link_bundle"
      ]
    },
    "links": {
      "description": "An array of linking objects",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "core/links.json#/definitions/bundle_links"
      }
    }
  }
}
