{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.mikereams.com/calm/v1/blueprint-catalog.standard.json",
  "title": "Blueprint Catalog CALM Standard",
  "description": "Lets a CALM node, relationship, flow or architecture name the Blueprint Catalog business capabilities, value stream stages and data concepts it supports, in a blueprint-catalog entry of its metadata. Ids are checked for shape here; look them up at https://catalog.mikereams.com/api/v1/ to check they exist. Version 1: fields are only ever added.",
  "$comment": "Blueprint Catalog (https://catalog.mikereams.com), CC BY 4.0 Mike Reams. Composes with CALM release 1.2 (FINOS, Apache-2.0); not affiliated with or endorsed by FINOS.",
  "$ref": "#/$defs/catalog-references",
  "$defs": {
    "business-capability-id": {
      "type": "string",
      "pattern": "^BC-[0-9]{3,4}(\\.[0-9]{2}){0,3}$",
      "description": "A Business Capability id, e.g. BC-670.10."
    },
    "value-stream-stage-id": {
      "type": "string",
      "pattern": "^VS-[0-9]{2,3}\\.[0-9]{2}$",
      "description": "A Value Stream Stage id, e.g. VS-120.10."
    },
    "data-concept-id": {
      "type": "string",
      "pattern": "^DC-[0-9]{3}$",
      "description": "A Data Concept id, e.g. DC-110."
    },
    "catalog-references": {
      "type": "object",
      "description": "What this element supports in the Blueprint Catalog. catalog-release records the catalog version the ids were taken from, so a retired id can be traced to its successor.",
      "properties": {
        "catalog-release": {
          "type": "string",
          "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
        },
        "business-capability-ids": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/business-capability-id"
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "value-stream-stage-ids": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/value-stream-stage-id"
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "data-concept-ids": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/data-concept-id"
          },
          "minItems": 1,
          "uniqueItems": true
        }
      },
      "anyOf": [
        {
          "required": [
            "business-capability-ids"
          ]
        },
        {
          "required": [
            "value-stream-stage-ids"
          ]
        },
        {
          "required": [
            "data-concept-ids"
          ]
        },
        {
          "required": [
            "catalog-release"
          ]
        }
      ],
      "additionalProperties": false
    },
    "tagged-metadata": {
      "description": "CALM metadata (array or object form) that carries a valid blueprint-catalog entry.",
      "oneOf": [
        {
          "type": "array",
          "contains": {
            "type": "object",
            "required": [
              "blueprint-catalog"
            ]
          },
          "items": {
            "if": {
              "type": "object",
              "required": [
                "blueprint-catalog"
              ]
            },
            "then": {
              "properties": {
                "blueprint-catalog": {
                  "$ref": "#/$defs/catalog-references"
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "blueprint-catalog"
          ],
          "properties": {
            "blueprint-catalog": {
              "$ref": "#/$defs/catalog-references"
            }
          }
        }
      ]
    },
    "node": {
      "description": "A CALM 1.2 node that names what it supports in the catalog.",
      "allOf": [
        {
          "$ref": "https://calm.finos.org/release/1.2/meta/core.json#/defs/node"
        },
        {
          "type": "object",
          "required": [
            "metadata"
          ],
          "properties": {
            "metadata": {
              "$ref": "#/$defs/tagged-metadata"
            }
          }
        }
      ]
    },
    "relationship": {
      "description": "A CALM 1.2 relationship that names what it supports in the catalog.",
      "allOf": [
        {
          "$ref": "https://calm.finos.org/release/1.2/meta/core.json#/defs/relationship"
        },
        {
          "type": "object",
          "required": [
            "metadata"
          ],
          "properties": {
            "metadata": {
              "$ref": "#/$defs/tagged-metadata"
            }
          }
        }
      ]
    },
    "flow": {
      "description": "A CALM 1.2 flow that names the capabilities and value stream stages it realizes.",
      "allOf": [
        {
          "$ref": "https://calm.finos.org/release/1.2/meta/flow.json#/defs/flow"
        },
        {
          "type": "object",
          "required": [
            "metadata"
          ],
          "properties": {
            "metadata": {
              "$ref": "#/$defs/tagged-metadata"
            }
          }
        }
      ]
    }
  }
}
