{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://litlfred.github.io/bootstrap/0.1.0/schemas/graph.schema.json",
  "$comment": "Generated by the bootstrap toolset (https://github.com/litlfred/bootstrap-tools, scripts/gen-bootstrap-schemas.ts) from its Zod source — do not edit; change the Zod.",
  "title": "Knowledge Graph declaration",
  "description": "A Declaration. Any field not listed here is an Extension: A field of a Declaration, or of one of its entries, that is not defined here. A reader that does not recognise the field ignores it, and the rest of the Declaration keeps its meaning.",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "description": "The Knowledge Graph's name. The declaration file is `<name>.json`."
    },
    "version": {
      "description": "Its version, as MAJOR.MINOR.PATCH (semantic versioning).",
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    },
    "iriBase": {
      "description": "The address its IRIs are minted under, before the version. An identifier a program reads is `<iriBase><version>/…`; a page meant for a person is `<iriBase>v<major>/…`.",
      "type": "string",
      "format": "uri"
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "directories": {
      "description": "Its Subgraphs: zero or more.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "description": "The Subgraph's name, unique within its Knowledge Graph."
          },
          "path": {
            "type": "string",
            "minLength": 1,
            "description": "The directory, relative to the declaration."
          },
          "graphTypologies": {
            "minItems": 1,
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "skills",
                  "description": "A Subgraph of Skills: the instructions an Actor follows to carry out a Task."
                },
                {
                  "type": "string",
                  "const": "schemas",
                  "description": "A Subgraph of Node Schemas: files that state the shape other files must have."
                },
                {
                  "type": "string",
                  "const": "scenarios",
                  "description": "A Subgraph of Roles: the responsibilities an Actor takes on, and who takes them on."
                },
                {
                  "type": "string",
                  "const": "processes",
                  "description": "A Subgraph of Processes: BPMN diagrams that coordinate Tasks, and the decision tables their gateways compute from."
                },
                {
                  "type": "string",
                  "const": "models",
                  "description": "A Subgraph describing the language models an Actor may be: which languages each is good at, and whether a person checked."
                },
                {
                  "type": "string",
                  "minLength": 1,
                  "description": "A Graph Typology a Harness defines. To a reader that knows only bootstrap it is an Extension: A field of a Declaration, or of one of its entries, that is not defined here. A reader that does not recognise the field ignores it, and the rest of the Declaration keeps its meaning."
                }
              ],
              "description": "A named set of Node Kinds."
            },
            "description": "The Graph Typologies it holds."
          },
          "title": {
            "description": "A short name for people, shown as its README's heading.",
            "type": "string"
          },
          "description": {
            "description": "What it holds, in a sentence or two, shown under that heading.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "path",
          "graphTypologies"
        ],
        "additionalProperties": {},
        "description": "A directory entry of a Declaration: an id, a directory, and the Graph Typologies its Node Instances' kinds belong to."
      }
    },
    "needs": {
      "description": "Its Dependencies: the Knowledge Graphs it may refer into.",
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "description": "A Declaration's `needs` entry naming another Knowledge Graph. References may point from this graph's Node Instances into the named one, never back."
      }
    },
    "nodeSchemas": {
      "description": "Its Node Kinds: each `$schema` value its Node Instances may carry, paired with the Node Schema that defines it — an IRI, or a path relative to this Declaration.",
      "type": "object",
      "propertyNames": {
        "type": "string",
        "minLength": 1
      },
      "additionalProperties": {
        "type": "string",
        "minLength": 1
      }
    },
    "assets": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "src": {
            "type": "string",
            "minLength": 1,
            "description": "The file, relative to the declaration."
          },
          "role": {
            "type": "string",
            "minLength": 1,
            "description": "The part the file plays, such as `instance-readme`."
          }
        },
        "required": [
          "id",
          "src",
          "role"
        ],
        "additionalProperties": {},
        "description": "A file entry of a Declaration: one file about the repository itself, whose `role` field says what it is for."
      }
    }
  },
  "required": [
    "name"
  ],
  "additionalProperties": {},
  "$defs": {
    "Node": {
      "title": "Node",
      "description": "One file, or one part of a file addressable by an IRI fragment, named by an IRI.",
      "uses": [],
      "isDefinedBy": "https://www.w3.org/TR/json-ld11/#node-objects"
    },
    "Reference": {
      "title": "Reference",
      "description": "A Node's naming of another Node by its IRI.",
      "uses": [
        "Node"
      ],
      "isDefinedBy": "https://www.rfc-editor.org/rfc/rfc3987"
    },
    "NodeSchema": {
      "title": "NodeSchema",
      "description": "A schema a Node can be checked against: a JSON Schema, or a published external schema such as BPMN's.",
      "uses": [
        "Node"
      ],
      "isDefinedBy": "http://json-schema.org/draft-07/schema#"
    },
    "NodeKind": {
      "title": "NodeKind",
      "description": "A name paired with a Node Schema.",
      "uses": [
        "NodeSchema"
      ],
      "isDefinedBy": "#/properties/nodeSchemas"
    },
    "Subkind": {
      "title": "Subkind",
      "description": "A Node Kind whose Node Schema requires everything another Node Kind's does, so every Node that satisfies it satisfies the other too.",
      "uses": [
        "NodeKind",
        "NodeSchema",
        "Node"
      ],
      "isDefinedBy": "#/$defs/Subkind"
    },
    "NodeInstance": {
      "title": "NodeInstance",
      "description": "A Node that names its Node Kind, in `$schema` or front matter, and satisfies that kind's Node Schema.",
      "uses": [
        "Node",
        "NodeKind",
        "NodeSchema"
      ],
      "isDefinedBy": "#/$defs/NodeInstance"
    },
    "GraphTypology": {
      "title": "GraphTypology",
      "anyOf": [
        {
          "type": "string",
          "const": "skills",
          "description": "A Subgraph of Skills: the instructions an Actor follows to carry out a Task."
        },
        {
          "type": "string",
          "const": "schemas",
          "description": "A Subgraph of Node Schemas: files that state the shape other files must have."
        },
        {
          "type": "string",
          "const": "scenarios",
          "description": "A Subgraph of Roles: the responsibilities an Actor takes on, and who takes them on."
        },
        {
          "type": "string",
          "const": "processes",
          "description": "A Subgraph of Processes: BPMN diagrams that coordinate Tasks, and the decision tables their gateways compute from."
        },
        {
          "type": "string",
          "const": "models",
          "description": "A Subgraph describing the language models an Actor may be: which languages each is good at, and whether a person checked."
        },
        {
          "type": "string",
          "minLength": 1,
          "description": "A Graph Typology a Harness defines. To a reader that knows only bootstrap it is an Extension: A field of a Declaration, or of one of its entries, that is not defined here. A reader that does not recognise the field ignores it, and the rest of the Declaration keeps its meaning."
        }
      ],
      "description": "A named set of Node Kinds.",
      "uses": [
        "NodeKind"
      ],
      "isDefinedBy": "#/$defs/GraphTypology"
    },
    "Declaration": {
      "title": "Declaration",
      "description": "A JSON document, `<name>.json`, that gives a name and lists directory entries and file entries.",
      "uses": [],
      "isDefinedBy": "#"
    },
    "Extension": {
      "title": "Extension",
      "description": "A field of a Declaration, or of one of its entries, that is not defined here. A reader that does not recognise the field ignores it, and the rest of the Declaration keeps its meaning.",
      "uses": [
        "Declaration"
      ],
      "isDefinedBy": "#/$defs/Extension"
    },
    "Subgraph": {
      "title": "Subgraph",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "description": "The Subgraph's name, unique within its Knowledge Graph."
        },
        "path": {
          "type": "string",
          "minLength": 1,
          "description": "The directory, relative to the declaration."
        },
        "graphTypologies": {
          "minItems": 1,
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "const": "skills",
                "description": "A Subgraph of Skills: the instructions an Actor follows to carry out a Task."
              },
              {
                "type": "string",
                "const": "schemas",
                "description": "A Subgraph of Node Schemas: files that state the shape other files must have."
              },
              {
                "type": "string",
                "const": "scenarios",
                "description": "A Subgraph of Roles: the responsibilities an Actor takes on, and who takes them on."
              },
              {
                "type": "string",
                "const": "processes",
                "description": "A Subgraph of Processes: BPMN diagrams that coordinate Tasks, and the decision tables their gateways compute from."
              },
              {
                "type": "string",
                "const": "models",
                "description": "A Subgraph describing the language models an Actor may be: which languages each is good at, and whether a person checked."
              },
              {
                "type": "string",
                "minLength": 1,
                "description": "A Graph Typology a Harness defines. To a reader that knows only bootstrap it is an Extension: A field of a Declaration, or of one of its entries, that is not defined here. A reader that does not recognise the field ignores it, and the rest of the Declaration keeps its meaning."
              }
            ],
            "description": "A named set of Node Kinds."
          },
          "description": "The Graph Typologies it holds."
        },
        "title": {
          "description": "A short name for people, shown as its README's heading.",
          "type": "string"
        },
        "description": {
          "description": "What it holds, in a sentence or two, shown under that heading.",
          "type": "string"
        }
      },
      "required": [
        "id",
        "path",
        "graphTypologies"
      ],
      "additionalProperties": {},
      "description": "A directory entry of a Declaration: an id, a directory, and the Graph Typologies its Node Instances' kinds belong to.",
      "uses": [
        "Declaration",
        "GraphTypology",
        "NodeInstance"
      ],
      "isDefinedBy": "#/$defs/Subgraph"
    },
    "Asset": {
      "title": "Asset",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "src": {
          "type": "string",
          "minLength": 1,
          "description": "The file, relative to the declaration."
        },
        "role": {
          "type": "string",
          "minLength": 1,
          "description": "The part the file plays, such as `instance-readme`."
        }
      },
      "required": [
        "id",
        "src",
        "role"
      ],
      "additionalProperties": {},
      "description": "A file entry of a Declaration: one file about the repository itself, whose `role` field says what it is for.",
      "uses": [
        "Declaration"
      ],
      "isDefinedBy": "#/$defs/Asset"
    },
    "KnowledgeGraph": {
      "title": "KnowledgeGraph",
      "description": "The Node Schemas, Node Instances and Assets one Declaration lists, as of one version of the repository. Published as JSON-LD, the statements of each Subgraph's Node Instances form one named graph.",
      "uses": [
        "NodeSchema",
        "NodeInstance",
        "Asset",
        "Declaration",
        "Subgraph"
      ],
      "isDefinedBy": "#"
    },
    "Dependency": {
      "title": "Dependency",
      "type": "string",
      "minLength": 1,
      "description": "A Declaration's `needs` entry naming another Knowledge Graph. References may point from this graph's Node Instances into the named one, never back.",
      "uses": [
        "Declaration",
        "KnowledgeGraph",
        "Reference",
        "NodeInstance"
      ],
      "isDefinedBy": "#/$defs/Dependency"
    },
    "Content": {
      "title": "Content",
      "description": "Node Instances that describe the subject matter of a Knowledge Graph, such as records, documents, catalogues and their terms, rather than how to work with it.",
      "uses": [
        "NodeInstance",
        "KnowledgeGraph"
      ],
      "isDefinedBy": "#/$defs/Content"
    },
    "Task": {
      "title": "Task",
      "description": "A unit of work, stated by what it needs to begin and what it produces.",
      "uses": [],
      "isDefinedBy": "https://www.omg.org/spec/BPMN/2.0/#task"
    },
    "Actor": {
      "title": "Actor",
      "description": "A person, an agent or a program that can carry out Tasks.",
      "uses": [
        "Task"
      ],
      "isDefinedBy": "http://www.w3.org/ns/prov#Agent"
    },
    "Skill": {
      "title": "Skill",
      "description": "A Node Instance stating a responsibility an Actor carries out to complete a Task: as natural-language instructions to follow, as a contract to be tested against, or both.",
      "uses": [
        "NodeInstance",
        "Actor",
        "Task"
      ],
      "isDefinedBy": "#/$defs/Skill"
    },
    "Role": {
      "title": "Role",
      "description": "A Node Instance naming a part an Actor takes on to carry out Tasks, and listing the Skills that part needs.",
      "uses": [
        "NodeInstance",
        "Actor",
        "Task",
        "Skill"
      ],
      "isDefinedBy": "#/$defs/Role"
    },
    "ProcessNode": {
      "title": "ProcessNode",
      "description": "A BPMN flow node: an activity (a task or call activity), a gateway, or an event.",
      "uses": [],
      "isDefinedBy": "https://www.omg.org/spec/BPMN/2.0/#flowNode"
    },
    "SequenceFlow": {
      "title": "SequenceFlow",
      "description": "A directed connection in a BPMN process from one Process Node to the next.",
      "uses": [
        "ProcessNode"
      ],
      "isDefinedBy": "https://www.omg.org/spec/BPMN/2.0/#sequenceFlow"
    },
    "Process": {
      "title": "Process",
      "description": "A Node Instance holding a BPMN process that coordinates Tasks: its Process Nodes, joined by Sequence Flows, sit in lanes that each name a Role.",
      "uses": [
        "NodeInstance",
        "Task",
        "ProcessNode",
        "SequenceFlow",
        "Role"
      ],
      "isDefinedBy": "https://www.omg.org/spec/BPMN/2.0/#process"
    },
    "Harness": {
      "title": "Harness",
      "description": "A Knowledge Graph whose Subgraphs hold Skills, Roles or Processes: what an Actor uses to work with a Knowledge Graph, including itself.",
      "uses": [
        "KnowledgeGraph",
        "Subgraph",
        "Skill",
        "Role",
        "Process",
        "Actor"
      ],
      "isDefinedBy": "#"
    }
  }
}
