Enhance series name generation
Following #377 (closed)
After having observed providers source data, we see that many of them consider normal to have a same dimension value label shared by several dimensions values codes.
Example:
- those 2 dimensions values belong to the same
REF_AREA
dimension:
This leads to too much validation errors that are not attributable to DBnomics. Example
- Dataset "INSEE/IPCH-2005" at location IPCH-2005/dataset.json
Error code: duplicate-dimensions-values-labels
Message: Dimension label 'Grand Est' appear more than once for dimension 'REF_AREA' in dataset.json
Cause:
Now we accept that converted JSON-data have duplicate values labels, as for source data. To solve the original problem that made us open #377 (closed), we need to enforce series name generation in the Web API: the algorithm must detect duplicate dimensions values labels and add the dimension value code if necessary, to distinguish. When there is no duplicate for a dimension value label, don't add the code to lighten the name.
Example:
- before
- Annual – Grand Est – Population
- Annual – Grand Est – Population
- after
- Annual – Grand Est (44) – Population
- Annual – Grand Est (R44) – Population
TODO
-
Rollback #377 (closed) -
Enhance dbnomics_api.json_responses:generate_series_name
to ensure unicity of generated names