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 componentpiping_network_system- Pipe system groupingpiping_network_segment- Single pipe segmentinstrumentation_loop- Control loop
Edge Types
Valid values for edge_type:
physically_connected_to- Physical connectionhas_a- Logical containmentphysically_has_a- Physical containmentstarts_at- Segment start pointends_at- Segment end pointassociated_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:
- Use the latest schema (default)
- Pin to a specific version using the
X-Schema-Versionheader
curl -X GET "https://api.example.com/graph/123" \
-H "X-Schema-Version: 1"
See Versions for more details.