D3FEND CAD Data Schema

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "D3FEND CAD Graph Schema",
  "type": "object",
  "properties": {
    "meta": {
      "type": "object",
      "title": "Meta",
      "properties": {
        "title": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "orgs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "description": {
          "type": "string"
        },
        "article": {
          "type": "string"
        },
        "d3fend_version": {
          "type": "string"
        },
        "cad_schema_version": {
          "type": "number"
        },
        "published_date": {
          "type": "string",
          "format": "date-time"
        },
        "references": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "settings": {
          "type": "object",
          "properties": {},
          "required": []
        }
      },
      "required": [
        "title",
        "authors",
        "description",
        "article",
        "d3fend_version",
        "cad_schema_version",
        "published_date"
      ],
      "additionalProperties": false
    },
    "nodes": {
      "type": "array",
      "items": {
        "type": "object",
        "title": "CADNode",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "event-node",
              "attack-node",
              "countermeasure-node",
              "artifact-node",
              "agent-node",
              "vulnerability-node",
              "condition-node",
              "note-node",
              "thing-node"
            ]
          },
          "position": {
            "type": "object",
            "title": "Position",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          },
          "data": {
            "type": "object",
            "title": "NodeData",
            "properties": {
              "label": {
                "type": "string"
              },
              "sequence": {
                "type": "string"
              },
              "d3f_class": {
                "type": "string"
              },
              "user_properties": {
                "type": "array",
                "items": {
                  "type": "array",
                  "title": "UserProperty",
                  "items": {
                    "type": "string",
                    "default": ""
                  }
                }
              }
            },
            "required": [
              "label",
              "sequence",
              "user_properties"
            ],
            "additionalProperties": false
          },
          "origin": {
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "measured": {
            "type": "object",
            "title": "Measured",
            "properties": {
              "width": {
                "type": "number"
              },
              "height": {
                "type": "number"
              }
            },
            "required": [
              "width",
              "height"
            ],
            "additionalProperties": false
          },
          "selected": {
            "type": "boolean"
          },
          "dragging": {
            "type": "boolean"
          },
          "width": {
            "type": "number"
          },
          "height": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "type",
          "position",
          "data",
          "origin",
          "measured",
          "selected",
          "dragging"
        ]
      }
    },
    "edges": {
      "type": "array",
      "items": {
        "type": "object",
        "title": "Edge",
        "properties": {
          "type": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "title": "EdgeData",
            "properties": {
              "label": {
                "type": "string"
              },
              "d3f_property": {
                "type": "string"
              }
            },
            "required": [
              "label"
            ],
            "additionalProperties": false
          },
          "markerEnd": {
            "type": "object",
            "title": "MarkerEnd",
            "properties": {
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          "source": {
            "type": "string"
          },
          "sourceHandle": {
            "type": "string"
          },
          "target": {
            "type": "string"
          },
          "targetHandle": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "selected": {
            "type": "boolean"
          }
        },
        "required": [
          "source",
          "sourceHandle",
          "target",
          "targetHandle",
          "id",
          "selected"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "meta",
    "nodes",
    "edges"
  ],
  "additionalProperties": false
}