Difference between revisions of "Fusion-CSV-TS"

From Fusion Registry Wiki
Jump to navigation Jump to search
(Parameters)
(Parameters)
 
(7 intermediate revisions by 2 users not shown)
Line 23: Line 23:
 
The Dimension in the columns is controlled using the '''dimensionAtObservation''' REST query parameter, defaulting to Time if not provided.
 
The Dimension in the columns is controlled using the '''dimensionAtObservation''' REST query parameter, defaulting to Time if not provided.
  
<b>Note:</b> The Fusion-CSV-TS Data format does not output observation 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.
+
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 BrowserFusion-CSV-TS can not be used as a data import format.
  
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 BrowserFusion-CSV-TS can not be used as a data import format.
+
'''Attributes'''<br>
 +
<b>Note:</b> 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=
 
=Parameters=
 
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.   
  
* format =csv-ts
+
{| class="wikitable"
* delimiter =comma | tab | semicolon | space (comma is default)
+
|-
* labels = id | name | both (id is default)
+
! Query Parameter !! Values !! Description
* dimensionAtObservation = ID of Dimension default if not provided is TIME_PERIOD
+
|-
 +
| 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
 +
|-
 +
| serieskey  || '''include ''' or '''exclude'''  <br/> default exclude  || If true, a series key column will be included in the output
 +
|-
 +
| 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>Example</strong>
+
<strong><u>Examples</u></strong><br>
 +
'''Breakdown by Time Series'''<br>
 
<i>https://demo.metadatatechnology.com/FusionRegistry/ws/public/sdmxapi/rest/data/WB,GCI,1.0/GHA.GCI..?format=csv-ts&labels=both&delimiter=tab</i>
 
<i>https://demo.metadatatechnology.com/FusionRegistry/ws/public/sdmxapi/rest/data/WB,GCI,1.0/GHA.GCI..?format=csv-ts&labels=both&delimiter=tab</i>
<br/>
+
<br><br>
 +
'''Breakdown by Time Series, include Series key'''<br>
 +
<i>https://demo.metadatatechnology.com/FusionRegistry/ws/public/sdmxapi/rest/data/WB,GCI,1.0/GHA.GCI..?format=csv-ts&labels=id&serieskey=include</i>
 +
<br><br>
 +
'''Breakdown by Sub Indicator'''<br>
 
<i>https://demo.metadatatechnology.com/FusionRegistry/ws/public/sdmxapi/rest/data/WB,GCI,1.0/GHA.GCI..?format=csv-ts&labels=both&dimensionAtObservation=SUB_INDICATOR</i>
 
<i>https://demo.metadatatechnology.com/FusionRegistry/ws/public/sdmxapi/rest/data/WB,GCI,1.0/GHA.GCI..?format=csv-ts&labels=both&dimensionAtObservation=SUB_INDICATOR</i>
 +
<br><br>
 +
'''One Row Per Observation'''<br>
 +
<i>https://demo.metadatatechnology.com/FusionRegistry/ws/public/sdmxapi/rest/data/WB,GCI,1.0/GHA.GCI..?format=csv-ts&labels=both&dimensionAtObservation=AllDimensions</i>
  
 
=Example Output=
 
=Example Output=

Latest revision as of 03:47, 4 February 2021

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
serieskey include or exclude
default exclude
If true, a series key column will be included in the output
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 Time Series, include Series key
https://demo.metadatatechnology.com/FusionRegistry/ws/public/sdmxapi/rest/data/WB,GCI,1.0/GHA.GCI..?format=csv-ts&labels=id&serieskey=include

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

One Row Per Observation
https://demo.metadatatechnology.com/FusionRegistry/ws/public/sdmxapi/rest/data/WB,GCI,1.0/GHA.GCI..?format=csv-ts&labels=both&dimensionAtObservation=AllDimensions

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