Difference between revisions of "SDMX-ML Generic Data"

From FMR Knowledge Base
Jump to navigation Jump to search
(Created page with "Category:SdmxDataFormat =Overview= The Generic Data format is an official SDMX format. It is known as one of the SDMX-ML formats, in that it is SDMX whose representation...")
 
(Example Output)
Line 25: Line 25:
 
An example dataset with IDs only, spaces have been added to this example to assist readability.
 
An example dataset with IDs only, spaces have been added to this example to assist readability.
 
<pre>
 
<pre>
<generic:Series>
+
<generic:Series>
  <generic:SeriesKey>
+
<generic:SeriesKey>
    <generic:Value id="REF_AREA" value="GHA"/>
+
<generic:Value id="REF_AREA" value="GHA"/>
    <generic:Value id="INDICATOR" value="GCI"/>
+
<generic:Value id="INDICATOR" value="GCI"/>
    <generic:Value id="SUB_INDICATOR" value="RANK"/>
+
<generic:Value id="SUB_INDICATOR" value="RANK"/>
    <generic:Value id="FREQ" value="A"/>
+
<generic:Value id="FREQ" value="A"/>
  </generic:SeriesKey>
+
</generic:SeriesKey>
  <generic:Obs>
+
<generic:Obs>
    <generic:ObsDimension value="2008"/>
+
<generic:ObsDimension value="2008"/>
    <generic:ObsValue value="102"/>
+
<generic:ObsValue value="102"/>
  </generic:Obs>
+
</generic:Obs>
    <generic:Obs>
+
<generic:Obs>
    <generic:ObsDimension value="2009"/>
+
<generic:ObsDimension value="2009"/>
    <generic:ObsValue value="114"/>
+
<generic:ObsValue value="114"/>
  </generic:Obs>
+
</generic:Obs>
    <generic:Obs>
+
<generic:Obs>
    <generic:ObsDimension value="2010"/>
+
<generic:ObsDimension value="2010"/>
    <generic:ObsValue value="114"/>
+
<generic:ObsValue value="114"/>
  </generic:Obs>
+
</generic:Obs>
 
.....
 
.....
 
</pre>
 
</pre>

Revision as of 04:46, 30 March 2020


Overview

The Generic Data format is an official SDMX format. It is known as one of the SDMX-ML formats, in that it is SDMX whose representation is in XML.

The use case for the Generic data format, over the other SDMX-ML formats, is that the XML Elements and XML Attributes are the same, regardless of the dataset. In contrast the SDMX-ML Structure Specific data format has XML Elements and XML Attributes based on the Data Structure Definition that the data is being transmitted for.

The SDMX-ML Generic format was introduced in version 1.0 of the SDMX Specification, and exists in all subsequent releases, up to the current release of version 2.1.

Formatting Using Query Parameters

The following URL parameters can be used in a RESTful query for to get Generic data.

  • format = sdmx-generic-2.1
  • format = sdmx-generic-2.0
  • format = sdmx-generic-1.0

Example https://demo.metadatatechnology.com/FusionRegistry/ws/public/sdmxapi/rest/data/WB,GCI,1.0/GHA.GCI..?format=sdmx-generic-2.1

Note: The same formatting can be applied using HTTP Accept Headers as opposed to query parameters.

Example Output

https://demo.metadatatechnology.com/FusionRegistry/ws/public/sdmxapi/rest/data/WB,GCI,1.0/GHA.GCI..?format=sdmx-generic-2.1


An example dataset with IDs only, spaces have been added to this example to assist readability.

 		<generic:Series>
			<generic:SeriesKey>
				<generic:Value id="REF_AREA" value="GHA"/>
				<generic:Value id="INDICATOR" value="GCI"/>
				<generic:Value id="SUB_INDICATOR" value="RANK"/>
				<generic:Value id="FREQ" value="A"/>
			</generic:SeriesKey>
			<generic:Obs>
				<generic:ObsDimension value="2008"/>
				<generic:ObsValue value="102"/>
			</generic:Obs>
			<generic:Obs>
				<generic:ObsDimension value="2009"/>
				<generic:ObsValue value="114"/>
			</generic:Obs>
			<generic:Obs>
				<generic:ObsDimension value="2010"/>
				<generic:ObsValue value="114"/>
			</generic:Obs>
.....


An example dataset with the returned detail set to series keys only - fewer columns are written to the response.
https://demo.metadatatechnology.com/FusionRegistry/ws/public/sdmxapi/rest/data/WB,GCI,1.0/GHA.GCI..?format=sdmx-generic-2.1&detail=serieskeysonly


	<generic:Series>
		<generic:SeriesKey>
			<generic:Value id="REF_AREA" value="GHA"/>
			<generic:Value id="INDICATOR" value="GCI"/>
			<generic:Value id="SUB_INDICATOR" value="RANK"/>
			<generic:Value id="FREQ" value="A"/>
		</generic:SeriesKey>
	</generic:Series>
	<generic:Series>
		<generic:SeriesKey>
			<generic:Value id="REF_AREA" value="GHA"/>
			<generic:Value id="INDICATOR" value="GCI"/>
			<generic:Value id="SUB_INDICATOR" value="VALUE"/>
			<generic:Value id="FREQ" value="A"/>
		</generic:SeriesKey>
	</generic:Series>