This site documents a LinkML data model for the Marktstammdatenregister (MaStR) Gesamtdatenexport.
The source data is the XSD schema files and the PDF documentation
"Dokumentation des Exports" (Beschreibung des Exports) retrieved from the
Marktstammdatenregister.
These raw inputs live under sources/ (sources/xsd/ and
sources/Dokumentation MaStR Gesamtdatenexport.pdf).
The build pipeline is:
scripts/01-xsd-preprocessing.pypatches the XSD files so schema-automator can import them (replacing unsupported bounded integer types withxs:integer).scripts/02-merge-linkml.pymerges the per-XSD LinkML schemas fromlinkml/parts/intolinkml/mastr.yml.scripts/03-pdf-description-extraction.pyparses the PDF automatically and injects attribute descriptions from the "Beschreibung" column into the matching schema classes.scripts/04-fetch-catalog.pystreams the two MaStR catalog lookup tables (Katalogkategorien.xmlandKatalogwerte.xml) out of the remote export archive.scripts/05-build-enums.pyturns the "Katalogkategorie" attributes into proper LinkML enumerations, using the catalog values fetched in step 4 as theirpermissible_values.scripts/06-extract-base-classes.pyinduces inheritance: it creates abstractEinheitandAnlagebase classes that hold attributes shared across the concreteEinheit*andAnlage*classes, determined by identifying slots that appear in multiple of these classes with identical definitions.
The schema is defined in linkml/mastr.yml as a LinkML schema. The reference
pages under Schema (classes, slots,
types) are generated directly from that schema using LinkML's generate doc
command and should not be edited by hand — any changes belong in the schema
source instead. This page, however, is maintained separately and is not
touched by the generator.
The python scripts in this repo were created by LLMs.
The source docs files (sources/xsd/ and sources/Dokumentation MaStR Gesamtdatenexport.pdf) are from the Marktstammdatenregister, which is licensed under the Datenlizenz Deutschland – Namensnennung – Version 2.0 (DL-DE-BY-2.0) | Copyright: Marktstammdatenregister - © Bundesnetzagentur für Elektrizität, Gas, Telekommunikation, Post und Eisenbahnen | DL-DE-BY-2.0.