Edges
Edges represent connections and relationships between nodes in the P&ID graph.
Edge Types
| Edge Type | Description | Connects |
|---|---|---|
physically_connected_to | Physical piping connection | Component ↔ Component |
has_a | Logical containment/membership | Parent → Child |
physically_has_a | Physical containment | Equipment → Equipment Component |
starts_at | Where a pipe segment begins | PNSG → First Component |
ends_at | Where a pipe segment ends | PNSG → Last Component |
associated_with | Signal/control connection | Instrument ↔ Control Unit |
Relationships Overview
┌─────────────────────────────────────────────────────────────────┐
│ PIPING HIERARCHY │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Piping Network System (PNS) │
│ │ │
│ │ has_a │
│ ▼ │
│ Piping Network Segment (PNSG) │
│ │ │
│ ├── has_a ──────► Components (valves, reducers, tees) │
│ │ │
│ ├── starts_at ──► First Component in segment │
│ │ │
│ └── ends_at ────► Last Component in segment │
│ │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ PHYSICAL CONNECTIONS │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Component ◄── physically_connected_to ──► Component │
│ │
│ Example: Valve ──physically_connected_to──► Reducer │
│ │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ INSTRUMENTATION │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Instrumentation Loop │
│ │ │
│ │ has_a │
│ ▼ │
│ Instruments (transmitters, indicators, controllers) │
│ │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ EQUIPMENT │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Equipment (Pump, Vessel, Heat Exchanger) │
│ │ │
│ │ physically_has_a │
│ ▼ │
│ Equipment Components (Nozzles) │
│ │
└─────────────────────────────────────────────────────────────────┘
Edge Structure
Every edge has these fields:
{
"id": "edge-456",
"edge_type": "physically_connected_to",
"edge_classification": "process_line.secondary_process_line",
"from": {
"tag": "FV-101",
"id": "abc-123",
"node_type": "pid_component",
"node_classification": "piping_component.gate_valve"
},
"to": {
"tag": "R-001",
"id": "def-456",
"node_type": "pid_component",
"node_classification": "piping_component.reducer"
},
"orig_from_x": 100.0,
"orig_from_y": 200.0,
"orig_to_x": 300.0,
"orig_to_y": 200.0,
"attributes": [...]
}
| Field | Description |
|---|---|
id | Unique edge identifier |
edge_type | Type of relationship (see table above) |
edge_classification | Specific classification |
from | Source node (embedded node object) |
to | Target node (embedded node object) |
orig_from_x, orig_from_y | Start coordinates on drawing |
orig_to_x, orig_to_y | End coordinates on drawing |
attributes | Additional properties |
Edge Classifications
| Classification | Edge Type | Description |
|---|---|---|
process_line.secondary_process_line | physically_connected_to | Pipe connection |
signal_line.* | associated_with | Signal/control connection |
pns_has_pnsg | has_a | PNS contains PNSG |
pnsg_has_component | has_a | PNSG contains component |
loop_has_component | has_a | Loop contains instrument |
equipment_has_component | physically_has_a | Equipment contains nozzle |
pnsg.starts_at | starts_at | PNSG start point |
pnsg.ends_at | ends_at | PNSG end point |
Querying Edges
Get all physical connections
{"query": ".pid_graph.edges | filter(.edge_type == \"physically_connected_to\")"}
Get all hierarchy relationships
{"query": ".pid_graph.edges | filter(.edge_type == \"has_a\")"}
Get PNSG start/end points
{"query": ".pid_graph.edges | filter(.edge_type == \"starts_at\" or .edge_type == \"ends_at\")"}
Get equipment-component relationships
{"query": ".pid_graph.edges | filter(.edge_type == \"physically_has_a\")"}
Get edges connected to a specific node
{"query": ".pid_graph.edges | filter(.from.tag == \"FV-101\" or .to.tag == \"FV-101\")"}