SDMX-JSON Data

From FMR Knowledge Base
Revision as of 02:46, 24 September 2020 by Glenn (talk | contribs) (Overview)
Jump to navigation Jump to search

Overview

The SDMX-JSON Data format is an official SDMX format. It is a based on the JSON Specification,

SDMX-JSON was introduced in version 2.1 of the SDMX Specification to satisfy the use case of web disemination. SDMX-JSON has a different structure to the XML formats (SDMX-ML Generic Data SDMX-ML Structure Specific Data) and importantly transmists both component codes and labels. This approach provides all the information required to display the data in a single JSON response, as opposed to the XML formats which require separate knowledge of the Structural Metadata in order to decode the data.

SDMX-JSON data can be used as both an import and export format for the Fusion Registry.

Formatting Using Query Parameters

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

  • format = sdmx-json

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

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

The output below shows the full dataset in SDMX-JSON format , the top part of the dataset contains pointers to the structure section, used to decode the dataset

		"dataSets": [
			{
				"links": [
					{
						"rel": "dataflow",
						"urn": "urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=WB:GCI(1.0)",
						"uri": "https://raw.githubusercontent.com/sdmx-twg/sdmx-json/develop/structure-message/tools/schemas/1.0/sdmx-json-structure-schema.json"
					}
				],
				"action": "Information",
				"series": {
					"0:0:0:0": {
						"attributes": [
						],
						"observations": {
							"0": [
								"102"
							],
							"1": [
								"114"
							],
							
......

		"structure": {
			"links": [
				{
					"rel": "dataflow",
					"urn": "urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=WB:GCI(1.0)",
					"uri": "https://raw.githubusercontent.com/sdmx-twg/sdmx-json/develop/structure-message/tools/schemas/1.0/sdmx-json-structure-schema.json"
				},
				{
					"rel": "datastructure",
					"urn": "urn:sdmx:org.sdmx.infomodel.datastructure.DataStructure=WB:GCI(1.0)",
					"uri": "https://raw.githubusercontent.com/sdmx-twg/sdmx-json/develop/structure-message/tools/schemas/1.0/sdmx-json-structure-schema.json"
				}
			],
			"name": "Global Competitiveness Index",
			"names": {
				"en": "Global Competitiveness Index"
			},
			"description": "Global Competitiveness Index",
			"descriptions": {
				"en": "Global Competitiveness Index"
			},
			"dimensions": {
				"dataset": [
				],
				"series": [
					{
						"id": "REF_AREA",
						"name": "Reference Area",
						"keyPosition": 0,
						"role": null,
						"values": [
							{
								"id": "GHA",
								"name": "Ghana"
							}
						]
					},