Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between storage and storage_units #586

Open
1 task done
kknappmann opened this issue Oct 16, 2024 · 4 comments
Open
1 task done

Difference between storage and storage_units #586

kknappmann opened this issue Oct 16, 2024 · 4 comments

Comments

@kknappmann
Copy link

Description of the issue

Hello, first of all I want to thank you for your great work in this repository. I was wondering if you have any documentation to the tables in the db, and the options for "data". Could you please point me to the documentation? I wan to know what the difference between storage and storage_units is. Thank you so much in advance.

Workflow checklist

@nesnoj
Copy link
Collaborator

nesnoj commented Oct 16, 2024

Hey @kknappmann!

Hello, first of all I want to thank you for your great work in this repository.

Thank you!

I was wondering if you have any documentation to the tables in the db, and the options for "data". Could you please point me to the documentation? I wan to know what the difference between storage and storage_units is. Thank you so much in advance.

The right spot in the docs would be here in the table but I admit that the descriptions for those 2 tables are missing.

The distinction origins from the MaStR data export, see also PDF in "Beschreibung des Exports". I don't know why they were split into EinheitenStromSpeicher and AnlagenStromSpeicher, we just map this in the data model to storages_extended and storage_units, I assume because storages can contain multiple units.

You can join both tables.

For basic relations see also data model.

@FlorianK13
Copy link
Member

Of course we are always happy about contributions @kknappmann
So if you spend some time to understand the difference between the tables, you can tell us your findings so that we can include it in the documentation. Or you extend the documentation by yourself and create a Pull Request.

@Riraro
Copy link

Riraro commented Nov 8, 2024

In the MaStR, the relationship between a Anlage and the connected unit[s] for most types is 1..n and rarely 1..1, see the data model above. Why? Because the Anlage contains summarized attributes, which can't be attributed to a single unit.

For example, in the context of storage, the Anlage contains the attribute NutzbareSpeicherkapazitaet (usableStorageCapacity) over all connected units. It's possible to move between connected objects, since the Anlage references all connected units via the node VerknuepfteEinheitenMaStRNummern and the connected units reference the Anlage via the node SpeMastrNummer.

This structure is primarly motivated by the german law, see page 5 of https://www.marktstammdatenregister.de/MaStRHilfe/files/regHilfen/MaStR-Gesamtkonzept.pdf.
[...] Dabei muss der Tatsache Rechnung getragen werden, dass der Begriff der „Anlage“ in verschiedenen Gesetzen für die unterschiedlichsten Zwecke benötigt wird und deshalb unterschiedlich definiert ist. Das MaStR [...] muss in der Lage sein, zu den unterschiedlichen Definitionen der „Anlage“ die passenden Stammdaten zu liefern. Darum werden zunächst „Einheiten“ registriert, die sich zu „Anlagen“ gruppieren lassen und die sich mit weiteren Gruppierungsobjekten wie „Lokationen“, „Genehmigungen“ und „Speichern“ verbinden lassen.
Meaning the Anlage occurs in multiple german laws and the MaStR must display various data for different Anlagen. Therefore it's necessary to have the object Anlagen.

@FlorianK13
Copy link
Member

Thanks for this comment @Riraro

We could extend the docs Tables in the local database a bit with this information. What do you think @nesnoj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants