Difference between revisions of "SDMX-ML Generic Data"

From FMR Knowledge Base
Jump to navigation Jump to search
(Example Output)
Line 4: Line 4:
 
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 [https://www.w3.org/XML/ XML].
 
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 [https://www.w3.org/XML/ 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|Data Structure Definition]] that the data is being transmitted for.   
+
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|SDMX-ML Structure Specific]] data format has XML Elements and XML Attributes based on the [[Data_Structure_Definition|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.
 
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.

Revision as of 04:48, 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

The output below shows a snippet of the XML - displaying a series definition with three observation values

 		<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

The output below shows a snippet of the XML - displaying the two series returned from the query


	<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>