Difference between revisions of "Explain Plan Web Services"
(→'Explain Map' Web Service) |
(→'Explain Map' Web Service) |
||
Line 31: | Line 31: | ||
<p><b>401</b> - Unauthorized</p> | <p><b>401</b> - Unauthorized</p> | ||
<p><b>404</b> - Cannot resolve reference to Structure Map specified in URN parameter | <p><b>404</b> - Cannot resolve reference to Structure Map specified in URN parameter | ||
+ | |} | ||
+ | |||
+ | === HTTP Headers === | ||
+ | The following header parameters can be used to provide further details on the incoming dataset. If these details are not provided, the Fusion Registry will interrogate the dataset header to get the information. If the dataset is a non-SDMX format, or does not contain the required information in the header, then an error response will be returned. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !|HTTP Header || Purpose || Allowed Values | ||
+ | |- | ||
+ | |style="background-color:#eaecf0"|<b>URN</b> || <p>(Mandatory) Provides the structure to validate the data against.</p> | ||
+ | |||
+ | <p>This is optional as this information may be present in the header of the DataSet. If provided this value will override the value in the dataset (if present).</p> | ||
+ | || Valid SDMX URN for Provision Agreement, Dataflow, or Data Structure Definition | ||
+ | |- | ||
|} | |} | ||
Revision as of 01:34, 8 August 2023
Contents
Overview
Note: this is the explanation for the Web Services in Fusion Registry version 10.
The Registry has the User Interface feature "Test Mapping" which can be used to test an input file against a Mapping. This feature is very useful when debugging why a mapping did not occur. This page details how to directly call the Web Services that perform the explanation of a mapping
There are 2 Web Services. The firsts "explains" what series dimensions of an input file would be mapped and which would be unmapped with regards to a specifc Map, the second goes into detail abot a Series Key.
'Explain Map' Web Service
For the supplied file and the URN of the mapping structure, returns a JSON obejct stating which series were mapped and which were unmapped from the input.
Entry Point | ws/secure/structuremap/explainmap |
Access | Secure |
Authentication | HTTP Basic Authentication |
Http Method | POST |
Accepts | SDMX-ML, SDMX-JSON or SDMX-EDI structure message |
Content-Type | application/text or application/xml |
Response Format | JSON object |
Response Statuses | 200 - Query Ok
400 - Missing Header 'URN' or Unrecognised file input 401 - Unauthorized 404 - Cannot resolve reference to Structure Map specified in URN parameter |
HTTP Headers
The following header parameters can be used to provide further details on the incoming dataset. If these details are not provided, the Fusion Registry will interrogate the dataset header to get the information. If the dataset is a non-SDMX format, or does not contain the required information in the header, then an error response will be returned.
HTTP Header | Purpose | Allowed Values |
---|---|---|
URN | (Mandatory) Provides the structure to validate the data against. This is optional as this information may be present in the header of the DataSet. If provided this value will override the value in the dataset (if present). |
Valid SDMX URN for Provision Agreement, Dataflow, or Data Structure Definition |
The input must have a Header value of "URN" which states The output JSON object has 4 fields:
- source - the URN of the DSD or Dataflow that was used as the source of the mapping
- target - the URN of the DSD or Dataflow that was used as the target of the mapping
- mapped - a JSON object. Each field is a unique input key that mapped. For each field is a String stating what it mapped to.
- unmapped - a JSON Array of Strings showing which keys from the input were unmapped
Example Output
{ "source": "urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=MAPPING_TEST:DF_DSD1(1.0)", "target": "urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=MAPPING_TEST:DF_DSD2(1.0)", "mapped": { "A:B:BEL": "AAAB:BEL:FIXED_EER", "A:C:BEL": "AAAC:BEL:FIXED_EER", "XXX:C:BAR": "AACC:BAR:FIXED_EER" }, "unmapped": [ "C55BCX:C:BEL" ] }
'Explain Plan' Web Service
Given the supplied Key and Map, returns a JSON obejct stating the input, mappings and output for that series key
- Takes the parameters "dsd", "map", "key"
Entry Point | ws/secure/structuremap/explainplan |
Access | Secure |
Authentication | HTTP Basic Authentication |
Http Method | GET |
Response Format | JSON object |
Response Statuses | 200 - Success 401 - Unauthorized |