Skip to content

Repository files navigation

Marktstammdatenregister (MaStR) Datenmodell

This site documents a LinkML data model for the Marktstammdatenregister (MaStR) Gesamtdatenexport.

How these docs are built

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:

  1. scripts/01-xsd-preprocessing.py patches the XSD files so schema-automator can import them (replacing unsupported bounded integer types with xs:integer).
  2. scripts/02-merge-linkml.py merges the per-XSD LinkML schemas from linkml/parts/ into linkml/mastr.yml.
  3. scripts/03-pdf-description-extraction.py parses the PDF automatically and injects attribute descriptions from the "Beschreibung" column into the matching schema classes.
  4. scripts/04-fetch-catalog.py streams the two MaStR catalog lookup tables (Katalogkategorien.xml and Katalogwerte.xml) out of the remote export archive.
  5. scripts/05-build-enums.py turns the "Katalogkategorie" attributes into proper LinkML enumerations, using the catalog values fetched in step 4 as their permissible_values.
  6. scripts/06-extract-base-classes.py induces inheritance: it creates abstract Einheit and Anlage base classes that hold attributes shared across the concrete Einheit* and Anlage* 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.

AI Usage

The python scripts in this repo were created by LLMs.

License

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.

About

Inofficial documentation page for the Marktstammdatenregister

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages