Skip to main content

Edges

Edges represent connections and relationships between nodes in the P&ID graph.

Edge Types

Edge TypeDescriptionConnects
physically_connected_toPhysical piping connectionComponent ↔ Component
has_aLogical containment/membershipParent → Child
physically_has_aPhysical containmentEquipment → Equipment Component
starts_atWhere a pipe segment beginsPNSG → First Component
ends_atWhere a pipe segment endsPNSG → Last Component
associated_withSignal/control connectionInstrument ↔ 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": [...]
}
FieldDescription
idUnique edge identifier
edge_typeType of relationship (see table above)
edge_classificationSpecific classification
fromSource node (embedded node object)
toTarget node (embedded node object)
orig_from_x, orig_from_yStart coordinates on drawing
orig_to_x, orig_to_yEnd coordinates on drawing
attributesAdditional properties

Edge Classifications

ClassificationEdge TypeDescription
process_line.secondary_process_linephysically_connected_toPipe connection
signal_line.*associated_withSignal/control connection
pns_has_pnsghas_aPNS contains PNSG
pnsg_has_componenthas_aPNSG contains component
loop_has_componenthas_aLoop contains instrument
equipment_has_componentphysically_has_aEquipment contains nozzle
pnsg.starts_atstarts_atPNSG start point
pnsg.ends_atends_atPNSG 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\")"}