pub fn validate_netrelation_references(
netelements: &[Netelement],
netrelations: &[NetRelation],
) -> Vec<String>Expand description
Validate that all netrelations reference existing netelements
Checks that from_netelement_id and to_netelement_id in each netrelation
correspond to actual netelements in the network. Returns a list of invalid
netrelation IDs that reference non-existent netelements.
This function is used to detect data quality issues where netrelations reference netelements that don’t exist (FR-006a).
§Parameters
netelements: All track segments in the networknetrelations: Navigability connections to validate
§Returns
A vector of netrelation IDs that have invalid references. Empty if all are valid.
§Examples
use tp_lib_core::path::validate_netrelation_references;
use tp_lib_core::models::{Netelement, NetRelation};
let netelements = vec![/* ... */];
let netrelations = vec![/* ... */];
let invalid = validate_netrelation_references(&netelements, &netrelations);
if !invalid.is_empty() {
eprintln!("Warning: {} netrelations reference non-existent netelements", invalid.len());
}