Skip to main content

Asset Hierarchy

CorrData organizes pipeline assets in a hierarchical structure:
Tenant
└── Pipeline
    └── Segment
        ├── Test Station
        ├── Rectifier
        └── Equipment

Core Entities

Tenant

The top-level isolation boundary. Each operator has their own tenant with complete data separation.
class Tenant:
    id: UUID
    name: str
    domain: str
    settings: dict
    created_at: datetime

Pipeline

A named pipeline system operated by the tenant.
class Pipeline:
    id: UUID
    tenant_id: UUID
    name: str
    external_id: str  # GIS system reference
    operator: str
    product_type: str  # gas, oil, water
    geometry: LineString  # PostGIS geometry
    attributes: dict

Segment

A section of pipeline with consistent characteristics.
class Segment:
    id: UUID
    pipeline_id: UUID
    name: str
    external_id: str
    start_mp: float  # Mile post start
    end_mp: float    # Mile post end
    diameter_inches: float
    wall_thickness: float
    material: str
    coating_type: str
    install_date: date
    geometry: LineString
    attributes: dict

Test Station

A monitoring point for cathodic protection readings.
class TestStation:
    id: UUID
    segment_id: UUID
    name: str
    external_id: str
    station_type: str  # standard, reference, gradient
    mile_post: float
    geometry: Point
    attributes: dict

Rectifier

Equipment that provides cathodic protection current.
class Rectifier:
    id: UUID
    segment_id: UUID
    name: str
    external_id: str
    manufacturer: str
    model: str
    rated_output_amps: float
    rated_output_volts: float
    install_date: date
    geometry: Point
    attributes: dict

Measurement Model

Time-Series Data

Measurements are stored in TimescaleDB hypertables for efficient time-series queries.
class Measurement:
    id: UUID
    asset_id: UUID
    asset_type: str
    measurement_type: str
    value: float
    unit: str
    recorded_at: datetime
    recorded_by: UUID
    source: str  # manual, automated, import
    quality: str  # good, suspect, bad
    metadata: dict

Measurement Types

TypeUnitDescription
pipe_to_soil_potentialmVP/S potential reading
rectifier_currentARectifier output current
rectifier_voltageVRectifier output voltage
ac_voltageVAC interference voltage
soil_resistivityohm-cmSoil resistivity
coating_resistanceohm/ft²Coating resistance

Relationship Model

CorrData uses Neo4j to model complex relationships between assets.

Relationship Types

// Protection relationship
(rectifier:Asset)-[:PROTECTS]->(segment:Asset)

// Monitoring relationship
(test_station:Asset)-[:MONITORS]->(segment:Asset)

// Location relationship
(segment:Asset)-[:PART_OF]->(pipeline:Asset)

// Interference relationship
(segment:Asset)-[:INTERFERES_WITH]->(other_segment:Asset)

Graph Queries

Find all assets protecting a segment:
MATCH (a:Asset)-[:PROTECTS]->(s:Asset {id: $segment_id})
RETURN a
Find cascade impact of rectifier failure:
MATCH (r:Asset {id: $rectifier_id})-[:PROTECTS*1..3]->(affected:Asset)
RETURN affected

Event Model

Event Types

class Event:
    id: UUID
    asset_id: UUID
    event_type: str
    severity: str  # info, warning, critical
    title: str
    description: str
    occurred_at: datetime
    resolved_at: datetime
    metadata: dict
Event TypeDescription
threshold_violationMeasurement outside acceptable range
anomaly_detectedUnusual pattern detected by analytics
equipment_alarmEquipment reported an alarm condition
compliance_deadlineUpcoming or missed compliance deadline
maintenance_dueScheduled maintenance approaching

External Corrosion Factors

CorrData models external corrosion risk factors that affect pipeline integrity.

Soil Chemistry

class SoilChemistry:
    asset_id: UUID
    ph: float
    chloride_ppm: float
    sulfate_ppm: float
    resistivity: float
    moisture_percent: float
    redox_potential: float
    sample_date: date
    sample_location: Point

Geology

class GeologyFactor:
    asset_id: UUID
    soil_type: str
    corrosivity_class: str
    drainage_rating: str
    rock_presence: bool
    groundwater_depth: float

Interference

class InterferenceFactor:
    asset_id: UUID
    interference_type: str  # AC, DC, telluric
    source_description: str
    distance_to_source: float
    measured_current: float
    mitigation_installed: bool

Data Retention

Data TypeRetentionArchive
Asset MetadataForeverN/A
Measurements7 years onlineCold storage
Events3 years onlineCold storage
Audit Logs10 yearsCompliance archive
Retention periods are configurable per tenant to meet specific regulatory requirements.