{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "A task graph from the Sciline package (https://scipp.github.io/sciline/).",
  "properties": {
    "directed": {
      "description": "Indicates whether the graph is directed. Always true in Sciline.",
      "type": "boolean"
    },
    "edges": {
      "description": "Array of directed edges in the graph.",
      "items": {
        "description": "A directed edge that connects from 'source' to 'target'.",
        "properties": {
          "id": {
            "description": "Unique id of the edge.",
            "type": "string"
          },
          "source": {
            "description": "Id of the source node of the edge.",
            "type": "string"
          },
          "target": {
            "description": "Id of the target node of the edge.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "source",
          "target"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "multigraph": {
      "description": "Indicates whether the graph has multi-edges. Always false in Sciline.",
      "type": "boolean"
    },
    "nodes": {
      "description": "Array of nodes in the graph.",
      "items": {
        "allOf": [
          {
            "if": {
              "properties": {
                "kind": {
                  "const": "function"
                }
              }
            },
            "then": {
              "properties": {
                "args": {
                  "description": "Ids of edges that connect to the positional arguments of this function in the order of the function arguments.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "function": {
                  "description": "Fully qualified name of the function that implements this node.",
                  "type": "string"
                },
                "kwargs": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "description": "Edges that connect to the keyword arguments of this function where the property name is the argument name and the property value an edge id.",
                  "type": "object"
                }
              },
              "required": [
                "function",
                "args",
                "kwargs"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "kind": {
                  "const": "data"
                }
              }
            },
            "then": {
              "properties": {
                "type": {
                  "description": "Fully qualified name of the Python (domain) type representing this node.",
                  "type": "string"
                }
              },
              "required": [
                "type"
              ]
            }
          }
        ],
        "description": "A node in the graph",
        "properties": {
          "id": {
            "description": "Unique id of the node.",
            "type": "string"
          },
          "kind": {
            "description": "Indicates what kind of object the node represents. Determines the schema of the node.",
            "enum": [
              "function",
              "data"
            ],
            "type": "string"
          },
          "label": {
            "description": "Human-readable label; not necessarily unique.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "kind"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "directed",
    "edges",
    "multigraph",
    "nodes"
  ],
  "title": "Sciline task graph",
  "type": "object"
}