#![allow(clippy::all, dead_code, unused)]
use cimdecoder::CimDataset;
use crate::Violation;
use crate::helpers::*;
pub fn validate_p61970_600_2_equipmentboundary_ap_con_simple_shacl(dataset: &CimDataset) -> Vec<Violation> {
let mut v = Vec::new();
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_base_voltage_identified_object_name_requ_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_base_voltage_base_voltage_nominal_voltag_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_base_voltage_identified_object_descripti_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_base_voltage_identified_object_energy_id_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_base_voltage_identified_object_short_nam_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_base_voltage_identified_object_m_rid_req_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_bay_identified_object_name_required(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_bay_identified_object_energy_ident_code_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_bay_identified_object_short_name_max_count(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_bay_identified_object_description_max_count(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_bay_bay_voltage_level_required(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_bay_bay_voltage_level_has_value(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_bay_identified_object_m_rid_required(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_connectivi_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_from_end_i_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_connectivi_etc_2(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_is_exclude_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_from_end_n_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_to_end_nam_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_identified_object_name_re_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_identified_object_descrip_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_from_end_n_etc_2(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_identified_object_m_rid_r_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_is_direct_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_to_end_nam_etc_2(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_to_end_iso_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_identified_object_short_n_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_identified_object_energy_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_connectivity_node_identified_object_desc_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_connectivity_node_identified_object_shor_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_connectivity_node_identified_object_m_ri_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_connectivity_node_identified_object_ener_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_connectivity_node_connectivity_node_conn_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_connectivity_node_identified_object_name_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_connectivity_node_connectivity_node_conn_etc_2(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_energy_scheduling_type_identified_object_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_energy_scheduling_type_identified_object_etc_2(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_energy_scheduling_type_identified_object_etc_3(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_energy_scheduling_type_identified_object_etc_4(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_energy_scheduling_type_identified_object_etc_5(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_junction_equipment_equipment_container_in(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_geographical_region_identified_object_sh_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_geographical_region_identified_object_m_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_geographical_region_identified_object_na_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_geographical_region_identified_object_en_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_geographical_region_identified_object_de_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_junction_identified_object_m_rid_required(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_junction_identified_object_short_name_ma_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_junction_identified_object_name_required(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_junction_identified_object_energy_ident_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_junction_equipment_equipment_container_m_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_junction_identified_object_description_m_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_line_identified_object_description_max_c_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_line_identified_object_energy_ident_code_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_line_identified_object_short_name_max_count(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_line_line_region_has_value(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_line_identified_object_m_rid_required(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_line_line_region_max_count(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_line_identified_object_name_required(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_sub_geographical_region_identified_objec_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_sub_geographical_region_identified_objec_etc_2(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_sub_geographical_region_identified_objec_etc_3(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_sub_geographical_region_sub_geographical_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_sub_geographical_region_sub_geographical_etc_2(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_sub_geographical_region_identified_objec_etc_4(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_sub_geographical_region_identified_objec_etc_5(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_substation_identified_object_short_name_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_substation_substation_region_required(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_substation_identified_object_energy_iden_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_substation_identified_object_m_rid_required(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_substation_identified_object_name_required(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_substation_identified_object_description_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_substation_substation_region_has_value(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_identified_object_description_m_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_identified_object_name_required(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_terminal_connectivity_node_has_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_identified_object_energy_ident_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_terminal_conducting_equipment_r_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_identified_object_short_name_ma_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_terminal_conducting_equipment_h_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_terminal_connectivity_node_max_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_identified_object_m_rid_required(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_identified_object_energy_i_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_voltage_level_substation_r_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_voltage_level_base_voltage_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_voltage_level_high_voltage_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_identified_object_descript_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_voltage_level_low_voltage_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_voltage_level_base_voltage_etc_2(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_identified_object_name_req_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_identified_object_short_na_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_voltage_level_substation_h_etc(dataset));
v.extend(check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_identified_object_m_rid_re_etc(dataset));
v
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_base_voltage_identified_object_name_requ_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BaseVoltage").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::BaseVoltage>() {
Some(o) => o, None => continue,
};
if obj.base.name.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.name-cardinality".to_string(),
class: "BaseVoltage".to_string(),
property: "IdentifiedObject.name".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.name-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_base_voltage_base_voltage_nominal_voltag_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BaseVoltage").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::BaseVoltage>() {
Some(o) => o, None => continue,
};
if obj.nominal_voltage.is_none() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:BaseVoltage.nominalVoltage-cardinality".to_string(),
class: "BaseVoltage".to_string(),
property: "BaseVoltage.nominalVoltage".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "BaseVoltage.nominalVoltage-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_base_voltage_identified_object_descripti_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BaseVoltage").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.description") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.description-cardinality".to_string(),
class: "BaseVoltage".to_string(),
property: "IdentifiedObject.description".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.description-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_base_voltage_identified_object_energy_id_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BaseVoltage").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.energyIdentCodeEic") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
class: "BaseVoltage".to_string(),
property: "IdentifiedObject.energyIdentCodeEic".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_base_voltage_identified_object_short_nam_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BaseVoltage").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.shortName") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.shortName-cardinality".to_string(),
class: "BaseVoltage".to_string(),
property: "IdentifiedObject.shortName".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.shortName-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_base_voltage_identified_object_m_rid_req_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BaseVoltage").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::BaseVoltage>() {
Some(o) => o, None => continue,
};
if obj.base.m_rid.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.mRID-cardinality".to_string(),
class: "BaseVoltage".to_string(),
property: "IdentifiedObject.mRID".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.mRID-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_bay_identified_object_name_required(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Bay").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Bay>() {
Some(o) => o, None => continue,
};
if obj.base.base.base.base.name.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.name-cardinality".to_string(),
class: "Bay".to_string(),
property: "IdentifiedObject.name".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.name-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_bay_identified_object_energy_ident_code_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Bay").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.energyIdentCodeEic") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
class: "Bay".to_string(),
property: "IdentifiedObject.energyIdentCodeEic".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_bay_identified_object_short_name_max_count(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Bay").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.shortName") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.shortName-cardinality".to_string(),
class: "Bay".to_string(),
property: "IdentifiedObject.shortName".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.shortName-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_bay_identified_object_description_max_count(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Bay").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.description") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.description-cardinality".to_string(),
class: "Bay".to_string(),
property: "IdentifiedObject.description".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.description-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_bay_bay_voltage_level_required(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Bay").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Bay>() {
Some(o) => o, None => continue,
};
if obj.voltage_level.is_none() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:Bay.VoltageLevel-cardinality".to_string(),
class: "Bay".to_string(),
property: "Bay.VoltageLevel".to_string(),
message: "Missing required association.".to_string(),
severity: "sh:Violation".to_string(),
name: "Bay.VoltageLevel-cardinality".to_string(),
description: "This constraint validates the cardinality of the association at the used direction.".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_bay_bay_voltage_level_has_value(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Bay").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Bay>() {
Some(o) => o, None => continue,
};
let ref_mrid = match obj.voltage_level.as_ref() {
Some(r) => r.mrid.trim_start_matches('#'), None => continue,
};
if let Some(ref_entry) = dataset.entries.get(ref_mrid) {
let allowed: &[&str] = &["VoltageLevel"];
if !allowed.contains(&ref_entry.element.type_name()) {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:Bay.VoltageLevel-valueType".to_string(),
class: "Bay".to_string(),
property: "Bay.VoltageLevel".to_string(),
message: "One of the following does not conform: 1) The value type shall be IRI; 2) The value type shall be an instance of the class: cim:VoltageLevel".to_string(),
severity: "sh:Violation".to_string(),
name: "Bay.VoltageLevel-valueType".to_string(),
description: "This constraint validates the value type of the association at the used direction.".to_string(),
});
}
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_bay_identified_object_m_rid_required(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Bay").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Bay>() {
Some(o) => o, None => continue,
};
if obj.base.base.base.base.m_rid.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.mRID-cardinality".to_string(),
class: "Bay".to_string(),
property: "IdentifiedObject.mRID".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.mRID-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_connectivi_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BoundaryPoint").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::BoundaryPoint>() {
Some(o) => o, None => continue,
};
if obj.connectivity_node.is_none() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:BoundaryPoint.ConnectivityNode-cardinality".to_string(),
class: "BoundaryPoint".to_string(),
property: "BoundaryPoint.ConnectivityNode".to_string(),
message: "Missing required association.".to_string(),
severity: "sh:Violation".to_string(),
name: "BoundaryPoint.ConnectivityNode-cardinality".to_string(),
description: "This constraint validates the cardinality of the association at the used direction.".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_from_end_i_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BoundaryPoint").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::BoundaryPoint>() {
Some(o) => o, None => continue,
};
if obj.from_end_iso_code.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:BoundaryPoint.fromEndIsoCode-cardinality".to_string(),
class: "BoundaryPoint".to_string(),
property: "BoundaryPoint.fromEndIsoCode".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "BoundaryPoint.fromEndIsoCode-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_connectivi_etc_2(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BoundaryPoint").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::BoundaryPoint>() {
Some(o) => o, None => continue,
};
let ref_mrid = match obj.connectivity_node.as_ref() {
Some(r) => r.mrid.trim_start_matches('#'), None => continue,
};
if let Some(ref_entry) = dataset.entries.get(ref_mrid) {
let allowed: &[&str] = &["ConnectivityNode"];
if !allowed.contains(&ref_entry.element.type_name()) {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:BoundaryPoint.ConnectivityNode-valueType".to_string(),
class: "BoundaryPoint".to_string(),
property: "BoundaryPoint.ConnectivityNode".to_string(),
message: "One of the following does not conform: 1) The value type shall be IRI; 2) The value type shall be an instance of the class: cim:ConnectivityNode".to_string(),
severity: "sh:Violation".to_string(),
name: "BoundaryPoint.ConnectivityNode-valueType".to_string(),
description: "This constraint validates the value type of the association at the used direction.".to_string(),
});
}
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_is_exclude_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BoundaryPoint").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("BoundaryPoint.isExcludedFromAreaInterchange") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:BoundaryPoint.isExcludedFromAreaInterchange-cardinality".to_string(),
class: "BoundaryPoint".to_string(),
property: "BoundaryPoint.isExcludedFromAreaInterchange".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "BoundaryPoint.isExcludedFromAreaInterchange-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_from_end_n_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BoundaryPoint").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::BoundaryPoint>() {
Some(o) => o, None => continue,
};
if obj.from_end_name_tso.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:BoundaryPoint.fromEndNameTso-cardinality".to_string(),
class: "BoundaryPoint".to_string(),
property: "BoundaryPoint.fromEndNameTso".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "BoundaryPoint.fromEndNameTso-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_to_end_nam_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BoundaryPoint").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::BoundaryPoint>() {
Some(o) => o, None => continue,
};
if obj.to_end_name_tso.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:BoundaryPoint.toEndNameTso-cardinality".to_string(),
class: "BoundaryPoint".to_string(),
property: "BoundaryPoint.toEndNameTso".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "BoundaryPoint.toEndNameTso-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_identified_object_name_re_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BoundaryPoint").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::BoundaryPoint>() {
Some(o) => o, None => continue,
};
if obj.base.base.name.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.name-cardinality".to_string(),
class: "BoundaryPoint".to_string(),
property: "IdentifiedObject.name".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.name-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_identified_object_descrip_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BoundaryPoint").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.description") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.description-cardinality".to_string(),
class: "BoundaryPoint".to_string(),
property: "IdentifiedObject.description".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.description-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_from_end_n_etc_2(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BoundaryPoint").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::BoundaryPoint>() {
Some(o) => o, None => continue,
};
if obj.from_end_name.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:BoundaryPoint.fromEndName-cardinality".to_string(),
class: "BoundaryPoint".to_string(),
property: "BoundaryPoint.fromEndName".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "BoundaryPoint.fromEndName-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_identified_object_m_rid_r_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BoundaryPoint").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::BoundaryPoint>() {
Some(o) => o, None => continue,
};
if obj.base.base.m_rid.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.mRID-cardinality".to_string(),
class: "BoundaryPoint".to_string(),
property: "IdentifiedObject.mRID".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.mRID-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_is_direct_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BoundaryPoint").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("BoundaryPoint.isDirectCurrent") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:BoundaryPoint.isDirectCurrent-cardinality".to_string(),
class: "BoundaryPoint".to_string(),
property: "BoundaryPoint.isDirectCurrent".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "BoundaryPoint.isDirectCurrent-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_to_end_nam_etc_2(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BoundaryPoint").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::BoundaryPoint>() {
Some(o) => o, None => continue,
};
if obj.to_end_name.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:BoundaryPoint.toEndName-cardinality".to_string(),
class: "BoundaryPoint".to_string(),
property: "BoundaryPoint.toEndName".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "BoundaryPoint.toEndName-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_boundary_point_to_end_iso_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BoundaryPoint").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::BoundaryPoint>() {
Some(o) => o, None => continue,
};
if obj.to_end_iso_code.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:BoundaryPoint.toEndIsoCode-cardinality".to_string(),
class: "BoundaryPoint".to_string(),
property: "BoundaryPoint.toEndIsoCode".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "BoundaryPoint.toEndIsoCode-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_identified_object_short_n_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BoundaryPoint").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.shortName") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.shortName-cardinality".to_string(),
class: "BoundaryPoint".to_string(),
property: "IdentifiedObject.shortName".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.shortName-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_boundary_point_identified_object_energy_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BoundaryPoint").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.energyIdentCodeEic") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
class: "BoundaryPoint".to_string(),
property: "IdentifiedObject.energyIdentCodeEic".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_connectivity_node_identified_object_desc_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("ConnectivityNode").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.description") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.description-cardinality".to_string(),
class: "ConnectivityNode".to_string(),
property: "IdentifiedObject.description".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.description-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_connectivity_node_identified_object_shor_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("ConnectivityNode").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.shortName") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.shortName-cardinality".to_string(),
class: "ConnectivityNode".to_string(),
property: "IdentifiedObject.shortName".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.shortName-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_connectivity_node_identified_object_m_ri_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("ConnectivityNode").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::ConnectivityNode>() {
Some(o) => o, None => continue,
};
if obj.base.m_rid.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.mRID-cardinality".to_string(),
class: "ConnectivityNode".to_string(),
property: "IdentifiedObject.mRID".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.mRID-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_connectivity_node_identified_object_ener_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("ConnectivityNode").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.energyIdentCodeEic") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
class: "ConnectivityNode".to_string(),
property: "IdentifiedObject.energyIdentCodeEic".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_connectivity_node_connectivity_node_conn_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("ConnectivityNode").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::ConnectivityNode>() {
Some(o) => o, None => continue,
};
if obj.connectivity_node_container.is_none() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:ConnectivityNode.ConnectivityNodeContainer-cardinality".to_string(),
class: "ConnectivityNode".to_string(),
property: "ConnectivityNode.ConnectivityNodeContainer".to_string(),
message: "Missing required association.".to_string(),
severity: "sh:Violation".to_string(),
name: "ConnectivityNode.ConnectivityNodeContainer-cardinality".to_string(),
description: "This constraint validates the cardinality of the association at the used direction.".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_connectivity_node_identified_object_name_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("ConnectivityNode").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::ConnectivityNode>() {
Some(o) => o, None => continue,
};
if obj.base.name.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.name-cardinality".to_string(),
class: "ConnectivityNode".to_string(),
property: "IdentifiedObject.name".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.name-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_connectivity_node_connectivity_node_conn_etc_2(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("ConnectivityNode").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::ConnectivityNode>() {
Some(o) => o, None => continue,
};
let ref_mrid = match obj.connectivity_node_container.as_ref() {
Some(r) => r.mrid.trim_start_matches('#'), None => continue,
};
if let Some(ref_entry) = dataset.entries.get(ref_mrid) {
let allowed: &[&str] = &["Substation", "Line", "VoltageLevel", "Bay"];
if !allowed.contains(&ref_entry.element.type_name()) {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:ConnectivityNode.ConnectivityNodeContainer-valueType".to_string(),
class: "ConnectivityNode".to_string(),
property: "ConnectivityNode.ConnectivityNodeContainer".to_string(),
message: "One of the following occurs: 1) The value type is not IRI; 2) The value type is not the right class.".to_string(),
severity: "sh:Violation".to_string(),
name: "ConnectivityNode.ConnectivityNodeContainer-valueType".to_string(),
description: "This constraint validates the value type of the association at the used direction.".to_string(),
});
}
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_energy_scheduling_type_identified_object_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("EnergySchedulingType").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.energyIdentCodeEic") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
class: "EnergySchedulingType".to_string(),
property: "IdentifiedObject.energyIdentCodeEic".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_energy_scheduling_type_identified_object_etc_2(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("EnergySchedulingType").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.description") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.description-cardinality".to_string(),
class: "EnergySchedulingType".to_string(),
property: "IdentifiedObject.description".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.description-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_energy_scheduling_type_identified_object_etc_3(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("EnergySchedulingType").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::EnergySchedulingType>() {
Some(o) => o, None => continue,
};
if obj.base.m_rid.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.mRID-cardinality".to_string(),
class: "EnergySchedulingType".to_string(),
property: "IdentifiedObject.mRID".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.mRID-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_energy_scheduling_type_identified_object_etc_4(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("EnergySchedulingType").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.shortName") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.shortName-cardinality".to_string(),
class: "EnergySchedulingType".to_string(),
property: "IdentifiedObject.shortName".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.shortName-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_energy_scheduling_type_identified_object_etc_5(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("EnergySchedulingType").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::EnergySchedulingType>() {
Some(o) => o, None => continue,
};
if obj.base.name.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.name-cardinality".to_string(),
class: "EnergySchedulingType".to_string(),
property: "IdentifiedObject.name".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.name-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_junction_equipment_equipment_container_in(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Junction").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Junction>() {
Some(o) => o, None => continue,
};
let ref_mrid = match obj.base.base.base.equipment_container.as_ref() {
Some(r) => r.mrid.trim_start_matches('#'), None => continue,
};
if let Some(ref_entry) = dataset.entries.get(ref_mrid) {
let allowed: &[&str] = &["Substation", "Line", "VoltageLevel", "Bay"];
if !allowed.contains(&ref_entry.element.type_name()) {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:Equipment.EquipmentContainer-valueType".to_string(),
class: "Junction".to_string(),
property: "Equipment.EquipmentContainer".to_string(),
message: "One of the following occurs: 1) The value type is not IRI; 2) The value type is not the right class.".to_string(),
severity: "sh:Violation".to_string(),
name: "Equipment.EquipmentContainer-valueType".to_string(),
description: "This constraint validates the value type of the association at the used direction.".to_string(),
});
}
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_geographical_region_identified_object_sh_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("GeographicalRegion").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.shortName") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.shortName-cardinality".to_string(),
class: "GeographicalRegion".to_string(),
property: "IdentifiedObject.shortName".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.shortName-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_geographical_region_identified_object_m_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("GeographicalRegion").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::GeographicalRegion>() {
Some(o) => o, None => continue,
};
if obj.base.m_rid.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.mRID-cardinality".to_string(),
class: "GeographicalRegion".to_string(),
property: "IdentifiedObject.mRID".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.mRID-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_geographical_region_identified_object_na_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("GeographicalRegion").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::GeographicalRegion>() {
Some(o) => o, None => continue,
};
if obj.base.name.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.name-cardinality".to_string(),
class: "GeographicalRegion".to_string(),
property: "IdentifiedObject.name".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.name-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_geographical_region_identified_object_en_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("GeographicalRegion").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.energyIdentCodeEic") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
class: "GeographicalRegion".to_string(),
property: "IdentifiedObject.energyIdentCodeEic".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_geographical_region_identified_object_de_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("GeographicalRegion").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.description") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.description-cardinality".to_string(),
class: "GeographicalRegion".to_string(),
property: "IdentifiedObject.description".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.description-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_junction_identified_object_m_rid_required(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Junction").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Junction>() {
Some(o) => o, None => continue,
};
if obj.base.base.base.base.base.m_rid.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.mRID-cardinality".to_string(),
class: "Junction".to_string(),
property: "IdentifiedObject.mRID".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.mRID-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_junction_identified_object_short_name_ma_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Junction").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.shortName") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.shortName-cardinality".to_string(),
class: "Junction".to_string(),
property: "IdentifiedObject.shortName".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.shortName-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_junction_identified_object_name_required(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Junction").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Junction>() {
Some(o) => o, None => continue,
};
if obj.base.base.base.base.base.name.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.name-cardinality".to_string(),
class: "Junction".to_string(),
property: "IdentifiedObject.name".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.name-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_junction_identified_object_energy_ident_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Junction").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.energyIdentCodeEic") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
class: "Junction".to_string(),
property: "IdentifiedObject.energyIdentCodeEic".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_junction_equipment_equipment_container_m_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Junction").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("Equipment.EquipmentContainer") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:Equipment.EquipmentContainer-cardinality".to_string(),
class: "Junction".to_string(),
property: "Equipment.EquipmentContainer".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "Equipment.EquipmentContainer-cardinality".to_string(),
description: "This constraint validates the cardinality of the association at the used direction.".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_junction_identified_object_description_m_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Junction").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.description") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.description-cardinality".to_string(),
class: "Junction".to_string(),
property: "IdentifiedObject.description".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.description-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_line_identified_object_description_max_c_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Line").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.description") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.description-cardinality".to_string(),
class: "Line".to_string(),
property: "IdentifiedObject.description".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.description-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_line_identified_object_energy_ident_code_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Line").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.energyIdentCodeEic") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
class: "Line".to_string(),
property: "IdentifiedObject.energyIdentCodeEic".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_line_identified_object_short_name_max_count(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Line").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.shortName") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.shortName-cardinality".to_string(),
class: "Line".to_string(),
property: "IdentifiedObject.shortName".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.shortName-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_line_line_region_has_value(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Line").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Line>() {
Some(o) => o, None => continue,
};
let ref_mrid = match obj.region.as_ref() {
Some(r) => r.mrid.trim_start_matches('#'), None => continue,
};
if let Some(ref_entry) = dataset.entries.get(ref_mrid) {
let allowed: &[&str] = &["SubGeographicalRegion"];
if !allowed.contains(&ref_entry.element.type_name()) {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:Line.Region-valueType".to_string(),
class: "Line".to_string(),
property: "Line.Region".to_string(),
message: "One of the following does not conform: 1) The value type shall be IRI; 2) The value type shall be an instance of the class: cim:SubGeographicalRegion".to_string(),
severity: "sh:Violation".to_string(),
name: "Line.Region-valueType".to_string(),
description: "This constraint validates the value type of the association at the used direction.".to_string(),
});
}
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_line_identified_object_m_rid_required(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Line").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Line>() {
Some(o) => o, None => continue,
};
if obj.base.base.base.base.m_rid.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.mRID-cardinality".to_string(),
class: "Line".to_string(),
property: "IdentifiedObject.mRID".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.mRID-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_line_line_region_max_count(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Line").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("Line.Region") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:Line.Region-cardinality".to_string(),
class: "Line".to_string(),
property: "Line.Region".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "Line.Region-cardinality".to_string(),
description: "This constraint validates the cardinality of the association at the used direction.".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_line_identified_object_name_required(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Line").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Line>() {
Some(o) => o, None => continue,
};
if obj.base.base.base.base.name.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.name-cardinality".to_string(),
class: "Line".to_string(),
property: "IdentifiedObject.name".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.name-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_sub_geographical_region_identified_objec_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("SubGeographicalRegion").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::SubGeographicalRegion>() {
Some(o) => o, None => continue,
};
if obj.base.m_rid.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.mRID-cardinality".to_string(),
class: "SubGeographicalRegion".to_string(),
property: "IdentifiedObject.mRID".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.mRID-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_sub_geographical_region_identified_objec_etc_2(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("SubGeographicalRegion").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.description") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.description-cardinality".to_string(),
class: "SubGeographicalRegion".to_string(),
property: "IdentifiedObject.description".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.description-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_sub_geographical_region_identified_objec_etc_3(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("SubGeographicalRegion").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::SubGeographicalRegion>() {
Some(o) => o, None => continue,
};
if obj.base.name.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.name-cardinality".to_string(),
class: "SubGeographicalRegion".to_string(),
property: "IdentifiedObject.name".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.name-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_sub_geographical_region_sub_geographical_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("SubGeographicalRegion").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::SubGeographicalRegion>() {
Some(o) => o, None => continue,
};
let ref_mrid = match obj.region.as_ref() {
Some(r) => r.mrid.trim_start_matches('#'), None => continue,
};
if let Some(ref_entry) = dataset.entries.get(ref_mrid) {
let allowed: &[&str] = &["GeographicalRegion"];
if !allowed.contains(&ref_entry.element.type_name()) {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:SubGeographicalRegion.Region-valueType".to_string(),
class: "SubGeographicalRegion".to_string(),
property: "SubGeographicalRegion.Region".to_string(),
message: "One of the following does not conform: 1) The value type shall be IRI; 2) The value type shall be an instance of the class: cim:GeographicalRegion".to_string(),
severity: "sh:Violation".to_string(),
name: "SubGeographicalRegion.Region-valueType".to_string(),
description: "This constraint validates the value type of the association at the used direction.".to_string(),
});
}
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_sub_geographical_region_sub_geographical_etc_2(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("SubGeographicalRegion").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::SubGeographicalRegion>() {
Some(o) => o, None => continue,
};
if obj.region.is_none() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:SubGeographicalRegion.Region-cardinality".to_string(),
class: "SubGeographicalRegion".to_string(),
property: "SubGeographicalRegion.Region".to_string(),
message: "Missing required association.".to_string(),
severity: "sh:Violation".to_string(),
name: "SubGeographicalRegion.Region-cardinality".to_string(),
description: "This constraint validates the cardinality of the association at the used direction.".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_sub_geographical_region_identified_objec_etc_4(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("SubGeographicalRegion").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.shortName") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.shortName-cardinality".to_string(),
class: "SubGeographicalRegion".to_string(),
property: "IdentifiedObject.shortName".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.shortName-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_sub_geographical_region_identified_objec_etc_5(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("SubGeographicalRegion").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.energyIdentCodeEic") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
class: "SubGeographicalRegion".to_string(),
property: "IdentifiedObject.energyIdentCodeEic".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_substation_identified_object_short_name_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Substation").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.shortName") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.shortName-cardinality".to_string(),
class: "Substation".to_string(),
property: "IdentifiedObject.shortName".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.shortName-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_substation_substation_region_required(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Substation").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Substation>() {
Some(o) => o, None => continue,
};
if obj.region.is_none() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:Substation.Region-cardinality".to_string(),
class: "Substation".to_string(),
property: "Substation.Region".to_string(),
message: "Missing required association.".to_string(),
severity: "sh:Violation".to_string(),
name: "Substation.Region-cardinality".to_string(),
description: "This constraint validates the cardinality of the association at the used direction.".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_substation_identified_object_energy_iden_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Substation").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.energyIdentCodeEic") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
class: "Substation".to_string(),
property: "IdentifiedObject.energyIdentCodeEic".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_substation_identified_object_m_rid_required(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Substation").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Substation>() {
Some(o) => o, None => continue,
};
if obj.base.base.base.base.m_rid.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.mRID-cardinality".to_string(),
class: "Substation".to_string(),
property: "IdentifiedObject.mRID".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.mRID-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_substation_identified_object_name_required(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Substation").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Substation>() {
Some(o) => o, None => continue,
};
if obj.base.base.base.base.name.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.name-cardinality".to_string(),
class: "Substation".to_string(),
property: "IdentifiedObject.name".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.name-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_substation_identified_object_description_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Substation").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.description") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.description-cardinality".to_string(),
class: "Substation".to_string(),
property: "IdentifiedObject.description".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.description-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_substation_substation_region_has_value(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Substation").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Substation>() {
Some(o) => o, None => continue,
};
let ref_mrid = match obj.region.as_ref() {
Some(r) => r.mrid.trim_start_matches('#'), None => continue,
};
if let Some(ref_entry) = dataset.entries.get(ref_mrid) {
let allowed: &[&str] = &["SubGeographicalRegion"];
if !allowed.contains(&ref_entry.element.type_name()) {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:Substation.Region-valueType".to_string(),
class: "Substation".to_string(),
property: "Substation.Region".to_string(),
message: "One of the following does not conform: 1) The value type shall be IRI; 2) The value type shall be an instance of the class: cim:SubGeographicalRegion".to_string(),
severity: "sh:Violation".to_string(),
name: "Substation.Region-valueType".to_string(),
description: "This constraint validates the value type of the association at the used direction.".to_string(),
});
}
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_identified_object_description_m_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Terminal").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.description") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.description-cardinality".to_string(),
class: "Terminal".to_string(),
property: "IdentifiedObject.description".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.description-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_identified_object_name_required(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Terminal").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Terminal>() {
Some(o) => o, None => continue,
};
if obj.base.base.name.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.name-cardinality".to_string(),
class: "Terminal".to_string(),
property: "IdentifiedObject.name".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.name-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_terminal_connectivity_node_has_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Terminal").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Terminal>() {
Some(o) => o, None => continue,
};
let ref_mrid = match obj.connectivity_node.as_ref() {
Some(r) => r.mrid.trim_start_matches('#'), None => continue,
};
if let Some(ref_entry) = dataset.entries.get(ref_mrid) {
let allowed: &[&str] = &["ConnectivityNode"];
if !allowed.contains(&ref_entry.element.type_name()) {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:Terminal.ConnectivityNode-valueType".to_string(),
class: "Terminal".to_string(),
property: "Terminal.ConnectivityNode".to_string(),
message: "One of the following does not conform: 1) The value type shall be IRI; 2) The value type shall be an instance of the class: cim:ConnectivityNode".to_string(),
severity: "sh:Violation".to_string(),
name: "Terminal.ConnectivityNode-valueType".to_string(),
description: "This constraint validates the value type of the association at the used direction.".to_string(),
});
}
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_identified_object_energy_ident_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Terminal").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.energyIdentCodeEic") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
class: "Terminal".to_string(),
property: "IdentifiedObject.energyIdentCodeEic".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_terminal_conducting_equipment_r_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Terminal").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Terminal>() {
Some(o) => o, None => continue,
};
if obj.conducting_equipment.is_none() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:Terminal.ConductingEquipment-cardinality".to_string(),
class: "Terminal".to_string(),
property: "Terminal.ConductingEquipment".to_string(),
message: "Missing required association.".to_string(),
severity: "sh:Violation".to_string(),
name: "Terminal.ConductingEquipment-cardinality".to_string(),
description: "This constraint validates the cardinality of the association at the used direction.".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_identified_object_short_name_ma_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Terminal").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.shortName") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.shortName-cardinality".to_string(),
class: "Terminal".to_string(),
property: "IdentifiedObject.shortName".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.shortName-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_terminal_conducting_equipment_h_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Terminal").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Terminal>() {
Some(o) => o, None => continue,
};
let ref_mrid = match obj.conducting_equipment.as_ref() {
Some(r) => r.mrid.trim_start_matches('#'), None => continue,
};
if let Some(ref_entry) = dataset.entries.get(ref_mrid) {
let allowed: &[&str] = &["Junction"];
if !allowed.contains(&ref_entry.element.type_name()) {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:Terminal.ConductingEquipment-valueType".to_string(),
class: "Terminal".to_string(),
property: "Terminal.ConductingEquipment".to_string(),
message: "One of the following does not conform: 1) The value type shall be IRI; 2) The value type shall be an instance of the class: cim:Junction".to_string(),
severity: "sh:Violation".to_string(),
name: "Terminal.ConductingEquipment-valueType".to_string(),
description: "This constraint validates the value type of the association at the used direction.".to_string(),
});
}
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_terminal_connectivity_node_max_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Terminal").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("Terminal.ConnectivityNode") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:Terminal.ConnectivityNode-cardinality".to_string(),
class: "Terminal".to_string(),
property: "Terminal.ConnectivityNode".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "Terminal.ConnectivityNode-cardinality".to_string(),
description: "This constraint validates the cardinality of the association at the used direction.".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_terminal_identified_object_m_rid_required(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("Terminal").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::Terminal>() {
Some(o) => o, None => continue,
};
if obj.base.base.m_rid.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.mRID-cardinality".to_string(),
class: "Terminal".to_string(),
property: "IdentifiedObject.mRID".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.mRID-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_identified_object_energy_i_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VoltageLevel").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.energyIdentCodeEic") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
class: "VoltageLevel".to_string(),
property: "IdentifiedObject.energyIdentCodeEic".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.energyIdentCodeEic-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_voltage_level_substation_r_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VoltageLevel").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::VoltageLevel>() {
Some(o) => o, None => continue,
};
if obj.substation.is_none() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:VoltageLevel.Substation-cardinality".to_string(),
class: "VoltageLevel".to_string(),
property: "VoltageLevel.Substation".to_string(),
message: "Missing required association.".to_string(),
severity: "sh:Violation".to_string(),
name: "VoltageLevel.Substation-cardinality".to_string(),
description: "This constraint validates the cardinality of the association at the used direction.".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_voltage_level_base_voltage_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VoltageLevel").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::VoltageLevel>() {
Some(o) => o, None => continue,
};
let ref_mrid = match obj.base_voltage.as_ref() {
Some(r) => r.mrid.trim_start_matches('#'), None => continue,
};
if let Some(ref_entry) = dataset.entries.get(ref_mrid) {
let allowed: &[&str] = &["BaseVoltage"];
if !allowed.contains(&ref_entry.element.type_name()) {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:VoltageLevel.BaseVoltage-valueType".to_string(),
class: "VoltageLevel".to_string(),
property: "VoltageLevel.BaseVoltage".to_string(),
message: "One of the following does not conform: 1) The value type shall be IRI; 2) The value type shall be an instance of the class: cim:BaseVoltage".to_string(),
severity: "sh:Violation".to_string(),
name: "VoltageLevel.BaseVoltage-valueType".to_string(),
description: "This constraint validates the value type of the association at the used direction.".to_string(),
});
}
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_voltage_level_high_voltage_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VoltageLevel").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("VoltageLevel.highVoltageLimit") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:VoltageLevel.highVoltageLimit-cardinality".to_string(),
class: "VoltageLevel".to_string(),
property: "VoltageLevel.highVoltageLimit".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "VoltageLevel.highVoltageLimit-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_identified_object_descript_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VoltageLevel").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.description") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.description-cardinality".to_string(),
class: "VoltageLevel".to_string(),
property: "IdentifiedObject.description".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.description-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_voltage_level_low_voltage_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VoltageLevel").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("VoltageLevel.lowVoltageLimit") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:VoltageLevel.lowVoltageLimit-cardinality".to_string(),
class: "VoltageLevel".to_string(),
property: "VoltageLevel.lowVoltageLimit".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "VoltageLevel.lowVoltageLimit-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_voltage_level_base_voltage_etc_2(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VoltageLevel").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::VoltageLevel>() {
Some(o) => o, None => continue,
};
if obj.base_voltage.is_none() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:VoltageLevel.BaseVoltage-cardinality".to_string(),
class: "VoltageLevel".to_string(),
property: "VoltageLevel.BaseVoltage".to_string(),
message: "Missing required association.".to_string(),
severity: "sh:Violation".to_string(),
name: "VoltageLevel.BaseVoltage-cardinality".to_string(),
description: "This constraint validates the cardinality of the association at the used direction.".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_identified_object_name_req_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VoltageLevel").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::VoltageLevel>() {
Some(o) => o, None => continue,
};
if obj.base.base.base.base.name.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.name-cardinality".to_string(),
class: "VoltageLevel".to_string(),
property: "IdentifiedObject.name".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.name-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_identified_object_short_na_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VoltageLevel").into_iter().flatten() {
if dataset.entries[mrid].block.duplicate_fields.contains("IdentifiedObject.shortName") {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.shortName-cardinality".to_string(),
class: "VoltageLevel".to_string(),
property: "IdentifiedObject.shortName".to_string(),
message: "Cardinality violation. Upper bound shall be 1".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.shortName-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_voltage_level_substation_h_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VoltageLevel").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::VoltageLevel>() {
Some(o) => o, None => continue,
};
let ref_mrid = match obj.substation.as_ref() {
Some(r) => r.mrid.trim_start_matches('#'), None => continue,
};
if let Some(ref_entry) = dataset.entries.get(ref_mrid) {
let allowed: &[&str] = &["Substation"];
if !allowed.contains(&ref_entry.element.type_name()) {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "eqbd:VoltageLevel.Substation-valueType".to_string(),
class: "VoltageLevel".to_string(),
property: "VoltageLevel.Substation".to_string(),
message: "One of the following does not conform: 1) The value type shall be IRI; 2) The value type shall be an instance of the class: cim:Substation".to_string(),
severity: "sh:Violation".to_string(),
name: "VoltageLevel.Substation-valueType".to_string(),
description: "This constraint validates the value type of the association at the used direction.".to_string(),
});
}
}
}
violations
}
pub fn check_p61970_600_2_equipmentboundary_ap_con_simple_shacl_voltage_level_identified_object_m_rid_re_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VoltageLevel").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::VoltageLevel>() {
Some(o) => o, None => continue,
};
if obj.base.base.base.base.m_rid.is_empty() {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "ido:IdentifiedObject.mRID-cardinality".to_string(),
class: "VoltageLevel".to_string(),
property: "IdentifiedObject.mRID".to_string(),
message: "Missing required property (attribute).".to_string(),
severity: "sh:Violation".to_string(),
name: "IdentifiedObject.mRID-cardinality".to_string(),
description: "This constraint validates the cardinality of the property (attribute).".to_string(),
});
}
}
violations
}