CSV download includes labels/codes option
As a .Stat DE user,
When downloading data in .csv file,
I want to be able to contextually download codes or codes+labels of dimensions+dimension members of the related dataflow.
Acceptance Criteria
Download from search result
When downloading the full data in .csv from the search result page, both codes and localised labels are downloaded, meaning that the (REST) parameter "label=both" is added to the "Accept" header in this case, in addition to the localised Accept-Language header.
Download from visualisation pages
- From the visualisation page, the parameter is contextually set, depending on the "label format" option:
- If the table/chart option is "Code", then the downloaded file contains the code only ("labels=code");
- If the table/chart option is "Name" or "Both", then the downloaded file contains codes and labels ("labels=both").
- For localised names, follow the SDMX specs (see the section on localised name on how the message deals with languages) for partial labels: "The first best language match according to the user’s preferred language choices in the http Accept-Language header (or if that is not available than according to the system's default language order) is to be used for each localisable name element.”.
- It should look like:
Accept=application/vnd.sdmx.data+csv;file=true;labels=both Accept-Language=fr (or en or ar)
Output format
According to the sdmx-csv standard implementation:
- If the 'labels' parameter value is id then only the id of the Artefacts is displayed.
- If the 'labels' parameter value is both then the concatenated id and localised names of the dimension and dimension members separated by ": " are displayed. Note that the character combination ": " could also be part of the Artefact name and could therefore occur several times within the concatenated string.
Currently testable
- https://dotstatcor-dev2.main.oecd.org/BEDev1disseminateNSIService/Rest/data/TN1,DF_BUSINESS_EVOLUTION_BY_SIZE,1.0/all/?startPeriod=2008&endPeriod=2018&dimensionAtObservation=AllDimensions or
- https://dotstatcor-dev2.main.oecd.org/BEDev1disseminateNSIService/Rest/data/OECD,TEST_ANN,1.0/all/?startPeriod=2008&endPeriod=2018&dimensionAtObservation=AllDimensions for partial localised labels.
Edited by jean-baptiste nonin