pub struct ValidateOptions {Show 16 fields
pub required_attributes: bool,
pub cardinality: bool,
pub references: bool,
pub reference_targets: bool,
pub class_membership: bool,
pub datatypes: bool,
pub fixed_values: bool,
pub mrid_conformance: bool,
pub deprecation: bool,
pub dependencies: bool,
pub profile_reach: bool,
pub headers: bool,
pub merge_conflicts: bool,
pub serializable: bool,
pub profiles: ProfileMask,
pub max_diagnostics: usize,
}Expand description
Which checks to run.
Fields§
§required_attributes: boolCheck that required attributes are present.
cardinality: boolCheck that multiplicities are respected.
references: boolCheck that references resolve within the dataset.
reference_targets: boolCheck that a reference points at an object of the declared target class.
class_membership: boolCheck that every stored value’s attribute belongs to the object’s class.
The one check about what the store holds rather than about what a document said. Everything else walks the class’s attribute list, so a value filed under an attribute the class does not have is examined by nothing and dropped on export.
datatypes: boolCheck that each stored value has the shape its attribute declares.
CIM/XML carries no datatype information, so this is only decidable against the RDFS — which is exactly why ENTSO-E’s own guidance tells importers to enrich the data graph from the profile before validating it.
fixed_values: boolCheck attributes the schema pins with cims:isFixed.
mrid_conformance: boolCheck that identifiers conform to IEC 61970-552.
deprecation: boolReport use of deprecated classes and attributes.
dependencies: boolCheck that headers declare dependencies that were actually loaded.
profile_reach: boolReport attributes whose data belongs to a profile none of the loaded files declares — a header that under-declares what its file contains.
headers: boolCheck each loaded file’s header against the structural requirements of IEC 61970-552.
merge_conflicts: boolReport single-valued attributes two loaded files gave different values for.
Recorded by Dataset as the files are merged, because by the time validation
runs one of the two values is gone.
serializable: boolCheck that the model can actually be serialized as CIM/XML.
Two constraints of the output syntax that the object model cannot express, so
nothing else enforces them: a text value must hold only characters XML 1.0 can
represent, and an identifier must have an rdf:ID or rdf:about form. Both are
satisfied by every conforming model — every IEC 61970-552 identifier is a UUID —
and both are reachable from a mis-encoded file or from
Object::set. Neither is visible to a well-formedness check
of the output: the first because quick-xml does not enforce the Char
production, the second because the document is well-formed XML and merely invalid
RDF/XML.
profiles: ProfileMaskRestrict checks to these profiles. Empty means “the profiles the headers declare”, falling back to every profile the schema knows.
max_diagnostics: usizeStop after this many diagnostics. Prevents a broken file producing millions.
Implementations§
Source§impl ValidateOptions
impl ValidateOptions
Sourcepub fn essential() -> ValidateOptions
pub fn essential() -> ValidateOptions
Only the checks that indicate genuinely broken data.
Sourcepub fn thorough() -> ValidateOptions
pub fn thorough() -> ValidateOptions
Every check, including advisory ones.