{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:altium-monkey:schema:compiled_schematic_graph_a0",
  "type": "object",
  "properties": {
    "schema": {
      "type": "string",
      "const": "altium_monkey.compiled_schematic_graph.a0"
    },
    "type": {
      "type": "string",
      "const": "sch.compiled_schematic_graph"
    },
    "identity_namespace": {
      "type": "string",
      "const": "sch.compiled_schematic_graph.a0"
    },
    "unit_definitions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GraphUnitDefinition"
      }
    },
    "page_definitions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GraphPageDefinition"
      }
    },
    "unit_occurrences": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GraphUnitOccurrence"
      }
    },
    "page_occurrences": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GraphPageOccurrence"
      }
    },
    "hierarchy_occurrences": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GraphHierarchyOccurrence"
      }
    },
    "component_occurrences": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GraphComponentOccurrence"
      }
    },
    "local_net_occurrences": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GraphLocalNetOccurrence"
      }
    },
    "terminal_occurrences": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GraphTerminalOccurrence"
      }
    },
    "hierarchy_terminal_bindings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GraphHierarchyTerminalBinding"
      }
    },
    "graphical_artifact_links": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GraphGraphicalArtifactLink"
      }
    }
  },
  "required": [
    "schema",
    "type",
    "identity_namespace",
    "unit_definitions",
    "page_definitions",
    "unit_occurrences",
    "page_occurrences",
    "hierarchy_occurrences",
    "component_occurrences",
    "local_net_occurrences",
    "terminal_occurrences",
    "hierarchy_terminal_bindings",
    "graphical_artifact_links"
  ],
  "unevaluatedProperties": {
    "not": {}
  },
  "description": "Standalone compiled schematic graph a0 transport.",
  "title": "Altium Monkey compiled schematic graph a0",
  "$defs": {
    "GraphUnitDefinition": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "sch.unit_definition"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "display_name": {
          "type": "string"
        },
        "page_definition_refs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "source_identity": {
          "$ref": "#/$defs/GraphSourceIdentity"
        }
      },
      "required": [
        "type",
        "id",
        "display_name",
        "page_definition_refs",
        "source_identity"
      ],
      "unevaluatedProperties": {
        "not": {}
      }
    },
    "GraphPageDefinition": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "sch.page_definition"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "unit_definition_ref": {
          "type": "string",
          "minLength": 1
        },
        "display_name": {
          "type": "string"
        },
        "source_identity": {
          "$ref": "#/$defs/GraphSourceIdentity"
        }
      },
      "required": [
        "type",
        "id",
        "unit_definition_ref",
        "display_name",
        "source_identity"
      ],
      "unevaluatedProperties": {
        "not": {}
      }
    },
    "GraphUnitOccurrence": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "sch.unit_occurrence"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "unit_definition_ref": {
          "type": "string",
          "minLength": 1
        },
        "display_name": {
          "type": "string"
        },
        "page_occurrence_refs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "parent_hierarchy_occurrence_ref": {
          "type": "string",
          "minLength": 1
        },
        "source_identity": {
          "$ref": "#/$defs/GraphSourceIdentity"
        }
      },
      "required": [
        "type",
        "id",
        "unit_definition_ref",
        "display_name",
        "page_occurrence_refs",
        "source_identity"
      ],
      "unevaluatedProperties": {
        "not": {}
      }
    },
    "GraphPageOccurrence": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "sch.page_occurrence"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "page_definition_ref": {
          "type": "string",
          "minLength": 1
        },
        "unit_occurrence_ref": {
          "type": "string",
          "minLength": 1
        },
        "display_name": {
          "type": "string"
        },
        "sheet_number": {
          "type": "string"
        },
        "instance_order": {
          "$ref": "#/$defs/SignedInt64"
        },
        "source_identity": {
          "$ref": "#/$defs/GraphSourceIdentity"
        }
      },
      "required": [
        "type",
        "id",
        "page_definition_ref",
        "unit_occurrence_ref",
        "display_name",
        "sheet_number",
        "instance_order",
        "source_identity"
      ],
      "unevaluatedProperties": {
        "not": {}
      }
    },
    "GraphHierarchyOccurrence": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "sch.hierarchy_occurrence"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "parent_unit_occurrence_ref": {
          "type": "string",
          "minLength": 1
        },
        "parent_page_occurrence_ref": {
          "type": "string",
          "minLength": 1
        },
        "child_unit_occurrence_ref": {
          "type": "string",
          "minLength": 1
        },
        "source_identity": {
          "$ref": "#/$defs/GraphSourceIdentity"
        }
      },
      "required": [
        "type",
        "id",
        "parent_unit_occurrence_ref",
        "parent_page_occurrence_ref",
        "child_unit_occurrence_ref",
        "source_identity"
      ],
      "unevaluatedProperties": {
        "not": {}
      }
    },
    "GraphComponentOccurrence": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "sch.component_occurrence"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "page_occurrence_ref": {
          "type": "string",
          "minLength": 1
        },
        "source_designator": {
          "type": "string"
        },
        "physical_designator": {
          "type": "string"
        },
        "display_designator": {
          "type": "string"
        },
        "unit": {
          "$ref": "#/$defs/SignedInt64"
        },
        "body_style": {
          "$ref": "#/$defs/SignedInt64"
        },
        "source_identity": {
          "$ref": "#/$defs/GraphSourceIdentity"
        }
      },
      "required": [
        "type",
        "id",
        "page_occurrence_ref",
        "source_designator",
        "physical_designator",
        "display_designator",
        "unit",
        "body_style",
        "source_identity"
      ],
      "unevaluatedProperties": {
        "not": {}
      }
    },
    "GraphLocalNetOccurrence": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "sch.local_net_occurrence"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "page_occurrence_ref": {
          "type": "string",
          "minLength": 1
        },
        "display_name": {
          "type": "string"
        },
        "qualified_name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "source_identity": {
          "$ref": "#/$defs/GraphSourceIdentity"
        }
      },
      "required": [
        "type",
        "id",
        "page_occurrence_ref",
        "display_name",
        "qualified_name",
        "aliases",
        "source_identity"
      ],
      "unevaluatedProperties": {
        "not": {}
      }
    },
    "GraphTerminalOccurrence": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "sch.terminal_occurrence"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "page_occurrence_ref": {
          "type": "string",
          "minLength": 1
        },
        "local_net_occurrence_ref": {
          "type": "string",
          "minLength": 1
        },
        "component_occurrence_ref": {
          "type": "string",
          "minLength": 1
        },
        "design_component_pin_ref": {
          "type": "string"
        },
        "design_net_ref": {
          "type": "string"
        },
        "role": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "pin_designator": {
          "type": "string"
        },
        "resolution_diagnostics": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "source_identity": {
          "$ref": "#/$defs/GraphSourceIdentity"
        }
      },
      "required": [
        "type",
        "id",
        "page_occurrence_ref",
        "local_net_occurrence_ref",
        "role",
        "name",
        "pin_designator",
        "resolution_diagnostics",
        "source_identity"
      ],
      "unevaluatedProperties": {
        "not": {}
      }
    },
    "GraphHierarchyTerminalBinding": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "sch.hierarchy_terminal_binding"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "hierarchy_occurrence_ref": {
          "type": "string",
          "minLength": 1
        },
        "parent_terminal_occurrence_ref": {
          "type": "string",
          "minLength": 1
        },
        "child_terminal_occurrence_ref": {
          "type": "string",
          "minLength": 1
        },
        "design_net_ref": {
          "type": "string"
        },
        "source_identity": {
          "$ref": "#/$defs/GraphSourceIdentity"
        }
      },
      "required": [
        "type",
        "id",
        "hierarchy_occurrence_ref",
        "parent_terminal_occurrence_ref",
        "child_terminal_occurrence_ref",
        "source_identity"
      ],
      "unevaluatedProperties": {
        "not": {}
      }
    },
    "GraphGraphicalArtifactLink": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "sch.graphical_artifact_link"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "page_occurrence_ref": {
          "type": "string",
          "minLength": 1
        },
        "target_type": {
          "type": "string"
        },
        "target_ref": {
          "type": "string",
          "minLength": 1
        },
        "artifact_key": {
          "type": "string",
          "const": "sch.dwg_scene"
        },
        "element_id": {
          "type": "string",
          "minLength": 1
        },
        "source_identity": {
          "$ref": "#/$defs/GraphSourceIdentity"
        }
      },
      "required": [
        "type",
        "id",
        "page_occurrence_ref",
        "target_type",
        "target_ref",
        "artifact_key",
        "element_id",
        "source_identity"
      ],
      "unevaluatedProperties": {
        "not": {}
      }
    },
    "GraphSourceIdentity": {
      "type": "object",
      "properties": {},
      "unevaluatedProperties": {
        "$ref": "#/$defs/GraphSourceIdentityValue"
      },
      "minProperties": 1,
      "description": "Non-empty structural identity evidence; semantic identity remains handwritten."
    },
    "SignedInt64": {
      "type": "integer",
      "description": "Signed 64-bit JSON integer shared by schema and Rust boundaries.",
      "x-altium-monkey-signed-integer-width": 64,
      "minimum": -9223372036854775808,
      "maximum": 9223372036854775807
    },
    "GraphSourceIdentityValue": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/$defs/SignedInt64"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "array",
          "items": {}
        }
      ],
      "description": "Structurally admitted value in a compiled-graph source identity map."
    }
  }
}
