pub struct ModelHeader {
pub kind: ModelKind,
pub id: Option<Mrid>,
pub created: Option<String>,
pub scenario_time: Option<String>,
pub description: Option<String>,
pub version: Option<String>,
pub modeling_authority_set: Option<String>,
pub profiles: Vec<String>,
pub dependent_on: Vec<Mrid>,
pub supersedes: Vec<Mrid>,
pub extra: Vec<HeaderProperty>,
pub source: Option<String>,
}Expand description
The header of one instance file.
Fields§
§kind: ModelKind§id: Option<Mrid>Identifier of this model, written as rdf:about="urn:uuid:...".
created: Option<String>md:Model.created, in the file’s lexical form.
scenario_time: Option<String>md:Model.scenarioTime.
description: Option<String>§version: Option<String>§profiles: Vec<String>md:Model.profile, repeatable: one file may serve several profiles, as CGMES 3.0
does when Equipment, Operation and ShortCircuit share an instance file.
dependent_on: Vec<Mrid>md:Model.DependentOn — models that must be loaded for this one to resolve.
supersedes: Vec<Mrid>md:Model.Supersedes — models this one replaces.
extra: Vec<HeaderProperty>Header properties outside the vocabulary above, preserved verbatim.
CGMES 3.0 headers may carry W3C DCAT properties alongside md:Model.*, and
producers add their own. Each keeps the prefix, namespace and value form it was
read with, so a header round-trips through this crate unchanged rather than being
flattened into md: element text.
source: Option<String>Name of the file this header came from, when read from disk or an archive.
Implementations§
Source§impl ModelHeader
impl ModelHeader
pub fn new(kind: ModelKind) -> ModelHeader
Sourcepub fn declares_profile(&self, profile_iri: &str) -> bool
pub fn declares_profile(&self, profile_iri: &str) -> bool
Whether this header declares profile_iri, ignoring the version segment.
Sourcepub fn primary_profile_name(&self) -> Option<&str>
pub fn primary_profile_name(&self) -> Option<&str>
The short profile keyword, derived from the first declared profile IRI.
For example http://iec.ch/TC57/ns/CIM/CoreEquipment-EU/3.0 yields
CoreEquipment-EU.