Skip to main content

JSON Schema

The Graph API responses conform to a JSON Schema. You can retrieve the current schema from the API.

Get Schema

curl -X GET "https://api.example.com/graph/schema/1"

Schema Overview

The schema defines the structure of the pid_graph object:

pid_graph
├── nodes[]
│ ├── tag (string)
│ ├── id (string)
│ ├── node_type (string)
│ ├── node_classification (string)
│ ├── orig_x (number)
│ ├── orig_y (number)
│ ├── orig_bbox_width (number)
│ ├── orig_bbox_height (number)
│ └── attributes[]
│ ├── name (string)
│ ├── value (any)
│ ├── data_type (string)
│ └── description (string)

├── edges[]
│ ├── id (string)
│ ├── edge_type (string)
│ ├── edge_classification (string)
│ ├── from (node object)
│ ├── to (node object)
│ ├── orig_from_x (number)
│ ├── orig_from_y (number)
│ ├── orig_to_x (number)
│ ├── orig_to_y (number)
│ └── attributes[]

└── metadata
├── drawing_name (string)
├── job_id (string)
├── project_id (string)
├── collection_id (string)
├── unit (string)
├── area (string)
├── schema_version (string)
└── change_version (string)

Node Types

Valid values for node_type:

  • pid_component - Physical component
  • piping_network_system - Pipe system grouping
  • piping_network_segment - Single pipe segment
  • instrumentation_loop - Control loop

Edge Types

Valid values for edge_type:

  • physically_connected_to - Physical connection
  • has_a - Logical containment
  • physically_has_a - Physical containment
  • starts_at - Segment start point
  • ends_at - Segment end point
  • associated_with - Signal connection

Validation

All API responses are validated against the schema before being returned. If you receive a response, it conforms to the schema.

Schema Versioning

Schemas are versioned. When the schema changes, a new version is created. You can:

  1. Use the latest schema (default)
  2. Pin to a specific version using the X-Schema-Version header
curl -X GET "https://api.example.com/graph/123" \
-H "X-Schema-Version: 1"

See Versions for more details.