Difference between revisions of "Fusion-CSV-TS"
(→Overview) |
(→Parameters) |
||
Line 31: | Line 31: | ||
The following URL parameters can be used in a RESTful query for Fusion-CSV-TS data. | The following URL parameters can be used in a RESTful query for Fusion-CSV-TS data. | ||
− | + | {| class="wikitable" | |
− | + | |- | |
− | + | ! Query Parameter !! Values !! Description | |
− | + | |- | |
− | + | | format || csv-ts || Required to output the dataset in csv-ts format | |
+ | |- | ||
+ | | delimiter || comma | tab | semicolon | space <br/> default is comma || Defines which delimiter to use | ||
+ | |- | ||
+ | | labels || '''id''' or '''name''' or '''both''' <br/> default id || Defines if labels or ids should be used on output, if both is selected then there are 2 columns per coded component (one for Id one for the label) | ||
+ | |- | ||
+ | | dimensionAtObservation || [dimension id] <br/> default to TIME_PERIOD || ID of Dimension default if not provided is TIME_PERIOD | ||
+ | |- | ||
+ | | bom || '''include ''' or '''exclude''' || (Include or Exclude the [https://en.wikipedia.org/wiki/Byte_order_mark '''B'''yte '''O'''rder '''M'''ark] (BOM).<br/> The BOM helps Excel interpret non Latin characters when opening a CSV file) | ||
+ | |} | ||
<strong>Examples</strong> | <strong>Examples</strong> |
Revision as of 12:24, 29 October 2020
Overview
The Fusion-CSV-TS Data format predated SDMX-CSV and is not an official SDMX format. The format differs from both SDMX-CSV and Fusion-CSV as it does not output an observation per row, instead it outputs a Series per row with one output Dimension across the column.
The TS in the format name stands for Time Series, as the format originally output the series in the rows with time periods in the columns. However Fusion Registry v10.4.0 and higher support any dimension to be output across the columns, not just Time.
Example: Time Series
REF_AREA, INDICATOR, SUB_INDICATOR, FREQ, 2008, 2009, 2010 GHA, GCI, RANK, A, 102, 114, 114 GHA, GCI, VALUE, A, 3.6, 3.4, 3.5
Example - By SUB_INDICATOR
REF_AREA, INDICATOR, FREQ, TIME_PERIOD, RANK, VALUE GHA, GCI, A, 2008, 102, 3.6 GHA, GCI, A, 2009, 114, 3.4 GHA, GCI, A, 2010, 114, 3.5
The Dimension in the columns is controlled using the dimensionAtObservation REST query parameter, defaulting to Time if not provided.
Fusion-CSV-TS can be used as an export format for the Fusion Registry, and an export format for the Fusion Edge Server and Fusion Data Browser. Fusion-CSV-TS can not be used as a data import format.
Attributes
Note: The Fusion-CSV-TS Data format does not output observation or dataset Attributes, but it does output series Attributes. Series Attributes are determined by the Attribute Attachement level as defined in the Data Structure Definition (DSD). If the DSD defines an Attribute as varying with FREQ and REF_AREA, then this Attribute will be output unless either REF_AREA or FREQ are output as the Dimension at observation.
Parameters
The following URL parameters can be used in a RESTful query for Fusion-CSV-TS data.
Query Parameter | Values | Description |
---|---|---|
format | csv-ts | Required to output the dataset in csv-ts format |
delimiter | tab | semicolon | space default is comma |
Defines which delimiter to use |
labels | id or name or both default id |
Defines if labels or ids should be used on output, if both is selected then there are 2 columns per coded component (one for Id one for the label) |
dimensionAtObservation | [dimension id] default to TIME_PERIOD |
ID of Dimension default if not provided is TIME_PERIOD |
bom | include or exclude | (Include or Exclude the Byte Order Mark (BOM). The BOM helps Excel interpret non Latin characters when opening a CSV file) |
Examples
Breakdown by Time Series:
https://demo.metadatatechnology.com/FusionRegistry/ws/public/sdmxapi/rest/data/WB,GCI,1.0/GHA.GCI..?format=csv-ts&labels=both&delimiter=tab
Breakdown by Sub Indicator
https://demo.metadatatechnology.com/FusionRegistry/ws/public/sdmxapi/rest/data/WB,GCI,1.0/GHA.GCI..?format=csv-ts&labels=both&dimensionAtObservation=SUB_INDICATOR
Example Output
An example query using the format request parameters, HTTP Accept Headers can also be used to define the same format.
https://demo.metadatatechnology.com/FusionRegistry/ws/public/sdmxapi/rest/data/WB,GCI,1.0/GHA.GCI..?format=csv-ts&labels=both
An example dataset with IDs only, spaces have been added to this example to assist readability.
REF_AREA, INDICATOR, SUB_INDICATOR, FREQ, 2008, 2009, 2010 GHA, GCI, RANK, A, 102, 114, 114 GHA, GCI, VALUE, A, 3.6, 3.4, 3.5
The same dataset in Fusion-CSV with lables included. Note, labels columns are only included if the Dimension, Attribute, or Measure is Coded, if it is not, then only one column is output - this can be seen in the table below where both TIME_PERIOD and OBS_VALUE are only single columns.
REF_AREA, Reference Area, INDICATOR, Indicator, SUB_INDICATOR, Sub Indicator, FREQ, Frequency, 2008, 2009, 2010 GHA, Ghana, GCI, Global Competitiveness Index, RANK, Rank A, Annual, 102, 114, 114 GHA, Ghana, GCI, Global Competitiveness Index, VALUE, Value A, Annual, 3.6, 3.4, 3.5