{
  "$defs": {
    "ComponentTypeId": {
      "$ref": "#/$defs/NamespacedType"
    },
    "ComponentTypeIds": {
      "items": {
        "$ref": "#/$defs/ComponentTypeId"
      },
      "type": "array"
    },
    "EntityInstance": {
      "$id": "https://schema.reactive-graph.io/schema/json/entity-instance.schema.json",
      "$ref": "#/$defs/NamespacedType",
      "description": "Entity instances represents an typed object which contains properties.\n\nThe entity type defines the properties (name, data type and socket type).\n\nIn contrast to the entity type the entity instance stores values in its\nproperties.",
      "properties": {
        "$id": {
          "default": "https://schema.reactive-graph.io/schema/json/entity-instance.schema.json",
          "description": "The schema identifier",
          "type": "string"
        },
        "components": {
          "$ref": "#/$defs/ComponentTypeIds",
          "default": [],
          "description": "The components of the entity instance."
        },
        "description": {
          "default": "",
          "description": "The description of the entity instance.",
          "type": "string"
        },
        "extensions": {
          "$ref": "#/$defs/Extensions",
          "default": [],
          "description": "Entity instance specific extensions."
        },
        "id": {
          "description": "The unique identifier of the entity instance.",
          "format": "uuid",
          "type": "string"
        },
        "name": {
          "default": "",
          "description": "The name of the entity instance.",
          "type": "string"
        },
        "properties": {
          "$ref": "#/$defs/PropertyInstances",
          "default": {},
          "description": "The properties of the entity instance.\n\nEach property is represented by its name (String) and it's value. The value is\na representation of a JSON. Therefore, the value can be boolean, number, string,\narray or an object. For more information about the data types please look at\n<https://docs.serde.rs/serde_json/value/enum.Value.html>"
        }
      },
      "required": [
        "id"
      ],
      "title": "EntityInstance",
      "type": "object",
      "unevaluatedProperties": false
    },
    "EntityInstances": {
      "description": "Entity Instances",
      "items": {
        "$ref": "#/$defs/EntityInstance"
      },
      "type": "array"
    },
    "Extension": {
      "$ref": "#/$defs/NamespacedType",
      "description": "Extension on a type. The extension allows to extend information",
      "properties": {
        "description": {
          "default": "",
          "description": "Textual description of the extension.",
          "type": "string"
        },
        "extension": {
          "description": "The extension as JSON representation."
        }
      },
      "required": [
        "extension"
      ],
      "type": "object"
    },
    "Extensions": {
      "description": "Extensions",
      "items": {
        "$ref": "#/$defs/Extension"
      },
      "type": "array"
    },
    "NamespacedType": {
      "description": "Defines the namespace and the name of a type.",
      "properties": {
        "namespace": {
          "description": "The namespace of the type.",
          "type": "string"
        },
        "type_name": {
          "description": "The name of the type.",
          "type": "string"
        }
      },
      "required": [
        "namespace",
        "type_name"
      ],
      "type": "object"
    },
    "PropertyInstances": {
      "description": "Properties",
      "type": "object"
    },
    "PropertyType": {
      "additionalProperties": false,
      "description": "Definition of a property. The definition contains\nthe name of the property, the data type and the socket\ntype.",
      "properties": {
        "data_type": {
          "description": "The data type of the property",
          "oneOf": [
            {
              "const": "null",
              "description": "Represents a JSON null value.",
              "type": "string"
            },
            {
              "const": "bool",
              "description": "Represents a JSON boolean.",
              "type": "string"
            },
            {
              "const": "number",
              "description": "Represents a JSON number, whether integer or floating point.",
              "type": "string"
            },
            {
              "const": "string",
              "description": "Represents a JSON string.",
              "type": "string"
            },
            {
              "const": "array",
              "description": "Represents a JSON array.",
              "type": "string"
            },
            {
              "const": "object",
              "description": "Represents a JSON object.",
              "type": "string"
            },
            {
              "const": "any",
              "description": "Represents any type (relations).",
              "type": "string"
            }
          ]
        },
        "description": {
          "default": "",
          "description": "The description of the property.",
          "type": "string"
        },
        "extensions": {
          "$ref": "#/$defs/Extensions",
          "default": [],
          "description": "Property specific extensions"
        },
        "mutability": {
          "default": "mutable",
          "description": "Specifies if the property is mutable.",
          "oneOf": [
            {
              "const": "mutable",
              "description": "The property is mutable.",
              "type": "string"
            },
            {
              "const": "immutable",
              "description": "The property is immutable.",
              "type": "string"
            }
          ]
        },
        "name": {
          "description": "The name of the property",
          "type": "string"
        },
        "socket_type": {
          "default": "none",
          "description": "Specifies the type of socket - either input socket or output socket or none",
          "oneOf": [
            {
              "const": "none",
              "description": "The property doesn't act as input or output socket.",
              "type": "string"
            },
            {
              "const": "input",
              "description": "The property acts as input socket and accepts incoming connections.",
              "type": "string"
            },
            {
              "const": "output",
              "description": "The property acts as output socket and accepts outgoing connections.",
              "type": "string"
            }
          ]
        }
      },
      "required": [
        "name",
        "data_type"
      ],
      "type": "object"
    },
    "PropertyTypes": {
      "description": "Property Types",
      "items": {
        "$ref": "#/$defs/PropertyType"
      },
      "type": "array"
    },
    "RelationInstance": {
      "$id": "https://schema.reactive-graph.io/schema/json/relation-instance.schema.json",
      "$ref": "#/$defs/NamespacedType",
      "description": "Relation instances are edges from an outbound entity instance to an\ninbound entity instance.\n\nThe relation instance is of a relation type. The relation type defines\nthe entity types of the outbound entity instance and the inbound entity\ninstance. Furthermore, the relation type defines which properties\n(name, data type, socket type) a relation instance have to have.\n\nIn contrast to the relation type, the relation instance stores values/\ndocuments in its properties.",
      "properties": {
        "$id": {
          "default": "https://schema.reactive-graph.io/schema/json/relation-instance.schema.json",
          "description": "The schema identifier",
          "type": "string"
        },
        "components": {
          "$ref": "#/$defs/ComponentTypeIds",
          "default": [],
          "description": "The components of the entity instance."
        },
        "description": {
          "default": "",
          "description": "Textual description of the relation instance.",
          "type": "string"
        },
        "extensions": {
          "$ref": "#/$defs/Extensions",
          "default": [],
          "description": "Relation instance specific extensions."
        },
        "inbound_id": {
          "description": "The id of the inbound vertex.",
          "format": "uuid",
          "type": "string"
        },
        "instance_id": {
          "description": "The instance id.",
          "type": "string"
        },
        "name": {
          "default": "",
          "description": "The name of the relation instance.",
          "type": "string"
        },
        "outbound_id": {
          "description": "The id of the outbound vertex.",
          "format": "uuid",
          "type": "string"
        },
        "properties": {
          "$ref": "#/$defs/PropertyInstances",
          "default": {},
          "description": "The properties of then relation instance.\n\nEach property is represented by its name (String) and it's value. The value is\na representation of a JSON. Therefore, the value can be boolean, number, string,\narray or an object. For more information about the data types please look at\n<https://docs.serde.rs/serde_json/value/enum.Value.html>"
        }
      },
      "required": [
        "outbound_id",
        "instance_id",
        "inbound_id"
      ],
      "title": "RelationInstance",
      "type": "object",
      "unevaluatedProperties": false
    },
    "RelationInstances": {
      "description": "Relation Instances",
      "items": {
        "$ref": "#/$defs/RelationInstance"
      },
      "type": "array"
    }
  },
  "$id": "https://schema.reactive-graph.io/schema/json/flow-type.schema.json",
  "$ref": "#/$defs/NamespacedType",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Flow types defines the type of flow instance like a template\nfor flow instances.\n\nThey contain entity instances and relation instances. The wrapper\nentity instance is mandatory and used for input and outputs.",
  "properties": {
    "$id": {
      "default": "https://schema.reactive-graph.io/schema/json/flow-type.schema.json",
      "description": "The schema identifier",
      "type": "string"
    },
    "description": {
      "default": "",
      "description": "Textual description of the flow type.",
      "type": "string"
    },
    "entity_instances": {
      "$ref": "#/$defs/EntityInstances",
      "default": [],
      "description": "The entity instances which are contained in this flow.\n\nBy default, no entity instances are contained in this flow type."
    },
    "extensions": {
      "$ref": "#/$defs/Extensions",
      "default": [],
      "description": "Flow type specific extensions."
    },
    "relation_instances": {
      "$ref": "#/$defs/RelationInstances",
      "default": [],
      "description": "The relation instances which are contained in this flow.\n\nBy default, no relation instances are contained in this flow type."
    },
    "variables": {
      "$ref": "#/$defs/PropertyTypes",
      "default": [],
      "description": "The variables. Variables will be replaced by instantiation of a flow instance.\n\nBy default, the flow type has no variables."
    },
    "wrapper_entity_instance": {
      "$ref": "#/$defs/EntityInstance",
      "description": "The wrapper entity instance."
    }
  },
  "required": [
    "wrapper_entity_instance"
  ],
  "title": "FlowType",
  "type": "object",
  "unevaluatedProperties": false
}