olca-app
olca-app copied to clipboard
Attached key-value-stores for stored model entities
We need a flexible extension mechanism for our model types (processes, flows, ...) to store additional information. This is useful for:
- data exchange: storing data in a structured way for which there are no corresponding fields in the openLCA model (e.g. specific fields of other LCA data formats (ILCD, EcoSpold 1/2, openEPD, ...), translations, ...)
- specific applications or calculations: for example, for calculating circularity indicators we need additional information that needs to be stored in the data sets; there are many more possible use cases
- testing new things without the need to change the database schema
- store things that are currently saved in external files directly in the database (like the graphical layout of a product system; process images; source PDFs (ILCD))
- move model fields that are currently only used for data exchange (like the
infrastructure
field for processes and flows) to an extension to cleanup the database schema - ...
We need to test a bit what would be the best way to do that. Some options:
- it would be convenient if we could store this directly in the database; could be directly in the respective model tables or in a separate
blob
table => we need to test, what is faster here - the format could be JSON, compressed JSON, a binary format like BSON, MessagePack, ... => JSON could be nice, also because some databases directly support queries on JSON objects stored in columns; but it could be a bit slow, also when we want to store binary data in it
- also, we need to think if we support this just on the RootEntity level or also for nested types (e.g. exchanges, nw-sets) otherwise we would need something to address such nested types, e.g.
exchange@<internal-id>.<extension-field>
could also work in a process but is difficult to edit by the user
In the user interface, we need something like a tree editor in a tab for the different model editors. It could be, that this is only visible when this is enabled in the settings. Also, it should recognize some extension types, like model reference, URLs, etc.