#![allow(clippy::all, dead_code, unused)]
use cimdecoder::CimDataset;
use crate::Violation;
use crate::helpers::*;
pub fn validate_p61970_301_steadystatehypothesis_ap_con_complex_shacl(dataset: &CimDataset) -> Vec<Violation> {
let mut v = Vec::new();
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_active_power_limit_active_power_limit_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_apparent_power_limit_apparent_power_l_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_battery_unit_battery_unit_stored_e_mi_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_control_area_control_area_p_tolerance_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_cs_converter_cs_converter_target_idc_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_cs_converter_cs_converter_target_gamm_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_cs_converter_cs_converter_target_alph_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_cs_converter_acdc_converter_target_ud_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_current_limit_current_limit_value_min_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_energy_source_energy_source_voltage_m_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_energy_source_energy_source_voltage_a_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_equivalent_injection_equivalent_injec_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_generating_unit_generating_unit_norma_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_hydro_generating_unit_generating_unit_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_linear_shunt_compensator_shunt_compen_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_nonlinear_shunt_compensator_shunt_com_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_nuclear_generating_unit_generating_un_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_regulating_control_regulating_control_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_solar_generating_unit_generating_unit_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_tap_changer_control_regulating_contro_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_thermal_generating_unit_generating_un_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_voltage_limit_voltage_limit_value_min_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_vs_converter_vs_converter_droop_min_excl(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_vs_converter_vs_converter_target_pw_m_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_vs_converter_vs_converter_target_powe_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_vs_converter_vs_converter_target_upcc_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_vs_converter_acdc_converter_target_ud_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_vs_converter_vs_converter_q_share_min_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_vs_converter_vs_converter_target_phas_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_vs_converter_vs_converter_droop_compe_etc(dataset));
v.extend(check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_wind_generating_unit_generating_unit_etc(dataset));
v
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_active_power_limit_active_power_limit_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("ActivePowerLimit").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::ActivePowerLimit>() {
Some(o) => o, None => continue,
};
if obj.value.is_none() { continue; }
if obj.value.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:ActivePowerLimit.value-valueRange".to_string(),
class: "ActivePowerLimit".to_string(),
property: "ActivePowerLimit.value".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:ActivePowerLimit.value:valueRange".to_string(),
description: "The attribute shall be a positive value or zero.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_apparent_power_limit_apparent_power_l_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("ApparentPowerLimit").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::ApparentPowerLimit>() {
Some(o) => o, None => continue,
};
if obj.value.is_none() { continue; }
if obj.value.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:ApparentPowerLimit.value-valueRange".to_string(),
class: "ApparentPowerLimit".to_string(),
property: "ApparentPowerLimit.value".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:ApparentPowerLimit.value:valueRange".to_string(),
description: "The attribute shall be a positive value or zero.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_battery_unit_battery_unit_stored_e_mi_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("BatteryUnit").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::BatteryUnit>() {
Some(o) => o, None => continue,
};
if obj.stored_e.is_none() { continue; }
if obj.stored_e.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:BatteryUnit.storedE-valueRange".to_string(),
class: "BatteryUnit".to_string(),
property: "BatteryUnit.storedE".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:BatteryUnit.storedE:valueRange".to_string(),
description: "The attribute shall be a positive value or zero and lower than BatteryUnit.ratedE.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_control_area_control_area_p_tolerance_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("ControlArea").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::ControlArea>() {
Some(o) => o, None => continue,
};
if obj.p_tolerance.is_none() { continue; }
if obj.p_tolerance.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:ControlArea.pTolerance-valueRange".to_string(),
class: "ControlArea".to_string(),
property: "ControlArea.pTolerance".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:ControlArea.pTolerance:valueRange".to_string(),
description: "The attribute shall be a positive value or zero.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_cs_converter_cs_converter_target_idc_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("CsConverter").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::CsConverter>() {
Some(o) => o, None => continue,
};
if obj.target_idc.is_none() { continue; }
if obj.target_idc.unwrap() <= 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:CsConverter.targetIdc-valueRange".to_string(),
class: "CsConverter".to_string(),
property: "CsConverter.targetIdc".to_string(),
message: "The value is negative or zero.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:CsConverter.targetIdc:valueRange".to_string(),
description: "The attribute shall be a positive value.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_cs_converter_cs_converter_target_gamm_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("CsConverter").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::CsConverter>() {
Some(o) => o, None => continue,
};
if obj.target_gamma.is_none() { continue; }
if obj.target_gamma.unwrap() <= 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:CsConverter.targetGamma-valueRange".to_string(),
class: "CsConverter".to_string(),
property: "CsConverter.targetGamma".to_string(),
message: "The value is negative or zero.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:CsConverter.targetGamma:valueRange".to_string(),
description: "The attribute shall be a positive value.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_cs_converter_cs_converter_target_alph_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("CsConverter").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::CsConverter>() {
Some(o) => o, None => continue,
};
if obj.target_alpha.is_none() { continue; }
if obj.target_alpha.unwrap() <= 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:CsConverter.targetAlpha-valueRange".to_string(),
class: "CsConverter".to_string(),
property: "CsConverter.targetAlpha".to_string(),
message: "The value is negative or zero.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:CsConverter.targetAlpha:valueRange".to_string(),
description: "The attribute shall be a positive value.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_cs_converter_acdc_converter_target_ud_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("CsConverter").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::CsConverter>() {
Some(o) => o, None => continue,
};
if obj.base.target_udc.is_none() { continue; }
if obj.base.target_udc.unwrap() <= 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:ACDCConverter.targetUdc-valueRange".to_string(),
class: "CsConverter".to_string(),
property: "ACDCConverter.targetUdc".to_string(),
message: "The value is negative or zero.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:ACDCConverter.targetUdc:valueRange".to_string(),
description: "The attribute shall be a positive value.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_current_limit_current_limit_value_min_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("CurrentLimit").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::CurrentLimit>() {
Some(o) => o, None => continue,
};
if obj.value.is_none() { continue; }
if obj.value.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:CurrentLimit.value-valueRange".to_string(),
class: "CurrentLimit".to_string(),
property: "CurrentLimit.value".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:CurrentLimit.value:valueRange".to_string(),
description: "The attribute shall be a positive value or zero.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_energy_source_energy_source_voltage_m_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("EnergySource").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::EnergySource>() {
Some(o) => o, None => continue,
};
if obj.voltage_magnitude.is_none() { continue; }
if obj.voltage_magnitude.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:EnergySource.voltageMagnitude-valueRange".to_string(),
class: "EnergySource".to_string(),
property: "EnergySource.voltageMagnitude".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:EnergySource.voltageMagnitude:valueRange".to_string(),
description: "The attribute shall be a positive value or zero.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_energy_source_energy_source_voltage_a_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("EnergySource").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::EnergySource>() {
Some(o) => o, None => continue,
};
if obj.voltage_angle.is_none() { continue; }
if obj.voltage_angle.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:EnergySource.voltageAngle-valueRange".to_string(),
class: "EnergySource".to_string(),
property: "EnergySource.voltageAngle".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:EnergySource.voltageAngle:valueRange".to_string(),
description: "The attribute shall be a positive value or zero.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_equivalent_injection_equivalent_injec_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("EquivalentInjection").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::EquivalentInjection>() {
Some(o) => o, None => continue,
};
if obj.regulation_target.is_none() { continue; }
if obj.regulation_target.unwrap() <= 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:EquivalentInjection.regulationTarget-valueRange".to_string(),
class: "EquivalentInjection".to_string(),
property: "EquivalentInjection.regulationTarget".to_string(),
message: "The value is negative or zero.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:EquivalentInjection.regulationTarget:valueRange".to_string(),
description: "The attribute shall be a positive value.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_generating_unit_generating_unit_norma_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("GeneratingUnit").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::GeneratingUnit>() {
Some(o) => o, None => continue,
};
if obj.normal_pf.is_none() { continue; }
if obj.normal_pf.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:GeneratingUnit.normalPF-valueRange".to_string(),
class: "GeneratingUnit".to_string(),
property: "GeneratingUnit.normalPF".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:GeneratingUnit.normalPF:valueRange".to_string(),
description: "The attribute shall be a positive value or zero.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_hydro_generating_unit_generating_unit_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("HydroGeneratingUnit").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::HydroGeneratingUnit>() {
Some(o) => o, None => continue,
};
if obj.base.normal_pf.is_none() { continue; }
if obj.base.normal_pf.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:GeneratingUnit.normalPF-valueRange".to_string(),
class: "HydroGeneratingUnit".to_string(),
property: "GeneratingUnit.normalPF".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:GeneratingUnit.normalPF:valueRange".to_string(),
description: "The attribute shall be a positive value or zero.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_linear_shunt_compensator_shunt_compen_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("LinearShuntCompensator").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::LinearShuntCompensator>() {
Some(o) => o, None => continue,
};
if obj.base.sections.is_none() { continue; }
if obj.base.sections.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:ShuntCompensator.sections-valueRange".to_string(),
class: "LinearShuntCompensator".to_string(),
property: "ShuntCompensator.sections".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:ShuntCompensator.sections:valueRange".to_string(),
description: "The attribute shall be a positive value or zero. ".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_nonlinear_shunt_compensator_shunt_com_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("NonlinearShuntCompensator").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::NonlinearShuntCompensator>() {
Some(o) => o, None => continue,
};
if obj.base.sections.is_none() { continue; }
if obj.base.sections.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:ShuntCompensator.sections-valueRange".to_string(),
class: "NonlinearShuntCompensator".to_string(),
property: "ShuntCompensator.sections".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:ShuntCompensator.sections:valueRange".to_string(),
description: "The attribute shall be a positive value or zero. ".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_nuclear_generating_unit_generating_un_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("NuclearGeneratingUnit").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::NuclearGeneratingUnit>() {
Some(o) => o, None => continue,
};
if obj.base.normal_pf.is_none() { continue; }
if obj.base.normal_pf.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:GeneratingUnit.normalPF-valueRange".to_string(),
class: "NuclearGeneratingUnit".to_string(),
property: "GeneratingUnit.normalPF".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:GeneratingUnit.normalPF:valueRange".to_string(),
description: "The attribute shall be a positive value or zero.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_regulating_control_regulating_control_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("RegulatingControl").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::RegulatingControl>() {
Some(o) => o, None => continue,
};
if obj.target_deadband.is_none() { continue; }
if obj.target_deadband.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:RegulatingControl.targetDeadband-valueRange".to_string(),
class: "RegulatingControl".to_string(),
property: "RegulatingControl.targetDeadband".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:RegulatingControl.targetDeadband:valueRange".to_string(),
description: "The attribute shall be a positive value or zero.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_solar_generating_unit_generating_unit_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("SolarGeneratingUnit").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::SolarGeneratingUnit>() {
Some(o) => o, None => continue,
};
if obj.base.normal_pf.is_none() { continue; }
if obj.base.normal_pf.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:GeneratingUnit.normalPF-valueRange".to_string(),
class: "SolarGeneratingUnit".to_string(),
property: "GeneratingUnit.normalPF".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:GeneratingUnit.normalPF:valueRange".to_string(),
description: "The attribute shall be a positive value or zero.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_tap_changer_control_regulating_contro_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("TapChangerControl").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::TapChangerControl>() {
Some(o) => o, None => continue,
};
if obj.base.target_deadband.is_none() { continue; }
if obj.base.target_deadband.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:RegulatingControl.targetDeadband-valueRange".to_string(),
class: "TapChangerControl".to_string(),
property: "RegulatingControl.targetDeadband".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:RegulatingControl.targetDeadband:valueRange".to_string(),
description: "The attribute shall be a positive value or zero.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_thermal_generating_unit_generating_un_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("ThermalGeneratingUnit").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::ThermalGeneratingUnit>() {
Some(o) => o, None => continue,
};
if obj.base.normal_pf.is_none() { continue; }
if obj.base.normal_pf.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:GeneratingUnit.normalPF-valueRange".to_string(),
class: "ThermalGeneratingUnit".to_string(),
property: "GeneratingUnit.normalPF".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:GeneratingUnit.normalPF:valueRange".to_string(),
description: "The attribute shall be a positive value or zero.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_voltage_limit_voltage_limit_value_min_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VoltageLimit").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::VoltageLimit>() {
Some(o) => o, None => continue,
};
if obj.value.is_none() { continue; }
if obj.value.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:VoltageLimit.value-valueRange".to_string(),
class: "VoltageLimit".to_string(),
property: "VoltageLimit.value".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:VoltageLimit.value:valueRange".to_string(),
description: "The attribute shall be a positive value or zero.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_vs_converter_vs_converter_droop_min_excl(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VsConverter").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::VsConverter>() {
Some(o) => o, None => continue,
};
if obj.droop.is_none() { continue; }
if obj.droop.unwrap() <= 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:VsConverter.droop-valueRange".to_string(),
class: "VsConverter".to_string(),
property: "VsConverter.droop".to_string(),
message: "The value is negative or zero.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:VsConverter.droop:valueRange".to_string(),
description: "The attribute shall be a positive value.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_vs_converter_vs_converter_target_pw_m_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VsConverter").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::VsConverter>() {
Some(o) => o, None => continue,
};
if obj.target_pw_mfactor.is_none() { continue; }
if obj.target_pw_mfactor.unwrap() <= 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:VsConverter.targetPWMfactor-valueRange".to_string(),
class: "VsConverter".to_string(),
property: "VsConverter.targetPWMfactor".to_string(),
message: "The value is negative or zero.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:VsConverter.targetPWMfactor:valueRange".to_string(),
description: "The attribute shall be a positive value.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_vs_converter_vs_converter_target_powe_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VsConverter").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::VsConverter>() {
Some(o) => o, None => continue,
};
if obj.target_power_factor_pcc.is_none() { continue; }
if obj.target_power_factor_pcc.unwrap() <= 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:VsConverter.targetPowerFactorPcc-valueRange".to_string(),
class: "VsConverter".to_string(),
property: "VsConverter.targetPowerFactorPcc".to_string(),
message: "The value is negative or zero.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:VsConverter.targetPowerFactorPcc:valueRange".to_string(),
description: "The attribute shall be a positive value.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_vs_converter_vs_converter_target_upcc_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VsConverter").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::VsConverter>() {
Some(o) => o, None => continue,
};
if obj.target_upcc.is_none() { continue; }
if obj.target_upcc.unwrap() <= 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:VsConverter.targetUpcc-valueRange".to_string(),
class: "VsConverter".to_string(),
property: "VsConverter.targetUpcc".to_string(),
message: "The value is negative or zero.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:VsConverter.targetUpcc:valueRange".to_string(),
description: "The attribute shall be a positive value.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_vs_converter_acdc_converter_target_ud_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VsConverter").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::VsConverter>() {
Some(o) => o, None => continue,
};
if obj.base.target_udc.is_none() { continue; }
if obj.base.target_udc.unwrap() <= 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:ACDCConverter.targetUdc-valueRange".to_string(),
class: "VsConverter".to_string(),
property: "ACDCConverter.targetUdc".to_string(),
message: "The value is negative or zero.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:ACDCConverter.targetUdc:valueRange".to_string(),
description: "The attribute shall be a positive value.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_vs_converter_vs_converter_q_share_min_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VsConverter").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::VsConverter>() {
Some(o) => o, None => continue,
};
if obj.q_share.is_none() { continue; }
if obj.q_share.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:VsConverter.qShare-valueRange".to_string(),
class: "VsConverter".to_string(),
property: "VsConverter.qShare".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:VsConverter.qShare:valueRange".to_string(),
description: "The attribute shall be a positive value or zero.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_vs_converter_vs_converter_target_phas_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VsConverter").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::VsConverter>() {
Some(o) => o, None => continue,
};
if obj.target_phase_pcc.is_none() { continue; }
if obj.target_phase_pcc.unwrap() <= 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:VsConverter.targetPhasePcc-valueRange".to_string(),
class: "VsConverter".to_string(),
property: "VsConverter.targetPhasePcc".to_string(),
message: "The value is negative or zero.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:VsConverter.targetPhasePcc:valueRange".to_string(),
description: "The attribute shall be a positive value.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_vs_converter_vs_converter_droop_compe_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("VsConverter").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::VsConverter>() {
Some(o) => o, None => continue,
};
if obj.droop_compensation.is_none() { continue; }
if obj.droop_compensation.unwrap() <= 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:VsConverter.droopCompensation-valueRange".to_string(),
class: "VsConverter".to_string(),
property: "VsConverter.droopCompensation".to_string(),
message: "The value is negative or zero.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:VsConverter.droopCompensation:valueRange".to_string(),
description: "The attribute shall be a positive value.".to_string(),
});
}
}
violations
}
pub fn check_p61970_301_steadystatehypothesis_ap_con_complex_shacl_wind_generating_unit_generating_unit_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("WindGeneratingUnit").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::WindGeneratingUnit>() {
Some(o) => o, None => continue,
};
if obj.base.normal_pf.is_none() { continue; }
if obj.base.normal_pf.unwrap() < 0_f64 {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "sshu:GeneratingUnit.normalPF-valueRange".to_string(),
class: "WindGeneratingUnit".to_string(),
property: "GeneratingUnit.normalPF".to_string(),
message: "The value is negative.".to_string(),
severity: "sh:Violation".to_string(),
name: "C:301:SSH:GeneratingUnit.normalPF:valueRange".to_string(),
description: "The attribute shall be a positive value or zero.".to_string(),
});
}
}
violations
}