Conformance
Which IEC standards cim-kit implements, which CGMES profiles it supports, and what is verified against the published ENTSO-E conformity models on every build.
Standards#
| Standard | Role |
|---|---|
| IEC 61970-301:2020 + AMD1:2022 | CIM base semantics (CIM17) |
| IEC 61970-501:2006 | RDFS profile representation — the code-generation input |
| IEC 61970-552:2016 | CIM/XML: identity, headers, difference models |
| IEC TS 61970-600-1/-2:2021 | CGMES 3.0 profile set |
| CGMES 2.4.15 | The profile set in production use across Europe |
Profiles: EQ, OP, SC, EQBD, SSH, TP, SV, DL, GL, DY and the header vocabulary in both vintages, plus TPBD in CGMES 2.4.15.
| Vintage | Feature | Namespace | Classes | Attributes | Enums | Profiles |
|---|---|---|---|---|---|---|
| CGMES 3.0 | cgmes3 (default) | CIM100 + eu | 443 | 3,624 | 51 | 11 |
| CGMES 2.4.15 | cgmes2 | cim16 + entsoe | 401 | 3,539 | 48 | 12 |
What is verified#
Against the published ENTSO-E conformity corpora, on every build with the corpus present. Corpus-backed tests skip cleanly when the corpus is absent, so a fresh clone is green.
Reading and writing#
| Check | Against | Result |
|---|---|---|
| Read | 31 CGMES 3.0 model sets, 361 files, 250,698 objects | 0 diagnostics |
| Read | 52 CGMES 2.4.15 archives, 273,144 objects | 0 errors, 9 recovered namespace mistakes |
| Read | ENTSO-E's 100 QoCDC model sets (real TSO exports, conformant and not) | All read, vintage detected; the three broken-on-purpose files named, not fatal |
| Element census | All 361 CGMES 3.0 files, and 225 files of the 95 clean QoCDC sets | Class for class, rdf:ID/rdf:about style for style |
| Identifier census | Every re-exported file | rdf:ID/rdf:about values letter for letter |
| Value census | 951,340 values: every self-consistent CGMES 3.0 model set plus one CGMES 2.4.15 archive | Value text for text (2.62637E-05 is not rewritten as 0.0000262637) |
| Model round-trip | Every conformity model, by profile and as its original file set | No value lost |
| Well-formedness | Every written document | Namespaces resolved, no duplicate attribute, XML 1.0 Char production |
| Difference models | Both vintages | Read, applied and written back, class replacement included |
| Computed differences | A change set derived from two model states | Applying it reproduces the target |
| Assembly | Datasets built separately, then merged | Same content_id as loading the files in sequence |
| Vintage detection | Both corpora, vintage taken from the documents | Correct pairing raises no CIM0021; a mismatch is reported at the root element |
Validation and RDF#
| Check | Against | Result |
|---|---|---|
| Validation | The whole corpus | Findings pinned; a new one fails the build |
| Merge conflicts | Every model set | Pinned by location; only the two 24-hour time-series directories conflict |
| RDF export | 1.67M triples, whole-model and per profile | Valid N-Triples |
SHACL (cargo xtask shacl, pyshacl, CI) | Every CGMES 3.0 profile that carries data, in every model set, with ENTSO-E's shapes | Conforms, apart from findings in the models themselves (details). A profile without data is no data; a run that validates nothing fails |
| Syntax limits | Values and identifiers | Unrepresentable characters stripped and reported (CIM0019); absolute-IRI identifiers written as rdf:about; identifiers with no valid form reported (CIM0020) |
CGMES 2.4.15 is exported but not shape-validated: all ten shapes files ENTSO-E publishes for it are invalid SHACL (nine have property shapes with two sh:path values, one a constraint with two sh:in), so a conforming engine refuses them. cargo xtask shacl --vintage cgmes2 runs in CI and pins that set as unusable.
Independent implementations#
cargo xtask crossvalidate runs, in pinned containers, implementations that share none of cim-kit's code or approach — the check a round trip cannot provide:
| Tool | Input | Must hold |
|---|---|---|
| PowSyBl (Java; RDF4J + SPARQL) | Published files and a cim-kit re-export: four assembled CGMES 3.0 configurations and the CGMES 2.4.15 MicroGrid archive | Identical networks — every identifiable-type count, both bus views, SHA-256 over every identifier |
| rdflib (Python) | The RDF export | Parses as a graph; literals carry the profile's XSD types |
Removing one cim:Breaker from a published equipment file changes the digest, drops the switch count from 28 to 27 and raises the bus count from 14 to 15.
Robustness and build#
| Check | Result |
|---|---|
| Mutation: every truncation, 1,631 single-byte corruptions, every region deletion | No panic; every truncation refused, the dataset unchanged (cargo-fuzz targets for longer runs on nightly) |
| Malformed input | Markup nested in a value stays out of it; objects without identifier stay distinct; absolute-IRI references resolve; a broken document's report is bounded and says where it stopped |
| Profile bound | Every vintage fits ProfileMask, profile bits pinned distinct |
| Command line and examples | Run against published models in CI; output checked by xmllint |
| Streams | cim diff redirected and with --out: byte-identical |
| Feature matrix | Every supported feature combination builds, lints and compiles its doctests |
| Portability | Library builds for wasm32-unknown-unknown |
| Documentation links | README anchors resolve; zola build fails on a broken site link |
Deliberate deviations#
ENTSO-E's RDF-Syntax User Guide §2.3 states that the published schemas deviate from W3C and from IEC 61970-501. Five deviations in the vocabularies and in real exports are handled explicitly:
| Deviation | Handling |
|---|---|
SSH marks all 45 classes it touches Description except Equipment, declared concrete as the carrier for inService | Read from the hierarchy: a profile that marks Switch and ACLineSegment as descriptions annotates equipment, not introduces it |
| A class instantiated where its own profile calls it abstract | Treated as defined there |
A file sets attributes its header does not declare (e.g. Terminal.ConnectivityNode in a 2.4.15 boundary file) | Value written back where it came from; reported as CIM0010 |
A header under-declares its profiles (an Equipment file naming only EquipmentCore/3/1 while carrying LoadArea) | A class the write set does not mention is introduced (rdf:ID) by the file carrying it |
An rdf:ID that is not an XML NCName (rdf:ID="7d06eea0-…", no leading underscore) | Repaired, and always reported as CIM0004 |
Not in scope#
- Power flow, state estimation, topology processing.
- A general RDF store, SPARQL engine or OWL reasoner.
- Running SHACL — the export is made for an external engine.
- Reading RDF back; CIM/XML is the exchange format.
- GUI and diagram rendering; DL and GL data are exposed.
- IEC 62325 market profiles and IEC 61968 message envelopes.
- Bindings for other languages; the library is
wasm32-clean with one mandatory dependency.
Licensing#
The crate is MIT OR Apache-2.0.
The RDFS vocabularies the generated code derives from are published by ENTSO-E and the UCA International Users Group under the Apache License 2.0; generated files carry that attribution. The IEC standard documents are not redistributed, and nothing in the build or test pipeline depends on them.
The ENTSO-E conformity test models are licensed CC BY-SA 4.0 and owned by ENTSO-E; they are a local and CI test corpus only, never redistributed with the crate.
Sources#
- IEC 61970-301:2020 (IEC webstore) — with AMD1:2022, CIM17
- IEC 61970:2026 SER — the series package, with 61970-501:2006
- IEC TS 61970-600-1:2021 (CGMES 3.0) · ENTSO-E CGMES library
- ENTSO-E application-profiles-library (RDFS + SHACL) · ENTSO-E RDF-Syntax User Guide v2.0.0 — §2.2.1.2 for the
rdf:ID/rdf:aboutrule (citing rule MVAL5 of IEC 61970-600-1:2021), §2.2.1.1 for datatypes not being exchanged and engineering notation carrying precision;cargo xtask fetch-specsdownloads it - ENTSO-E CIM conformity & interoperability (test configurations, CC BY-SA 4.0)
- PowSyBl CGMES importer/exporter · pySHACL
- OpenCGMES CIMXML overview — names normalizing UUIDs "with and without underscore prefixes and dashes" as required behaviour; see identity: the mRID
- CIM Modeling Guide — UCAIug CIM licensing (Apache 2.0)
- W3C SHACL · W3C RDF 1.1 N-Triples · W3C RDF 1.1 Turtle · W3C XML Namespaces 1.0