diff --git a/README.md b/README.md index d86eab8..e2ba698 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ This repository is used for maintaining the SDMX-JSON messages specifications. This includes: -- Normative documentation, samples and tools for the SDMX-JSON data message. -- Prototypes for the SDMX-JSON structure message. +- Normative documentation, samples and tools for the SDMX-JSON data message format. +- Prototype for the SDMX-JSON structure message format. +- Prototype for the SDMX-JSON metadata message format. - [Wiki](https://github.com/sdmx-twg/sdmx-json/wiki) for additional information diff --git a/data-message/docs/0-status.md b/data-message/docs/0-status.md index 969c0cc..3281d4c 100644 --- a/data-message/docs/0-status.md +++ b/data-message/docs/0-status.md @@ -3,18 +3,7 @@ *This section describes the status of this document at the time of its publication. Other documents may supersede this document.* -This is a SDMX Candidate Technical Standard for SDMX-JSON Data Message. It is -made available for review by the SDMX user community and the public. The public -review period for this document extends until November 31 2015 in order to allow -time for implementation. - -Please send your comments to the SDMX Technical Working Group (SDMX-TWG) . -Each email message should contain only one comment. Pull request can also be be submitted to -the GitHub repository . All feedback is welcome. - -Publication as a Candidate Technical Standard does not imply endorsement by the -SDMX Sponsors. This is a draft document and may be updated, replaced or obsoleted by other -documents at any time. +This is the released SDMX Technical Standard for SDMX-JSON Data Message. This document has been produced by the SDMX-TWG. The authors of this document are the members of the SDMX-TWG. Different parts of this specification have @@ -25,4 +14,4 @@ different editors. \null \vfill -© SDMX 2014 http://www.sdmx.org/ +© SDMX 2014-2019 http://www.sdmx.org/ diff --git a/data-message/docs/1-sdmx-json-field-guide.md b/data-message/docs/1-sdmx-json-field-guide.md index 68af69d..cca51bd 100644 --- a/data-message/docs/1-sdmx-json-field-guide.md +++ b/data-message/docs/1-sdmx-json-field-guide.md @@ -1,4 +1,4 @@ -# Introduction +# Introduction to SDMX-JSON Data Message Let's first start with a brief introduction of the SDMX information model. @@ -39,7 +39,7 @@ nulled field and the absence of a field as the same thing. - Not all fields appear in all contexts. For example response with error messages may not contain fields for data, dimensions and attributes. -# Field Guide to SDMX-JSON Objects +# Field Guide to SDMX-JSON Data Message Objects ## message @@ -77,11 +77,15 @@ Any members MAY be specified within `meta` objects. * id - *String*. Unique string that identifies the message for further references. * test - *Boolean* *optional*. Indicates whether the message is for test purposes or not. False for normal messages. * prepared - *String*. A timestamp indicating when the message was prepared. Values must follow the ISO 8601 syntax for combined dates and times, including time zone. -* content-languages - *Array* *optional*. Array of strings containing the identifyer of all languages used anywhere in the message for localized elements, and thus the languages of the intended audience, representaing in an array format the same information than the http Content-Language response header, e.g. "en, fr-fr". See IETF Language Tags: https://tools.ietf.org/html/rfc5646#section-2.1. The array's first element indicates the main language used in the message for localized elements. **The usage of this property is recommended.** Consult the section on [localised strings](#localised-strings) on how the message deals with languages. +* contentLanguages - *Array* *optional*. Array of strings containing the identifyer of all languages used anywhere in the message for localized elements, and thus the languages of the intended audience, representaing in an array format the same information than the http Content-Language response header, e.g. "en, fr-fr". See IETF Language Tags: https://tools.ietf.org/html/rfc5646#section-2.1. The array's first element indicates the main language used in the message for localized elements. **The usage of this property is recommended.** +* name - *String* *optional*. Human-readable (best-language-match) name for the transmission. +* names - *Object* *optional*. Human-readable localised *[names](#names)* for the transmission. * sender - *Object*. *[Sender](#sender)* contains information about the party that is transmitting the message. * receivers - *Array* *optional* of *[Receiver](#receiver)* objects thats contain information about the party that is receiving the message. This can be useful if the WS requires authentication. * links - *Array* *optional*. *Links* field is an array of *[link](#link)* objects. If appropriate, a collection of links to additional external resources for the header. +See the section on [localised text elements](#localised-text-elements) on how the message deals with languages. + Example: "meta": { @@ -90,8 +94,12 @@ Example: "id": "b1804c51-1ee3-45a9-bb75-795cd4e06489", "prepared": "2018-01-03T12:54:12", "test": false, - "content-languages": [ "en", "fr-fr" ], - "sender: { + "contentLanguages": [ "en", "fr-fr" ], + "name": "Transmission name", + "names": { + # name object # + }, + "sender": { # sender object # }, "receivers": [ @@ -112,16 +120,19 @@ Example: Sender contains the following fields: * id - *String*. A unique identifier of the party. -* name - *Object* *optional*. A list of human-readable localised *[names](#name)* of the sender. See the section on [localised strings](#localised-strings) on how the message deals with languages. +* name - *String* *nullable*. A human-readable (best-language-match) name of the sender. +* names - *Object* *optional*. A list of human-readable localised *[names](#names)* of the sender. * contacts - *Array* *optional*. A collection of *[contacts](#contact)*. Provides contact information for the party in regard to the transmission of the message. +See the section on [localised text elements](#localised-text-elements) on how the message deals with languages. + Example: "sender": { "id": "ECB", - “name”: { - # name object # - }, + "name": "European Central Bank", + "names": { "en": "European Central Bank", + "fr": "Banque Centrale Européenne" }, "contacts": [ { # contact objects # @@ -129,13 +140,13 @@ Example: ] } -#### name +#### names -*Object* containing all returned localised names, one per object property: +*Object* containing all appropriate localised names, one per object property: * One or more of: IETF Language Tag according to [RFC 5646 documentation](https://tools.ietf.org/html/rfc5646#section-2.1) for specifying locals in HTTP - *String*. The localised name. -See the section on [localised strings](#localised-strings) on how the message deals with languages. +See the section on [localised text elements](#localised-text-elements) on how the message deals with languages. Example: @@ -151,24 +162,33 @@ Example: may contain the following field: * id - *String*. Identifier for the resource. -* name - *Object* *optional*. Human-readable localised *[names](#name)* of the contact. -* department - *Object* *optional*. Human-readable localised *[names](#name)* of the organisational structure for the contact. -* role - *Object* *optional*. Human-readable localised *[names](#name)* of the responsibility of the contact. +* name - *String* *optional*. Human-readable (best-language-match) name of the contact. +* names - *Object* *optional*. Human-readable localised *[names](#names)* of the contact. +* department - *String* *optional*. Human-readable (best-language-match) name of the organisational structure for the contact. +* departments - *Object* *optional*. Human-readable localised *[names](#names)* of the organisational structure for the contact. +* role - *String* *optional*. Human-readable (best-language-match) name of the responsibility of the contact. +* roles - *Object* *optional*. Human-readable localised *[names](#names)* of the responsibility of the contact. * telephones - *Array* *optional*. An array of telephone numbers for the contact. * faxes - *Array* *optional*. An array of fax numbers for the contact person. * uris - *Array* *optional*. An array of uris. Each uri holds an information URL for the contact. * emails - *Array* *optional*. An array of email addresses for the contact person. * x400s - *Array* *optional*. An array of X.400 addresses for the contact person. -See the section on [localised strings](#localised-strings) on how the message deals with languages. +See the section on [localised text elements](#localised-text-elements) on how the message deals with languages. Example: { "id": "HOTLINE", - "name": { "en": "Statistics hotline" }, - "department": { "en": "Statistics hotline" }, - "role": { "en": "Statistics hotline" }, + "name": "Statistics hotline", + "names": { "en": "Statistics hotline", + "fr": "Service d'assistance téléphonique des Statistiques" }, + "department": "Statistics hotline", + "departments": { "en": "Statistics hotline", + "fr": "Service d'assistance téléphonique des Statistiques" }, + "role": "Statistics hotline", + "roles": { "en": "Statistics hotline", + "fr": "Service d'assistance téléphonique des Statistiques"}, "telephones": [ "+00 0 00 00 00 00" ], "faxes": [ "+00 0 00 00 00 01" ], "uris": [ "www.xyz.org" ], @@ -299,8 +319,10 @@ as well as the list of `values` used in the message for this particular componen Each of the components may contain the following fields: * id - *String*. Identifier for the component. -* name - *Object* *optional*. Human-readable localised *[names](#name)* for the component. -* description - *Object* *optional*. Human-readable localised descriptions (see *[names](#name)*) for the component. +* name - *String* *optional*. Human-readable (best-language-match) name for the component. +* names - *Object* *optional*. Human-readable localised *[names](#names)* for the component. +* description - *String* *optional*. Human-readable (best-language-match) description for the component. +* descriptions - *Object* *optional*. Human-readable localised descriptions (see *[names](#names)*) for the component. * keyPosition - *Number*. **This field is mandatory for `dimensions` but not to be supplied for `attributes`.** Indicates the position of the `dimension` in the Data Structure Definition, starting at 0. It needs to be provided also for the special `dimensions` such as Time or Measure dimensions. The information in this field is consistent with the order of `dimensions` in the "key" parameter string (i.e. D.USD.EUR.SP00.A) for data queries in the SDMX API. * roles - *Array* of *String*s *optional*. Defines the component role(s), if any. Roles are represented by the id of a concept defined as [SDMX cross-domain concept](https://sdmx.org/wp-content/uploads/01_sdmx_cog_annex_1_cdc_2009.pdf). Several of the concepts defined as SDMX cross-domain concepts are useful for data visualisation, such as for example, the series title ("TITLE"), the unit of measure ("UNIT_MEASURE"), the number of decimals to be displayed ("DECIMALS"), the country or geographic reference area ("REF_AREA", e.g. when using maps), the period of time to which the measured observation refers ("REF_PERIOD"), the time interval at which observations occur over a given time period ("FREQ"), etc. It is strongly recommended to identify any component that can be useful for data visualisation purposes by using the appropriate SDMX cross-domain concept as role. * relationship - *Object*. **This field is mandatory for `attributes` but not to be supplied for `dimensions`.** *[Attribute relationship](#attribute-relationship)* describes how the value of this attribute varies with the values of other components. This relationship expresses the attachment level of the attribute as defined in the data structure definition. Depending on the message context (especially the data query) an attribute value can however be attached physically in the message at a different level. @@ -309,14 +331,18 @@ Each of the components may contain the following fields: * annotations - *Array* *optional*. *[Annotations](#annotation)* is a collection of indices of the corresponding *annotations* for the component. Indices refer back to the array of *annotations* in the structure field. * values - *Array*. *Values* field is an array of *[component value](#component-value)* objects. Note that `dimensions` and `attributes` presented at `dataSet` level can only have one single component value. -See the section on [localised strings](#localised-strings) on how the message deals with languages. +See the section on [localised text elements](#localised-text-elements) on how the message deals with languages. Example: { "id": "FREQ", - "name": { "en": "Frequency" }, - "description": { "en": "The time interval at which observations occur over a given time period." }, + "name": "Frequency", + "names": { "en": "Frequency", + "fr": "Fréquence" }, + "description": "The time interval at which observations occur over a given time period.", + "descriptions": { "en": "The time interval at which observations occur over a given time period.", + "fr": "L'intervalle de temps avec lequel les observations sont faites sur une période donnée." }, "keyPosition": 0, "role": [ "FREQ" ], "default": "A", @@ -335,8 +361,12 @@ Example: { "id": "SOURCE", - "name": { "en": "Source" }, - "description": { "en": "The source of the data depending on the time period." }, + "name": "Source", + "names": { "en": "Source", + "fr": "Source" }, + "description": "The source of the data depending on the time period.", + "descriptions": { "en": "The source of the data depending on the time period.", + "fr": "La source des données dependante de la période de temps." }, "relationship": { # attribute-relationship object # }, @@ -391,22 +421,28 @@ See the section on [linking mechanism](#linking-mechanism) for all information o *Object* *optional*. A particular value for a component in a message. * id - *String*. Unique identifier for a component value. -* name - *Object* *optional*. Human-readable localised *[names](#name)* for the component value. -* description - *Object* *optional*. Human-readable localised descriptions (see *[names](#name)*) of the component value. The description is typically longer than the text provided for the name field. +* name - *String* *optional*. Human-readable (best-language-match) name for the component value. +* names - *Object* *optional*. Human-readable localised *[names](#names)* for the component value. +* description - *String* *optional*. Human-readable (best-language-match) description for the component value. The description is typically longer than the text provided for the name field. +* descriptions - *Object* *optional*. Human-readable localised descriptions (see *[names](#names)*) for the component value. A descriptions is typically longer than the text provided for the name field. * start, end - *String* *optional*. Start and end are instances of time that define the actual Gregorian calendar period covered by the values for the time dimension. The algorithm for computing start and end fields for any supported reporting period is defined in the SDMX Technical Notes. These fields should be used only when the component value represents one of the values for the time dimension. Values are considered as inclusive both for the start field and the end field. Values must follow the ISO 8601 syntax for combined dates and times, including time zone. These fields are useful for visualisation tools, when selecting the appropriate point in time for the time axis. Statistical data, can be collected, for example, at the beginning, the middle or the end of the period, or can represent the average of observations through the period. Based on this information and using the start and end fields, it is easy to get or calculate the desired point in time to be used for the time axis. * parent - *String* *optional*. Contains the ID for the parent of the component value (the component value of the parent might also be present in the message if according observations are also returned). * order - *Integer* *optional*. Contains the original order number of the component value enabling the reconstruction of the ordered component value hierarchy. Note that, to allow for a streamed message generation, the orders of observations and of component values in the component value array are not significant. * links - *Array* *optional*. *Links* field is an array of *[link](#link)* objects. If appropriate, a collection of links to additional information regarding the component value. * annotations - *Array* *optional*. *[Annotations](#annotation)* is a collection of indices of the corresponding *annotations* for the component value. Indices refer back to the array of *annotations* in the structure field. -See the section on [localised strings](#localised-strings) on how the message deals with languages. +See the section on [localised text elements](#localised-text-elements) on how the message deals with languages. Example: { "id": "2010", - "name": { "en": "2010" }, - "description": { "en": "Description for 2010." }, + "name": "2010", + "names": { "en": "2010", + "fr": "2010" }, + "description": "Description for 2010.", + "descriptions": { "en": "Description for 2010.", + "fr": "Déscription pour 2010." }, "start": "2010-01-01T00:00Z", "end": "2010-12-31T23:59:59Z", "parent": "T", @@ -430,17 +466,20 @@ See the section on [linking mechanism](#linking-mechanism) for all information o * id - *String* *optional*. ID provides a non-standard identification of an annotation. It can be used to disambiguate annotations. * title - *String* *optional*. Provides a non-localised title for the annotation. * type - *String* *optional*. Type is used to distinguish between annotations designed to support various uses. The types are not enumerated, and these can be freely specified by the creator of the annotations. The definitions and use of annotation types should be documented by their creator. -* text - *Object* *optional*. A list of human-readable localised texts (see *[names](#name)*) of the annotation. +* text - *String* *optional*. A human-readable (best-language-match) text of the annotation. +* texts - *Object* *optional*. A list of human-readable localised texts (see *[names](#names)*) of the annotation. * links - *Array* *optional*. *Links* field is an array of *[link](#link)* objects. If appropriate, a link to an additional external resource which may contain or supplement the annotation. -See the section on [localised strings](#localised-strings) on how the message deals with languages. +See the section on [localised text elements](#localised-text-elements) on how the message deals with languages. Example: { "title": "Sample annotation", "type": "reference", - "text": { "en": "Sample annotation text" }, + "text": "Sample annotation text", + "texts": { "en": "Sample annotation text", + "fr": "Exemple de texte d'annotation" }, "id": "74747", "links": [ { @@ -483,10 +522,10 @@ or cross sections, the `observations` will be found under the `series` elements. The `dataSet` properties are: * action - *String* *optional*. Action provides a list of actions, describing the intention of the data transmission from the sender's side. -- `Append` - this is an incremental update for an existing `dataSet` or the provision of new data or documentation (attribute values) formerly absent. If any of the supplied data or metadata is already present, it will not replace these data. -- `Replace` - data are to be replaced, and may also include additional data to be appended. -- `Delete` - data are to be deleted. -- `Information` (default) - data are being exchanged for informational purposes only, and not meant to update a system. + - `Append` - this is an incremental update for an existing `dataSet` or the provision of new data or documentation (attribute values) formerly absent. If any of the supplied data or metadata is already present, it will not replace these data. + - `Replace` - data are to be replaced, and may also include additional data to be appended. + - `Delete` - data are to be deleted. + - `Information` (default) - data are being exchanged for informational purposes only, and not meant to update a system. * reportingBegin - *String* *optional*. The start of the time period covered by the message. * reportingEnd - *String* *optional*. The end of the time period covered by the message. * validFrom - *String* *optional*. The validFrom indicates the inclusive start time indicating the validity of the information in the data. @@ -621,25 +660,30 @@ Example: "series": [ { "id": "DIM1", - "name": { "en": "Dimension 1" }, + "name": "Dimension 1", + "names": { "en": "Dimension 1" }, "values": [ { "id": "DIM1_VALUE_1", - "name": { "en": "Dimension 1 - Value 1 with index 0" } + "name": "Dimension 1 - Value 1 with index 0", + "names": { "en": "Dimension 1 - Value 1 with index 0" } } ] }, { "id": "DIM2", - "name": { "en": "Dimension 2" }, + "name": "Dimension 2", + "names": { "en": "Dimension 2" }, "values": [ { "id": "DIM2_VALUE_1", - "name": { "en": "Dimension 2 - Value 1 with index 0" } + "name": "Dimension 2 - Value 1 with index 0", + "names": { "en": "Dimension 2 - Value 1 with index 0" } }, { "id": "DIM2_VALUE_2", - "name": { "en": "Dimension 2 - Value 2 with index 1" } + "name": "Dimension 2 - Value 2 with index 1", + "names": { "en": "Dimension 2 - Value 2 with index 1" } } ] } @@ -647,15 +691,18 @@ Example: "observation": [ { "id": "TIME_PERIOD", - "name": { "en": "Time Period" }, + "name": "Time Period", + "names": { "en": "Time Period" }, "values": [ { "id": "2016", - "name": { "en": "2016" } + "name": "2016", + "names": { "en": "2016" } }, { "id": "2017", - "name": { "en": "2017" } + "name": "2017", + "names": { "en": "2017" } } ] } @@ -666,26 +713,31 @@ Example: "series": [ { "id": "ATTR1", - "name": { "en": "Attribute 1" }, + "name": "Attribute 1", + "names": { "en": "Attribute 1" }, "default": "ATTR1_VALUE_1", "values": [ { "id": "ATTR1_VALUE_1", - "name": { "en": "Attribute 1 - Value 1 with index 0" } + "name": "Attribute 1 - Value 1 with index 0", + "names": { "en": "Attribute 1 - Value 1 with index 0" } }, { "id": "ATTR1_VALUE_2", - "name": { "Attribute 1 - Value 2 with index 1" } + "name": "Attribute 1 - Value 2 with index 1", + "names": { "Attribute 1 - Value 2 with index 1" } } ] }, { "id": "ATTR2", - "name": { "en": "Attribute 2" }, + "name": "en": "Attribute 2", + "names": { "en": "Attribute 2" }, "values": [ { "id": "ATTR2_VALUE_1", - "name": { "en": "Attribute 2 - Value 1 with index 0" } + "name": "Attribute 2 - Value 1 with index 0", + "names": { "en": "Attribute 2 - Value 1 with index 0" } } ] } @@ -693,16 +745,19 @@ Example: "observation": [ { "id": "ATTR3", - "name": { "en": "Attribute 3" }, + "name": "Attribute 3", + "names": { "en": "Attribute 3" }, "default": "ATTR3_VALUE_2", "values": [ { "id": "ATTR3_VALUE_1", - "name": { "en": "Attribute 3 - Value 1 with index 0" } + "name": "Attribute 3 - Value 1 with index 0", + "names": { "en": "Attribute 3 - Value 1 with index 0" } }, { "id": "ATTR3_VALUE_2", - "name": { "en": "Attribute 3 - Value 2 with index 1" } + "name": "Attribute 3 - Value 2 with index 1", + "names": { "en": "Attribute 3 - Value 2 with index 1" } } ] } @@ -712,7 +767,8 @@ Example: { "title": "Annotation 1 - with index 0", "type": "example", - "text": { "en": "Sample annotation text" }, + "text": "Sample annotation text", + "texts": { "en": "Sample annotation text" }, "id": "ANNOT_VALUE1" } ] @@ -791,25 +847,30 @@ Example: "observation": [ { "id": "DIM1", - "name": { "en": "Dimension 1" }, + "name": "Dimension 1", + "names": { "en": "Dimension 1" }, "values": [ { "id": "DIM1_VALUE_1", - "name": { "en": "Dimension 1 - Value 1 with index 0" } + "name": "Dimension 1 - Value 1 with index 0", + "names": { "en": "Dimension 1 - Value 1 with index 0" } } ] }, { "id": "DIM2", - "name": { "en": "Dimension 2" }, + "name": "Dimension 2", + "names": { "en": "Dimension 2" }, "values": [ { "id": "DIM2_VALUE_1", - "name": { "en": "Dimension 2 - Value 1 with index 0" } + "name": "Dimension 2 - Value 1 with index 0", + "names": { "en": "Dimension 2 - Value 1 with index 0" } }, { "id": "DIM2_VALUE_2", - "name": { "en": "Dimension 2 - Value 2 with index 1" } + "name": "Dimension 2 - Value 2 with index 1", + "names": { "en": "Dimension 2 - Value 2 with index 1" } } ] } @@ -821,26 +882,31 @@ Example: "observation": [ { "id": "ATTR1", - "name": { "en": "Attribute 1" }, + "name": "Attribute 1", + "names": { "en": "Attribute 1" }, "values": [ { "id": "ATTR1_VALUE_1", - "name": { "en": "Attribute 1 - Value 1 with index 0" } + "name": "Attribute 1 - Value 1 with index 0", + "names": { "en": "Attribute 1 - Value 1 with index 0" } }, { "id": "ATTR1_VALUE_2", - "name": { "en": "Attribute 1 - Value 2 with index 1" } + "name": "Attribute 1 - Value 2 with index 1", + "names": { "en": "Attribute 1 - Value 2 with index 1" } } ] }, { "id": "ATTR2", - "name": { "en": "Attribute 2" }, + "name": "Attribute 2", + "names": { "en": "Attribute 2" }, "default": "ATTR2_VALUE_1", "values": [ { "id": "ATTR2_VALUE_1", - "name": { "en": "Attribute 2 - Value 1 with index 0" } + "name": "Attribute 2 - Value 1 with index 0", + "names": { "en": "Attribute 2 - Value 1 with index 0" } } ] } @@ -850,7 +916,8 @@ Example: { "title": "Annotation 1 - with index 0", "type": "example", - "text": { "en": "Sample annotation text" }, + "text": "Sample annotation text", + "texts": { "en": "Sample annotation text" }, "id": "ANNOT_VALUE1" } ] @@ -865,17 +932,21 @@ to RESTful web services HTTP error status codes. The following pieces of information are to be provided: * code - *Number*. Provides a code number for the error message. Code numbers are defined in the SDMX 2.1 Web Services Guidelines. -* title - *Object* *optional*. A list of short, human-readable localised summary (see *[names](#name)*) of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization. -* detail - *Object* *optional*. A list of human-readable localised explanations (see *[names](#name)*) specific to this occurrence of the problem. Like title, this field’s value can be localized. It is fully customizable by the service providers and should provide enough detail to ease understanding the reasons of the error. +* title - *String* *optional*. A short, human-readable (best-language-match) summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization. +* titles - *Object* *optional*. A list of short, human-readable localised summaries (see *[names](#names)*) of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization. +* detail - *String* *optional*. A human-readable (best-language-match) explanation specific to this occurrence of the problem. Like title, this field’s value can be localized. It is fully customizable by the service providers and should provide enough detail to ease understanding the reasons of the error. +* details - *Object* *optional*. A list of human-readable localised explanations (see *[names](#names)*) specific to this occurrence of the problem. Like titles, this field’s value can be localized. It is fully customizable by the service providers and should provide enough detail to ease understanding the reasons of the error. * links - *Array* *optional*. *Links* field is an array of *[link](#link)* objects. If appropriate, a collection of links to additional external resources for the error. -See the section on [localised strings](#localised-strings) on how the message deals with languages. +See the section on [localised text elements](#localised-text-elements) on how the message deals with languages. Example: { "code": 150, - "title": { "en": "Invalid number of dimensions in the key parameter" } + "title": "Invalid number of dimensions in the key parameter", + "titles": { "en": "Invalid number of dimensions in the key parameter" + "fr": "Nombre invalide de dimensions dans le paramètre 'key'" } } # Linking mechanism @@ -888,10 +959,13 @@ Example: * rel - *String*. Relationship of the object to the external resource. See semantics below. * urn - *String* *optional*. The urn holds a valid SDMX Registry URN (see SDMX Registry Specification for details). * uri - *String* *optional*. The uri attribute holds a URI that contains a link to additional information about the resource, such as a web page. This uri is not an SDMX resource. -* title - *Object* *optional*. A list of human-readable localised descriptions (see *[names](#name)*) of the target link. See the section on [localised strings](#localised-strings) on how the message deals with languages. +* title - *String* *optional*. A human-readable (best-language-match) description of the target link. +* titles - *Object* *optional*. A list of human-readable localised descriptions (see *[names](#names)*) of the target link. * type - *String* *optional*. A hint about the type of representation returned by the link. * hreflang - *String* *optional*. The natural language of the external link, the same as used in the HTTP Accept-Language request header. +See the section on [localised text elements](#localised-text-elements) on how the message deals with languages. + Examples: { @@ -914,7 +988,8 @@ Examples: { "href": "https://registry.sdmx.org/help.html", "rel": "help", - "title": { "en": "Documentation about the SDMX Global Registry" }, + "title": "Documentation about the SDMX Global Registry", + "titles": { "en": "Documentation about the SDMX Global Registry" }, "type": "text/html", "hreflang": "en" } @@ -949,45 +1024,53 @@ Let's say that the following data content of a message needs to be processed: "dataSet": [ { "id": "FREQ", - "name": { "en": "Frequency" }, + "name": "Frequency", + "names": { "en": "Frequency" }, "keyPosition": 0, "values": [ { "id": "D", - "name": { "en": "Daily" } + "name": "Daily", + "names": { "en": "Daily" } } ] }, { "id": "CURRENCY_DENOM", - "name": { "en": "Currency denominator" }, + "name": "Currency denominator", + "names": { "en": "Currency denominator" }, "keyPosition": 2, "values": [ { "id": "EUR", - "name": { "en": "Euro" } + "name": "Euro", + "names": { "en": "Euro" } } ] }, { "id": "EXR_TYPE", - "name": { "en": "Exchange rate type" }, + "name": "Exchange rate type", + "names": { "en": "Exchange rate type" }, "keyPosition": 3, "values": [ { "id": "SP00", - "name": { "en": "Spot rate" } + "name": "Spot rate", + "names": { "en": "Spot rate" } } ] }, { "id": "EXR_SUFFIX", - "name": { "en": "Series variation - EXR context" }, + "name": "Series variation - EXR context", + "names": { "en": "Series variation - EXR context" }, "keyPosition": 4, "values": [ { "id": "A", - "name": { "en": "Average or standardised measure" } + "name": "Average or standardised measure", + "names": { "en": "Average or standardised measure" } } ] } @@ -995,15 +1078,18 @@ Let's say that the following data content of a message needs to be processed: "series": [ { "id": "CURRENCY", - "name": { "en": "Currency" }, + "name": "Currency", + "names": { "en": "Currency" }, "keyPosition": 1, "values": [ { "id": "NZD", - "name": { "en": "New Zealand dollar" } + "name": "New Zealand dollar", + "names": { "en": "New Zealand dollar" } }, { "id": "RUB", - "name": { "en": "Russian rouble" } + "name": "Russian rouble", + "names": { "en": "Russian rouble" } } ] } @@ -1011,14 +1097,17 @@ Let's say that the following data content of a message needs to be processed: "observation": [ { "id": "TIME_PERIOD", - "name": { "en": "Time period or range" }, + "name": "Time period or range", + "names": { "en": "Time period or range" }, "values": [ { "id": "2013-01-18", - "name": { "en": "2013-01-18" } + "name": "2013-01-18", + "names": { "en": "2013-01-18" } }, { "id": "2013-01-21", - "name": { "en": "2013-01-21" } + "name": "2013-01-21", + "names": { "en": "2013-01-21" } } ] } @@ -1029,11 +1118,14 @@ Let's say that the following data content of a message needs to be processed: "series": [ { "id": "TITLE", - "name": { "en": "Series title" }, + "name": "Series title", + "names": { "en": "Series title" }, "values": [ { - "name": { "en": "New zealand dollar (NZD)" } + "name": "New zealand dollar (NZD)", + "names": { "en": "New zealand dollar (NZD)" } }, { + "name": "Russian rouble (RUB)", "name": { "en": "Russian rouble (RUB)" } } ] @@ -1042,11 +1134,13 @@ Let's say that the following data content of a message needs to be processed: "observation": [ { "id": "OBS_STATUS", - "name": { "en": "Observation status" }, + "name": "Observation status", + "names": { "en": "Observation status" }, "values": [ { "id": "A", - "name": { "en": "Normal value" } + "name": "Normal value", + "names": { "en": "Normal value" } } ] } @@ -1056,13 +1150,15 @@ Let's say that the following data content of a message needs to be processed: { "title": "Sample series annotation title", "type": "example", - "text": { "en": "Sample series annotation text" }, + "text": "Sample series annotation text", + "texts": { "en": "Sample series annotation text" }, "id": "ABC123456" }, { "title": "Sample observation annotation title", "type": "example", - "text": { "en": "Sample observation annotation text" }, + "text": "Sample observation annotation text", + "texts": { "en": "Sample observation annotation text" }, "id": "XYZ98765" } ] @@ -1127,14 +1223,17 @@ the (only) series dimension. { "id": "CURRENCY", "name": "Currency", + "names": { "en": "Currency" }, "keyPosition": 1, "values": [ { "id": "NZD", - "name": { "en": "New Zealand dollar" } + "name": "New Zealand dollar", + "names": { "en": "New Zealand dollar" } }, { "id": "RUB", - "name": { "en": "Russian rouble" } + "name": "Russian rouble", + "names": { "en": "Russian rouble" } } ] } @@ -1156,14 +1255,17 @@ TIME_PERIOD is the (only) dimension at `observation` level. "observation": [ { "id": "TIME_PERIOD", - "name": { "en": "Time period or range" }, + "name": "Time period or range", + "names": { "en": "Time period or range" }, "values": [ { "id": "2013-01-18", - "name": { "en": "2013-01-18" } + "name": "2013-01-18", + "names": { "en": "2013-01-18" } }, { "id": "2013-01-21", - "name": { "en": "2013-01-21" } + "name": "2013-01-21", + "names": { "en": "2013-01-21" } } ] } @@ -1186,11 +1288,13 @@ OBS_STATUS is the (only) attribute at `observation` level. "observation": [ { "id": "OBS_STATUS", - "name": { "en": "Observation status" }, + "name": "Observation status", + "names": { "en": "Observation status" }, "values": [ { "id": "A", - "name": { "en": "Normal value" } + "name": "Normal value", + "names": { "en": "Normal value" } } ] } @@ -1203,15 +1307,40 @@ is therefore "Normal value". The same logic applies for mapping the other observations, its attributes and annotations. -# Localised strings +# Localised text elements + +**Localised best-language-match text strings (static properties matched through "Lookup"):** + +The first best language match according to the user’s preferred language choices expressed through the HTTP content negotiation (Accept-Language header parameter) is to be provided for each localised text element. The message does however not indicate the returned language per localised text element. + +This language matching type is called "Lookup", see . + +Example: + + "name": "Frequency", + +**Localised text objects (variable properties matched through "Filtering"):** + +All available language matches according to the user’s preferred language choices expressed through the HTTP content negotiation (Accept-Language header parameter) is to be provided for each localised text element. + +This language matching type is called "Filtering", see . + +Example: + + "names": { "en": "Frequency", + "fr": "Fréquence" }, + + +The localised text object needs to be present whenever the related localised best-language-match text strings is present, and especially whenever a localised text is mandatory in the SDMX Information model. Note that localised text (and the knowledge about the locale) is mandatory in structure messages when artefacts are being submitted for storage to a registry or to other databases. The localised text object is important for use cases where multiple languages are required or where the information on the language used is required. -The first best language match according to the user’s preferred language choices in the http Accept-Language header (or if that is not available than according to the system's default language order) is to be used for each localisable message element. The message does however not indicate the returned language per localisable element. -In case that there is no such language match for a particular localisable element, it is optional to: + +In case that there is no language match for a particular localisable element, it is optional to: - return the element in a system-default language or alternatively to not return the element - indicate available alternative languages for the element's maintainable artefact through links to underlying localised resources -**It is recommended to indicate all languages used anywhere in the message for localised elements through http Content-Language response header (languages of the intended audience) and/or through a “content-language” property in the meta tag.** The main language used can be indicated through the “lang” property in the meta tag. +**It is recommended to indicate all languages used anywhere in the message for localised elements through http Content-Language response header (languages of the intended audience) and/or through a “contentLanguages” property in the meta tag.** The main language used can be indicated through the “lang” property in the meta tag. + # Security Considerations @@ -1219,6 +1348,7 @@ This document defines a response format for SDMX RESTful Web Services in JSON and it raises no new security considerations. SDMX Web Services Guidelines includes the security considerations associated with its usage. + # Extending SDMX-JSON The objects defined in SDMX-JSON are "open", i.e. they can be extended by implementers @@ -1235,7 +1365,8 @@ a `wsCustomErrorCode`: "errors": [ { "code": 150, - "title": { "en": "Invalid number of dimensions in the key parameter" }, + "title": "Invalid number of dimensions in the key parameter", + "titles": { "en": "Invalid number of dimensions in the key parameter" }, "wsCustomErrorCode": 39272 } ] diff --git a/data-message/docs/3-full-example-with-comments.md b/data-message/docs/3-full-example-with-comments.md index 40bf739..6d8cdaa 100644 --- a/data-message/docs/3-full-example-with-comments.md +++ b/data-message/docs/3-full-example-with-comments.md @@ -10,15 +10,19 @@ "prepared": "2012-11-29T08:40:26Z", "comment for test": "# optional with default false", "test": false, - "comment for content-languages": "# recommended indication of all languages (potentially) used in message", - "content-languages": ["en"], + "comment for contentLanguages": "# recommended indication of all languages (potentially) used in message", + "contentLanguages": ["en"], "sender": { "id": "ECB", - "name": {"en": "European Central Bank"}, + "name": "European Central Bank", + "names": {"en": "European Central Bank"}, "contact": [{ - "name": {"en": "Statistics hotline"}, - "department": {"en": "Statistics Department"}, - "role": {"en": "helpdesk"}, + "name": "Statistics hotline", + "names": {"en": "Statistics hotline"}, + "department": "Statistics Department", + "departments": {"en": "Statistics Department"}, + "role": "helpdesk", + "roles": {"en": "helpdesk"}, "telephone": ["+00-00-99999"], "fax": ["+00-00-88888"], "uri": ["http://www.xyz.org"], @@ -28,11 +32,15 @@ "comment for receiver": "# receiver is optional, info from user record if authenticated", "receiver": { "id": "SDMX", - "name": {"en": "SDMX"}, + "name": "SDMX", + "names": {"en": "SDMX"}, "contact": [{ - "name": {"en": "name"}, - "department": {"en": "department"}, - "role": {"en": "role"}, + "name": "name", + "names": {"en": "name"}, + "department": "department", + "departments": {"en": "department"}, + "role": "role", + "roles": {"en": "role"}, "telephone": ["telephone"], "fax": ["fax"], "uri": ["uri"], @@ -43,13 +51,15 @@ "comment for href": "# include complete URL as used by the client", "href": "http://www.myorg.org/ws/data/ECB_ICP1/M.PT.N.071100.4.INX", "rel": "request", - "title": {"en": "Link to the url that returns this response"}, + "title": "Link to the url that returns this response", + "titles": {"en": "Link to the url that returns this response"}, "type": "application/json" }] }, "errors": [{ "code": 123, - "title": {"en": "Invalid number of dimensions in parameter key"} + "title": "Invalid number of dimensions in parameter key", + "titles": {"en": "Invalid number of dimensions in parameter key"} }], "data": { "structure": { @@ -58,105 +68,130 @@ "href": "https://sdw-wsrest.ecb.europa.eu/service/datastructure/ECB/ECB_EXR1/1.0", "urn": "urn:sdmx:org.sdmx.infomodel.datastructure.DataStructure=ECB:ECB_EXR1(1.0)", "rel": "datastructure", - "title": {"en": "resolvable uri to datastructure"} + "title": "resolvable uri to datastructure", + "titles": {"en": "resolvable uri to datastructure"} }, { "href": "https://sdw-wsrest.ecb.europa.eu/service/dataflow/ECB/EXR", "urn": "urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=ECB:EXR(1.0)", "rel": "dataflow", - "title": {"en": "resolvable uri to dataflow"} + "title": "resolvable uri to dataflow", + "titles": {"en": "resolvable uri to dataflow"} }, { "href": "https://sdw-wsrest.ecb.europa.eu/service/provisionagreement/ECB/PA_EXR", "urn": "urn:sdmx:org.sdmx.infomodel.provisionagreement.ProvisionAgreement=ECB:PA_EXR(1.0)", "rel": "provisionagreement", - "title": {"en": "resolvable uri to provision agreement"} + "title": "resolvable uri to provision agreement", + "titles": {"en": "resolvable uri to provision agreement"} } ], - "name": {"en": "dataflow name"}, - "description": {"en": "dataflow description"}, + "name": "dataflow name", + "names": {"en": "dataflow name"}, + "description": "dataflow description", + "descriptions": {"en": "dataflow description"}, "dimensions": { "comment for dataset": "# dataSet is used only if grouping of dimensions with single values", "dataSet": [ { "id": "FREQ", - "name": {"en": "Frequency"}, - "description": {"en": "Description for the dimension"}, + "name": "Frequency", + "names": {"en": "Frequency"}, + "description": "Description for the dimension", + "descriptions": {"en": "Description for the dimension"}, "comment for keyPosition": "# 0-based position of dimension in key in user request url", "keyPosition": 0, "comment for role": "# restricted list of dimension and attribute roles (time, frequency, geo, unit, scalefactor, referenceperiod, ...)", "role": "frequency", "values": [{ "id": "D", - "name": {"en": "Daily"} + "name": "Daily", + "names": {"en": "Daily"} }] }, { "id": "CURRENCY_DENOM", - "name": {"en": "Currency denominator"}, - "description": {"en": "Description for the dimension"}, + "name": "Currency denominator", + "names": {"en": "Currency denominator"}, + "description": "Description for the dimension", + "descriptions": {"en": "Description for the dimension"}, "keyPosition": 2, "values": [{ "id": "EUR", - "name": {"en": "Euro"} + "name": "Euro", + "names": {"en": "Euro"} }] }, { "id": "EXR_TYPE", - "name": {"en": "Exchange rate type"}, - "description": {"en": "Description for the dimension"}, + "name": "Exchange rate type", + "names": {"en": "Exchange rate type"}, + "description": "Description for the dimension", + "descriptions": {"en": "Description for the dimension"}, "keyPosition": 3, "values": [{ "id": "SP00", - "name": {"en": "Spot rate"} + "name": "Spot rate", + "names": {"en": "Spot rate"} }] }, { "id": "EXR_SUFFIX", - "name": {"en": "Series variation - EXR context"}, - "description": {"en": "Description for the dimension"}, + "name": "Series variation - EXR context", + "names": {"en": "Series variation - EXR context"}, + "description": "Description for the dimension", + "descriptions": {"en": "Description for the dimension"}, "keyPosition": 4, "values": [{ "id": "A", - "name": {"en": "Average or standardised measure for given frequency"} + "name": "Average or standardised measure for given frequency", + "names": {"en": "Average or standardised measure for given frequency"} }] } ], "comment for series": "# only if dimensionAtObservation <> allDimensions", "series": [{ "id": "CURRENCY", - "name": {"en": "Currency"}, - "description": {"en": "Description for the dimension"}, + "name": "Currency", + "names": {"en": "Currency"}, + "description": "Description for the dimension", + "descriptions": {"en": "Description for the dimension"}, "keyPosition": 1, "role": "unit", "values": [ { "id": "NZD", - "name": {"en": "New Zealand dollar"} + "name": "New Zealand dollar", + "names": {"en": "New Zealand dollar"} }, { "id": "RUB", - "name": {"en": "Russian rouble"} + "name": "Russian rouble", + "names": {"en": "Russian rouble"} } ] }], "comment for observation": "# only for dimensions used at observation level", "observation": [{ "id": "TIME_PERIOD", - "name": {"en": "Time period or range"}, - "description": {"en": "Description for the dimension"}, + "name": "Time period or range", + "names": {"en": "Time period or range"}, + "description": "Description for the dimension", + "descriptions": {"en": "Description for the dimension"}, "keyPosition": 5, "role": "time", "values": [ { "id": "2013-01-18", - "name": {"en": "2013-01-18"}, + "name": "2013-01-18", + "names": {"en": "2013-01-18"}, "start": "2013-01-18T00:00:00Z", "end": "2013-01-18T23:59:59Z" }, { "id": "2013-01-21", - "name": {"en": "2013-01-21"}, + "name": "2013-01-21", + "names": {"en": "2013-01-21"}, "start": "2013-01-21T00:00:00Z", "end": "2013-01-21T23:59:59Z" } @@ -167,21 +202,26 @@ "comment for dataSet": "# only for attributes returned at dataset level", "dataSet": [{ "id": "TIME_FORMAT", - "name": {"en": "Time Format"}, - "description": {"en": "Description for the attribute"}, + "name": "Time Format", + "names": {"en": "Time Format"}, + "description": "Description for the attribute", + "descriptions": {"en": "Description for the attribute"}, "relationship": {"none": {}}, "role": "TIME_FORMAT", "default": "P1D", "values": [{ "id": "P1D", - "name": {"en": "Daily"} + "name": "Daily", + "names": {"en": "Daily"} }] }], "comment for series": "# only for attributes returned at series level", "series": [{ "id": "ID", - "name": {"en": "Attribute name"}, - "description": {"en": "Description for the attribute"}, + "name": "Attribute name", + "names": {"en": "Attribute name"}, + "description": "Description for the attribute", + "descriptions": {"en": "Description for the attribute"}, "relationship": {"dimensions": [ "FREQ", "CURRENCY", @@ -196,18 +236,22 @@ { "comment for id": "# id property is optional to allow for uncoded attributes", "id": "ID1", - "name": {"en": "New Zealand dollar (NZD)"} + "name": "New Zealand dollar (NZD)", + "names": {"en": "New Zealand dollar (NZD)"} }, { "id": "ID2", - "name": {"en": "Russian rouble (RUB)"} + "name": "Russian rouble (RUB)", + "names": {"en": "Russian rouble (RUB)"} } ] }], "observation": [{ "id": "OBS_STATUS", - "name": {"en": "Observation status"}, - "description": {"en": "Description for the attribute"}, + "name": "Observation status", + "names": {"en": "Observation status"}, + "description": "Description for the attribute", + "descriptions": {"en": "Description for the attribute"}, "relationship": {"primaryMeasure": "OBS_VALUE"}, "role": null, "comment for default": "# optional", @@ -217,8 +261,10 @@ null, { "id": "A", - "name": {"en": "Normal value"}, - "description": {"en": "Normal value"} + "name": "Normal value", + "names": {"en": "Normal value"}, + "description": "Normal value", + "descriptions": {"en": "Normal value"} } ] }] @@ -226,7 +272,8 @@ "annotations": [{ "title": "AnnotationTitle provides a title for the annotation.", "type": "AnnotationType is used to distinguish between annotations.", - "text": {"en": "AnnotationText contains the text of the annotation."}, + "text": "AnnotationText contains the text of the annotation.", + "texts": {"en": "AnnotationText contains the text of the annotation."}, "id": "Non-standard identification of an annotation.", "links": [{ "href": "http://www.myorg.org/ws/uri/for/this/annotation", diff --git a/data-message/samples/agri.json b/data-message/samples/agri.json index 14f3680..0ab577b 100644 --- a/data-message/samples/agri.json +++ b/data-message/samples/agri.json @@ -4,14 +4,16 @@ "id": "IT1001", "prepared": "2018-03-11T14:30:47", "test": true, - "content-languages": ["en"], + "contentLanguages": ["en"], "sender": { "id": "NIS", - "name": {"en": "National Institute of Statistics of Cambodia"} + "name": "National Institute of Statistics of Cambodia", + "names": {"en": "National Institute of Statistics of Cambodia"} }, "receiver": { "id": "IMF", - "name": {"en": "International Monetary Fund"} + "name": "International Monetary Fund", + "names": {"en": "International Monetary Fund"} }, "links": [{ "href": "http://ws-root/data/MA_545,MILLED_RICE,1.0/ASIKHM002+ASIKHM001../?dimensionAtObservation=AllDimensions&startPeriod=2013&endPeriod=2018", @@ -74,17 +76,21 @@ "rel": "dataflow" } ], - "name": {"en": "Milled rice"}, - "description": {"en": "Milled rice description"}, + "name": "Milled rice", + "names": {"en": "Milled rice"}, + "description": "Milled rice description", + "descriptions": {"en": "Milled rice description"}, "dimensions": { "dataset": [{ "id": "FREQ", - "name": {"en": "Frequency"}, + "name": "Frequency", + "names": {"en": "Frequency"}, "keyPosition": 2, "role": "FREQ", "values": [{ "id": "A", - "name": {"en": "Annual"}, + "name": "Annual", + "names": {"en": "Annual"}, "links": [{ "href": "http://ws-root/codelist/MA_545/FREQ/1.0/A", "urn": "urn:sdmx:org.sdmx.infomodel.codelist.Codelist=MA_545:FREQ(1.0).A", @@ -101,13 +107,15 @@ "observation": [ { "id": "REF_AREA", - "name": {"en": "Reference area"}, + "name": "Reference area", + "names": {"en": "Reference area"}, "keyPosition": 0, "role": ["REF_AREA"], "values": [ { "id": "ASIKHM001", - "name": {"en": "Banteay Meanchey"}, + "name": "Banteay Meanchey", + "names": {"en": "Banteay Meanchey"}, "parent": "ASIKHM", "order": 2, "links": [{ @@ -119,7 +127,8 @@ }, { "id": "ASIKHM002", - "name": {"en": "Battambang"}, + "name": "Battambang", + "names": {"en": "Battambang"}, "parent": "ASIKHM", "order": 1, "links": [{ @@ -131,7 +140,8 @@ }, { "id": "ASIKHM", - "name": {"en": "Cambodia"}, + "name": "Cambodia", + "names": {"en": "Cambodia"}, "order": 0, "links": [{ "href": "http://ws-root/codelist/MA_545/CL_PROVINCES/1.0/ASIKHM", @@ -148,7 +158,8 @@ }, { "id": "TIME_PERIOD", - "name": {"en": "Time Period"}, + "name": "Time Period", + "names": {"en": "Time Period"}, "keyPosition": 3, "role": ["TIME_PERIOD"], "values": [ @@ -156,25 +167,29 @@ "start": "2014-01-01T00:00:00Z", "end": "2014-12-31T23:59:59Z", "id": "2014", - "name": {"en": "2014"} + "name": "2014", + "names": {"en": "2014"} }, { "start": "2015-01-01T00:00:00Z", "end": "2015-12-31T23:59:59Z", "id": "2015", - "name": {"en": "2015"} + "name": "2015", + "names": {"en": "2015"} }, { "start": "2016-01-01T00:00:00Z", "end": "2016-12-31T23:59:59Z", "id": "2016", - "name": {"en": "2016"} + "name": "2016", + "names": {"en": "2016"} }, { "start": "2017-01-01T00:00:00Z", "end": "2017-12-31T23:59:59Z", "id": "2017", - "name": {"en": "2017"} + "name": "2017", + "names": {"en": "2017"} } ] } @@ -184,53 +199,63 @@ "dataset": [ { "id": "UNIT_MEASURE", - "name": {"en": "Unit of measure"}, + "name": "Unit of measure", + "names": {"en": "Unit of measure"}, "role": ["UNIT_MEASURE"], "relationship": {"none": {}}, "values": [{ "id": "TONES", - "name": {"en": "Tones"} + "name": "Tones", + "names": {"en": "Tones"} }] }, { "id": "UNIT_MULT", - "name": {"en": "Unit multiplier"}, + "name": "Unit multiplier", + "names": {"en": "Unit multiplier"}, "role": ["UNIT_MULT"], "relationship": {"none": {}}, "values": [{ "id": "3", - "name": {"en": "Thousands"} + "name": "Thousands", + "names": {"en": "Thousands"} }] }, { "id": "BASE_PER", - "name": {"en": "Base Period"}, + "name": "Base Period", + "names": {"en": "Base Period"}, "role": ["BASE_PER"], "relationship": {"none": {}}, "values": [{ "id": "2010_100", - "name": {"en": "2010=100"} + "name": "2010=100", + "names": {"en": "2010=100"} }] }, { "id": "PREF_SCALE", - "name": {"en": "Preferred scale"}, + "name": "Preferred scale", + "names": {"en": "Preferred scale"}, "role": ["PREF_SCALE"], "relationship": {"none": {}}, "values": [{ "id": "-3", - "name": {"en": "Thousandth"} + "name": "Thousandth", + "names": {"en": "Thousandth"} }] }, { "id": "DECIMALS", - "name": {"en": "Decimals"}, + "name": "Decimals", + "names": {"en": "Decimals"}, "role": ["DECIMALS"], "default": "1", "relationship": {"none": {}}, "values": [{ "id": "1", - "name": {"en": "One decimal"} + "name": "One decimal", + "names": {"en": "One decimal"} }] } ], @@ -238,24 +263,27 @@ "observation": [ { "id": "SOURCE", - "name": {"en": "Source"}, + "name": "Source", + "names": {"en": "Source"}, "relationship": {"dimensions": ["TIME_PERIOD"]}, "values": [ - {"name": {"en": "MAFF_Agricultural Statistics_2014"}}, - {"name": {"en": "MAFF_Agricultural Statistics_2015"}}, - {"name": {"en": "MAFF_Agricultural Statistics_2016"}}, - {"name": {"en": "MAFF_Agricultural Statistics_2017"}} + {"name": "MAFF_Agricultural Statistics_2014"}, + {"name": "MAFF_Agricultural Statistics_2015"}, + {"name": "MAFF_Agricultural Statistics_2016"}, + {"name": "MAFF_Agricultural Statistics_2017"} ] }, { "id": "OBS_STATUS", - "name": {"en": "Observation status"}, + "name": "Observation status", + "names": {"en": "Observation status"}, "roles": ["OBS_STATUS"], "default": "A", "relationship": {"primaryMeasure": "OBS_VALUE"}, "values": [{ "id": "A", - "name": {"en": "Normal value"} + "name": "Normal value", + "names": {"en": "Normal value"} }] } ] @@ -264,13 +292,15 @@ { "title": "Hierarchical name", "type": "Alternative name", - "text": {"en": "Banteay Meanchey"}, + "text": "Banteay Meanchey", + "texts": {"en": "Banteay Meanchey"}, "id": "ALT_NAME" }, { "title": "Hierarchical name", "type": "Alternative name", - "text": {"en": "Battambang"}, + "text": "Battambang", + "texts": {"en": "Battambang"}, "id": "ALT_NAME" } ] diff --git a/data-message/samples/exr/exr-action-delete.json b/data-message/samples/exr/exr-action-delete.json index af60701..d45433f 100644 --- a/data-message/samples/exr/exr-action-delete.json +++ b/data-message/samples/exr/exr-action-delete.json @@ -3,13 +3,14 @@ "schema": "https://raw.githubusercontent.com/sdmx-twg/sdmx-json/develop/data-message/tools/schemas/1.0/sdmx-json-data-schema.json", "id": "62b5f19d-f1c9-495d-8446-a3661ed24753", "prepared": "2012-11-29T08:40:26Z", - "content-language": [ + "contentLanguages": [ "en", "fr-fr" ], "sender": { "id": "ECB", - "name": {"en": "European Central Bank"} + "name": "European Central Bank", + "names": {"en": "European Central Bank"} } }, "data": { @@ -19,76 +20,90 @@ "href": "https://sdw-wsrest.ecb.europa.eu/service/dataflow/ECB/EXR/1.0", "urn": "urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=ECB:EXR(1.0)", "rel": "dataflow", - "title": {"en": "resolvable uri to dataflow"} + "title": "resolvable uri to dataflow", + "titles": {"en": "resolvable uri to dataflow"} }, { "href": "https://sdw-wsrest.ecb.europa.eu/service/datastructure/ECB/ECB_EXR1/1.0", "urn": "urn:sdmx:org.sdmx.infomodel.datastructure.DataStructure=ECB:ECB_EXR1(1.0)", "rel": "datastructure", - "title": {"en": "resolvable uri to datastructure"} + "title": "resolvable uri to datastructure", + "titles": {"en": "resolvable uri to datastructure"} }, { "href": "https://sdw-wsrest.ecb.europa.eu/service/provisionagreement/ECB/PA_EXR", "urn": "urn:sdmx:org.sdmx.infomodel.provisionagreement.ProvisionAgreement=ECB:PA_EXR(1.0)", "rel": "provisionagreement", - "title": {"en": "resolvable uri to provision agreement"} + "title": "resolvable uri to provision agreement", + "titles": {"en": "resolvable uri to provision agreement"} } ], "dimensions": { "dataSet": [ { "id": "FREQ", - "name": {"en": "Frequency"}, + "name": "Frequency", + "names": {"en": "Frequency"}, "role": "FREQ", "keyPosition": 0, "values": [{ "id": "D", - "name": {"en": "Daily"} + "name": "Daily", + "names": {"en": "Daily"} }] }, { "id": "CURRENCY_DENOM", - "name": {"en": "Currency denominator"}, + "name": "Currency denominator", + "names": {"en": "Currency denominator"}, "keyPosition": 2, "values": [{ "id": "EUR", - "name": {"en": "Euro"} + "name": "Euro", + "names": {"en": "Euro"} }] }, { "id": "EXR_TYPE", - "name": {"en": "Exchange rate type"}, + "name": "Exchange rate type", + "names": {"en": "Exchange rate type"}, "keyPosition": 3, "values": [{ "id": "SP00", - "name": {"en": "Spot rate"} + "name": "Spot rate", + "names": {"en": "Spot rate"} }] }, { "id": "EXR_SUFFIX", - "name": {"en": "Series variation - EXR context"}, + "name": "Series variation - EXR context", + "names": {"en": "Series variation - EXR context"}, "keyPosition": 4, "values": [{ "id": "A", - "name": {"en": "Average or standardised measure for given frequency"} + "name": "Average or standardised measure for given frequency", + "names": {"en": "Average or standardised measure for given frequency"} }] } ], "series": [{ "id": "TIME_PERIOD", - "name": {"en": "Time period or range"}, + "name": "Time period or range", + "names": {"en": "Time period or range"}, "role": "TIME_PERIOD", "keyPosition": 5, "values": [ { "id": "2013-01-18", - "name": {"en": "2013-01-18"}, + "name": "2013-01-18", + "names": {"en": "2013-01-18"}, "start": "2013-01-18T00:00:00.000Z", "end": "2013-01-18T23:59:59.999Z" }, { "id": "2013-01-21", - "name": {"en": "2013-01-21"}, + "name": "2013-01-21", + "names": {"en": "2013-01-21"}, "start": "2013-01-21T00:00:00.000Z", "end": "2013-01-21T23:59:59.999Z" } @@ -96,16 +111,19 @@ }], "observation": [{ "id": "CURRENCY", - "name": {"en": "Currency"}, + "name": "Currency", + "names": {"en": "Currency"}, "keyPosition": 1, "values": [ { "id": "NZD", - "name": {"en": "New Zealand dollar"} + "name": "New Zealand dollar", + "names": {"en": "New Zealand dollar"} }, { "id": "RUB", - "name": {"en": "Russian rouble"} + "name": "Russian rouble", + "names": {"en": "Russian rouble"} } ] }] @@ -113,21 +131,25 @@ "attributes": { "dataSet": [{ "id": "TIME_FORMAT", - "name": {"en": "Time Format"}, - "description": {"en": "Description for the attribute"}, + "name": "Time Format", + "names": {"en": "Time Format"}, + "description": "Description for the attribute", + "descriptions": {"en": "Description for the attribute"}, "relationship": {"none": {}}, "role": "TIME_FORMAT", "default": "P1D", "values": [{ "id": "P1D", - "name": {"en": "Daily"} + "name": "Daily", + "names": {"en": "Daily"} }] }], "series": [], "observation": [ { "id": "TITLE", - "name": {"en": "Series title"}, + "name": "Series title", + "names": {"en": "Series title"}, "relationship": {"dimensions": [ "FREQ", "CURRENCY", @@ -137,17 +159,19 @@ ]}, "role": "TITLE", "values": [ - {"name": {"en": "New Zealand dollar (NZD)"}}, - {"name": {"en": "Russian rouble (RUB)"}} + {"name": "New Zealand dollar (NZD)"}, + {"name": "Russian rouble (RUB)"} ] }, { "id": "OBS_STATUS", - "name": {"en": "Observation status"}, + "name": "Observation status", + "names": {"en": "Observation status"}, "relationship": {"primaryMeasure": "OBS_VALUE"}, "values": [{ "id": "A", - "name": {"en": "Normal value"} + "name": "Normal value", + "names": {"en": "Normal value"} }] } ] diff --git a/data-message/samples/exr/exr-cross-section.json b/data-message/samples/exr/exr-cross-section.json index 46c7755..8b3644a 100644 --- a/data-message/samples/exr/exr-cross-section.json +++ b/data-message/samples/exr/exr-cross-section.json @@ -3,10 +3,11 @@ "schema": "https://raw.githubusercontent.com/sdmx-twg/sdmx-json/develop/data-message/tools/schemas/1.0/sdmx-json-data-schema.json", "id": "62b5f19d-f1c9-495d-8446-a3661ed24753", "prepared": "2012-11-29T08:40:26Z", - "content-language": [ "en", "fr-fr" ], + "contentLanguages": [ "en", "fr-fr" ], "sender": { "id": "ECB", - "name": {"en": "European Central Bank"} + "name": "European Central Bank", + "names": {"en": "European Central Bank"} } }, "data": { @@ -16,77 +17,91 @@ "href": "https://sdw-wsrest.ecb.europa.eu/service/dataflow/ECB/EXR/1.0", "urn": "urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=ECB:EXR(1.0)", "rel": "dataflow", - "title": {"en": "resolvable uri to dataflow"} + "title": "resolvable uri to dataflow", + "titles": {"en": "resolvable uri to dataflow"} }, { "href": "https://sdw-wsrest.ecb.europa.eu/service/datastructure/ECB/ECB_EXR1/1.0", "urn": "urn:sdmx:org.sdmx.infomodel.datastructure.DataStructure=ECB:ECB_EXR1(1.0)", "rel": "datastructure", - "title": {"en": "resolvable uri to datastructure"} + "title": "resolvable uri to datastructure", + "titles": {"en": "resolvable uri to datastructure"} }, { "href": "https://sdw-wsrest.ecb.europa.eu/service/provisionagreement/ECB/PA_EXR", "urn": "urn:sdmx:org.sdmx.infomodel.provisionagreement.ProvisionAgreement=ECB:PA_EXR(1.0)", "rel": "provisionagreement", - "title": {"en": "resolvable uri to provision agreement"} + "title": "resolvable uri to provision agreement", + "titles": {"en": "resolvable uri to provision agreement"} } ], "dimensions": { "dataSet": [ { "id": "FREQ", - "name": {"en": "Frequency"}, + "name": "Frequency", + "names": {"en": "Frequency"}, "role": "FREQ", "keyPosition": 0, "values": [{ "id": "D", - "name": {"en": "Daily"} + "name": "Daily", + "names": {"en": "Daily"} }] }, { "id": "CURRENCY_DENOM", - "name": {"en": "Currency denominator"}, + "name": "Currency denominator", + "names": {"en": "Currency denominator"}, "keyPosition": 2, "values": [{ "id": "EUR", - "name": {"en": "Euro"} + "name": "Euro", + "names": {"en": "Euro"} }] }, { "id": "EXR_TYPE", - "name": {"en": "Exchange rate type"}, + "name": "Exchange rate type", + "names": {"en": "Exchange rate type"}, "keyPosition": 3, "values": [{ "id": "SP00", - "name": {"en": "Spot rate"} + "name": "Spot rate", + "names": {"en": "Spot rate"} }] }, { "id": "EXR_SUFFIX", - "name": {"en": "Series variation - EXR context"}, + "name": "Series variation - EXR context", + "names": {"en": "Series variation - EXR context"}, "keyPosition": 4, "values": [{ "id": "A", - "name": {"en": "Average or standardised measure for given frequency"} + "name": "Average or standardised measure for given frequency", + "names": {"en": "Average or standardised measure for given frequency"} }] } ], "series": [{ "id": "TIME_PERIOD", - "name": {"en": "Time period or range"}, + "name": "Time period or range", + "names": {"en": "Time period or range"}, "keyPosition": 5, "role": "TIME_PERIOD", "keyPosition": 5, "values": [ { "id": "2013-01-18", - "name": {"en": "2013-01-18"}, + "name": "2013-01-18", + "names": {"en": "2013-01-18"}, "start": "2013-01-18T00:00:00.000Z", "end": "2013-01-18T23:59:59.999Z" }, { "id": "2013-01-21", - "name": {"en": "2013-01-21"}, + "name": "2013-01-21", + "names": {"en": "2013-01-21"}, "start": "2013-01-21T00:00:00.000Z", "end": "2013-01-21T23:59:59.999Z" } @@ -94,16 +109,19 @@ }], "observation": [{ "id": "CURRENCY", - "name": {"en": "Currency"}, + "name": "Currency", + "names": {"en": "Currency"}, "keyPosition": 1, "values": [ { "id": "NZD", - "name": {"en": "New Zealand dollar"} + "name": "New Zealand dollar", + "names": {"en": "New Zealand dollar"} }, { "id": "RUB", - "name": {"en": "Russian rouble"} + "name": "Russian rouble", + "names": {"en": "Russian rouble"} } ] }] @@ -111,8 +129,10 @@ "attributes": { "dataSet": [{ "id": "TIME_FORMAT", - "name": {"en": "Time Format"}, - "description": {"en": "Description for the attribute"}, + "name": "Time Format", + "names": {"en": "Time Format"}, + "description": "Description for the attribute", + "descriptions": {"en": "Description for the attribute"}, "relationship": { "none": { } @@ -121,23 +141,27 @@ "default": "P1D", "values": [{ "id": "P1D", - "name": {"en": "Daily"} + "name": "Daily", + "names": {"en": "Daily"} }] }], "series": [], "observation": [ { "id": "OBS_STATUS", - "name": {"en": "Observation status"}, + "name": "Observation status", + "names": {"en": "Observation status"}, "relationship": {"primaryMeasure": "OBS_VALUE"}, "values": [{ "id": "A", - "name": {"en": "Normal value"} + "name": "Normal value", + "names": {"en": "Normal value"} }] }, { "id": "TITLE", - "name": {"en": "Series title"}, + "name": "Series title", + "names": {"en": "Series title"}, "relationship": { "dimensions": [ "FREQ", "CURRENCY", "CURRENCY_DENOM", "EXR_TYPE", "EXR_SUFFIX" @@ -145,8 +169,8 @@ }, "role": "TITLE", "values": [ - {"name": {"en": "New Zealand dollar (NZD)"}}, - {"name": {"en": "Russian rouble (RUB)"}} + {"name": "New Zealand dollar (NZD)"}, + {"name": "Russian rouble (RUB)"} ] } ] @@ -154,7 +178,8 @@ "annotations": [{ "title": "Sample series annotation title", "type": "example", - "text": {"en": "Sample series annotation text"}, + "text": "Sample series annotation text", + "texts": {"en": "Sample series annotation text"}, "id": "ABC123456" }] }, diff --git a/data-message/samples/exr/exr-flat.json b/data-message/samples/exr/exr-flat.json index 81c42b6..f840510 100644 --- a/data-message/samples/exr/exr-flat.json +++ b/data-message/samples/exr/exr-flat.json @@ -4,7 +4,8 @@ "prepared": "2012-11-29T08:40:26Z", "sender": { "id": "ECB", - "name": {"en": "European Central Bank"} + "name": "European Central Bank", + "names": {"en": "European Central Bank"} } }, "structure": { @@ -13,58 +14,69 @@ "href": "https://sdw-wsrest.ecb.europa.eu/service/dataflow/ECB/EXR/1.0", "urn": "urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=ECB:EXR(1.0)", "rel": "dataflow", - "title": {"en": "resolvable uri to dataflow"} + "title": "resolvable uri to dataflow", + "titles": {"en": "resolvable uri to dataflow"} }, { "href": "https://sdw-wsrest.ecb.europa.eu/service/datastructure/ECB/ECB_EXR1/1.0", "urn": "urn:sdmx:org.sdmx.infomodel.datastructure.DataStructure=ECB:ECB_EXR1(1.0)", "rel": "datastructure", - "title": {"en": "resolvable uri to datastructure"} + "title": "resolvable uri to datastructure", + "titles": {"en": "resolvable uri to datastructure"} }, { "href": "https://sdw-wsrest.ecb.europa.eu/service/provisionagreement/ECB/PA_EXR", "urn": "urn:sdmx:org.sdmx.infomodel.provisionagreement.ProvisionAgreement=ECB:PA_EXR(1.0)", "rel": "provisionagreement", - "title": {"en": "resolvable uri to provision agreement"} + "title": "resolvable uri to provision agreement", + "titles": {"en": "resolvable uri to provision agreement"} } ], "dimensions": { "dataSet": [ { "id": "FREQ", - "name": {"en": "Frequency"}, + "name": "Frequency", + "names": {"en": "Frequency"}, "keyPosition": 0, "role": "FREQ", "values": [{ "id": "D", - "name": {"en": "Daily"} + "name": "Daily", + "names": {"en": "Daily"} }] }, { "id": "CURRENCY_DENOM", - "name": {"en": "Currency denominator"}, + "name": "Currency denominator", + "names": {"en": "Currency denominator"}, "keyPosition": 2, "values": [{ "id": "EUR", - "name": {"en": "Euro"} + "name": "Euro", + "names": {"en": "Euro"} }] }, { "id": "EXR_TYPE", - "name": {"en": "Exchange rate type"}, + "name": "Exchange rate type", + "names": {"en": "Exchange rate type"}, "keyPosition": 3, "values": [{ "id": "SP00", - "name": {"en": "Spot rate"} + "name": "Spot rate", + "names": {"en": "Spot rate"} }] }, { "id": "EXR_SUFFIX", - "name": {"en": "Series variation - EXR context"}, + "name": "Series variation - EXR context", + "names": {"en": "Series variation - EXR context"}, "keyPosition": 4, "values": [{ "id": "A", - "name": {"en": "Average or standardised measure for given frequency"} + "name": "Average or standardised measure for given frequency", + "names": {"en": "Average or standardised measure for given frequency"} }] } ], @@ -72,34 +84,40 @@ "observation": [ { "id": "CURRENCY", - "name": {"en": "Currency"}, + "name": "Currency", + "names": {"en": "Currency"}, "keyPosition": 1, "values": [ { "id": "NZD", - "name": {"en": "New Zealand dollar"} + "name": "New Zealand dollar", + "names": {"en": "New Zealand dollar"} }, { "id": "RUB", - "name": {"en": "Russian rouble"} + "name": "Russian rouble", + "names": {"en": "Russian rouble"} } ] }, { "id": "TIME_PERIOD", - "name": {"en": "Time period or range"}, + "name": "Time period or range", + "names": {"en": "Time period or range"}, "role": "TIME_PERIOD", "keyPosition": 5, "values": [ { "id": "2013-01-18", - "name": {"en": "2013-01-18"}, + "name": "2013-01-18", + "names": {"en": "2013-01-18"}, "start": "2013-01-18T00:00:00.000Z", "end": "2013-01-18T23:59:59.999Z" }, { "id": "2013-01-21", - "name": {"en": "2013-01-21"}, + "name": "2013-01-21", + "names": {"en": "2013-01-21"}, "start": "2013-01-21T00:00:00.000Z", "end": "2013-01-21T23:59:59.999Z" } @@ -110,21 +128,25 @@ "attributes": { "dataSet": [{ "id": "TIME_FORMAT", - "name": {"en": "Time Format"}, - "description": {"en": "Description for the attribute"}, + "name": "Time Format", + "names": {"en": "Time Format"}, + "description": "Description for the attribute", + "descriptions": {"en": "Description for the attribute"}, "relationship": {"none": {}}, "role": "TIME_FORMAT", "default": "P1D", "values": [{ "id": "P1D", - "name": {"en": "Daily"} + "name": "Daily", + "names": {"en": "Daily"} }] }], "series": [], "observation": [ { "id": "TITLE", - "name": {"en": "Series title"}, + "name": "Series title", + "names": {"en": "Series title"}, "relationship": {"dimensions": [ "FREQ", "CURRENCY", @@ -134,18 +156,20 @@ ]}, "role": "TITLE", "values": [ - {"name": {"en": "New Zealand dollar (NZD)"}}, - {"name": {"en": "Russian rouble (RUB)"}} + {"name": "New Zealand dollar (NZD)"}, + {"name": "Russian rouble (RUB)"} ] }, { "id": "OBS_STATUS", - "name": {"en": "Observation status"}, + "name": "Observation status", + "names": {"en": "Observation status"}, "relationship": {"primaryMeasure": "OBS_VALUE"}, "role": "OBS_STATUS", "values": [{ "id": "A", - "name": {"en": "Normal value"} + "name": "Normal value", + "names": {"en": "Normal value"} }] } ] @@ -153,7 +177,8 @@ "annotations": [{ "title": "Sample observation annotation title", "type": "example", - "text": {"en": "Sample observation annotation text"}, + "text": "Sample observation annotation text", + "texts": {"en": "Sample observation annotation text"}, "id": "XYZ98765" }] }, @@ -187,5 +212,6 @@ 0 ] } - }] - } + } + ] +} diff --git a/data-message/samples/exr/exr-time-series.json b/data-message/samples/exr/exr-time-series.json index 8b969f9..eb75397 100644 --- a/data-message/samples/exr/exr-time-series.json +++ b/data-message/samples/exr/exr-time-series.json @@ -4,7 +4,8 @@ "prepared": "2012-11-29T08:40:26Z", "sender": { "id": "ECB", - "name": {"en": "European Central Bank"} + "name": "European Central Bank", + "names": {"en": "European Central Bank"} } }, "structure": { @@ -13,90 +14,107 @@ "href": "https://sdw-wsrest.ecb.europa.eu/service/dataflow/ECB/EXR/1.0", "urn": "urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=ECB:EXR(1.0)", "rel": "dataflow", - "title": {"en": "resolvable uri to dataflow"} + "title": "resolvable uri to dataflow", + "titles": {"en": "resolvable uri to dataflow"} }, { "href": "https://sdw-wsrest.ecb.europa.eu/service/datastructure/ECB/ECB_EXR1/1.0", "urn": "urn:sdmx:org.sdmx.infomodel.datastructure.DataStructure=ECB:ECB_EXR1(1.0)", "rel": "datastructure", - "title": {"en": "resolvable uri to datastructure"} + "title": "resolvable uri to datastructure", + "titles": {"en": "resolvable uri to datastructure"} }, { "href": "https://sdw-wsrest.ecb.europa.eu/service/provisionagreement/ECB/PA_EXR", "urn": "urn:sdmx:org.sdmx.infomodel.provisionagreement.ProvisionAgreement=ECB:PA_EXR(1.0)", "rel": "provisionagreement", - "title": {"en": "resolvable uri to provision agreement"} + "title": "resolvable uri to provision agreement", + "titles": {"en": "resolvable uri to provision agreement"} } ], "dimensions": { "dataSet": [ { "id": "FREQ", - "name": {"en": "Frequency"}, + "name": "Frequency", + "names": {"en": "Frequency"}, "role": "FREQ", "keyPosition": 0, "values": [{ "id": "D", - "name": {"en": "Daily"} + "name": "Daily", + "names": {"en": "Daily"} }] }, { "id": "CURRENCY_DENOM", - "name": {"en": "Currency denominator"}, + "name": "Currency denominator", + "names": {"en": "Currency denominator"}, "keyPosition": 2, "values": [{ "id": "EUR", - "name": {"en": "Euro"} + "name": "Euro", + "names": {"en": "Euro"} }] }, { "id": "EXR_TYPE", - "name": {"en": "Exchange rate type"}, + "name": "Exchange rate type", + "names": {"en": "Exchange rate type"}, "keyPosition": 3, "values": [{ "id": "SP00", - "name": {"en": "Spot rate"} + "name": "Spot rate", + "names": {"en": "Spot rate"} }] }, { "id": "EXR_SUFFIX", - "name": {"en": "Series variation - EXR context"}, + "name": "Series variation - EXR context", + "names": {"en": "Series variation - EXR context"}, "keyPosition": 4, "values": [{ "id": "A", - "name": {"en": "Average or standardised measure for given frequency"} + "name": "Average or standardised measure for given frequency", + "names": {"en": "Average or standardised measure for given frequency"} }] } ], "series": [{ "id": "CURRENCY", - "name": {"en": "Currency"}, + "name": "Currency", + "names": {"en": "Currency"}, "keyPosition": 1, "values": [ { "id": "NZD", - "name": {"en": "New Zealand dollar"} + "name": "New Zealand dollar", + "names": {"en": "New Zealand dollar"} }, { "id": "RUB", - "name": {"en": "Russian rouble"} + "name": "Russian rouble", + "names": {"en": "Russian rouble"} } ] }], "observation": [{ "id": "TIME_PERIOD", - "name": {"en": "Time period or range"}, + "name": "Time period or range", + "names": {"en": "Time period or range"}, "role": "TIME_PERIOD", "values": [ { "id": "2013-01-18", - "name": {"en": "2013-01-18"}, + "name": "2013-01-18", + "names": {"en": "2013-01-18"}, "start": "2013-01-18T00:00:00.000Z", "end": "2013-01-18T23:59:59.999Z" }, { "id": "2013-01-21", - "name": {"en": "2013-01-21"}, + "name": "2013-01-21", + "names": {"en": "2013-01-21"}, "start": "2013-01-21T00:00:00.000Z", "end": "2013-01-21T23:59:59.999Z" } @@ -106,19 +124,23 @@ "attributes": { "dataSet": [{ "id": "TIME_FORMAT", - "name": {"en": "Time Format"}, - "description": {"en": "Description for the attribute"}, + "name": "Time Format", + "names": {"en": "Time Format"}, + "description": "Description for the attribute", + "descriptions": {"en": "Description for the attribute"}, "relationship": {"none": {}}, "role": "TIME_FORMAT", "default": "P1D", "values": [{ "id": "P1D", - "name": {"en": "Daily"} + "name": "Daily", + "names": {"en": "Daily"} }] }], "series": [{ "id": "TITLE", - "name": {"en": "Series title"}, + "name": "Series title", + "names": {"en": "Series title"}, "relationship": {"dimensions": [ "FREQ", "CURRENCY", @@ -128,18 +150,20 @@ ]}, "role": "TITLE", "values": [ - {"name": {"en": "New Zealand dollar (NZD)"}}, - {"name": {"en": "Russian rouble (RUB)"}} + {"name": "New Zealand dollar (NZD)"}, + {"name": "Russian rouble (RUB)"} ] }], "observation": [{ "id": "OBS_STATUS", - "name": {"en": "Observation status"}, + "name": "Observation status", + "names": {"en": "Observation status"}, "relationship": {"primaryMeasure": "OBS_VALUE"}, "role": "OBS_STATUS", "values": [{ "id": "A", - "name": {"en": "Normal value"} + "name": "Normal value", + "names": {"en": "Normal value"} }] }] }, @@ -147,13 +171,15 @@ { "title": "Sample series annotation title", "type": "example", - "text": {"en": "Sample series annotation text"}, + "text": "Sample series annotation text", + "texts": {"en": "Sample series annotation text"}, "id": "ABC123456" }, { "title": "Sample observation annotation title", "type": "example", - "text": {"en": "Sample observation annotation text"}, + "text": "Sample observation annotation text", + "texts": {"en": "Sample observation annotation text"}, "id": "XYZ98765" } ] diff --git a/data-message/tools/schemas/1.0/sdmx-json-data-schema.json b/data-message/tools/schemas/1.0/sdmx-json-data-schema.json index ca0c778..663f460 100644 --- a/data-message/tools/schemas/1.0/sdmx-json-data-schema.json +++ b/data-message/tools/schemas/1.0/sdmx-json-data-schema.json @@ -1,126 +1,149 @@ { - "id": "https://raw.githubusercontent.com/sdmx-twg/sdmx-json/develop/data-message/tools/schemas/1.0/sdmx-json-data-schema.json", - "$schema": "http://json-schema.org/schema#", - "description": "Schema for SDMX-JSON data message", - "type": "object", - "properties": { - "meta": { - "$ref": "#/definitions/meta" - }, - "data": { - "type": "object", - "properties": { - "structure": { - "$ref": "#/definitions/structure" - }, - "dataSets": { - "type": "array", - "items": { - "$ref": "#/definitions/dataSet" - } - } - } - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/definitions/error" - } - } - }, - "definitions": { - "meta": { - "type": "object", - "required": [ - "id", - "prepared", - "sender" - ], - "properties": { - "schema": { - "type": "string", - "format": "uri" - }, - "id": { - "type": "string", - "pattern": "^[A-Za-z0-9_@$-]+$" - }, - "test": { - "type": "boolean" - }, - "prepared": { - "type": "string", - "format": "date-time" - }, - "content-languages": { - "type": "array", - "items": { - "type": "string", - "pattern": "^(?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))$|^((?:[a-z]{2,3}(?:(?:-[a-z]{3}){1,3})?)|[a-z]{4}|[a-z]{5,8})(?:-([a-z]{4}))?(?:-([a-z]{2}|[0-9]{3}))?((?:-(?:[0-9a-z]{5,8}|[0-9][0-9a-z]{3}))*)?((?:-[0-9a-wy-z](?:-[0-9a-z]{2,8})+)*)?(-x(?:-[0-9a-z]{1,8})+)?$|^(x(?:-[0-9a-z]{1,8})+)$" - } - }, - "sender": { - "$ref": "#/definitions/party" - }, - "receivers": { - "description": "Receiver is information about the part(y/ies) that is/are the intended recipient(s) of the message. This can be useful if the WS requires authentication.", - "type": "array", - "items": { - "$ref": "#/definitions/party" - } - }, - "links": { - "$ref": "#/definitions/links" - } - } - }, - "party": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "pattern": "^[A-Za-z0-9_@$-]+$" - }, + "id": "https://raw.githubusercontent.com/sdmx-twg/sdmx-json/develop/data-message/tools/schemas/1.0/sdmx-json-data-schema.json", + "$schema": "http://json-schema.org/schema#", + "description": "Schema for SDMX-JSON data message", + "type": "object", + "properties": { + "meta": { + "description": "A meta object that contains non-standard meta-information and basic technical information about the message, such as when it was prepared and who has sent it.", + "$ref": "#/definitions/meta" + }, + "data": { + "description": "Data contains the message's “primary data”.", + "type": "object", + "properties": { + "structure": {"$ref": "#/definitions/structure"}, + "dataSets": { + "type": "array", + "items": {"$ref": "#/definitions/dataSet"} + } + } + }, + "errors": { + "description": "Errors field is an array of error objects. When appropriate provides a list of error messages in addition to RESTful web services HTTP error status codes.", + "type": "array", + "items": {"$ref": "#/definitions/error"} + } + }, + "definitions": { + "meta": { + "description": "A meta object that contains non-standard meta-information and basic technical information about the message, such as when it was prepared and who has sent it.", + "type": "object", + "required": [ + "id", + "prepared", + "sender" + ], + "properties": { + "schema": { + "description": "Contains the URL to the schema allowing to validate the message. This also allows identifying the version of SDMX-JSON format used in this message. Providing the link to the SDMX-JSON schema is recommended.", + "type": "string", + "format": "uri" + }, + "id": { + "description": "Unique string assigned by the sender that identifies the message for further references.", + "type": "string", + "pattern": "^[A-Za-z0-9_@$-]+$" + }, + "test": { + "description": "Test indicates whether the message is for test purposes or not. False for normal messages.", + "type": "boolean" + }, + "prepared": { + "description": "A timestamp indicating when the message was prepared. Values must follow the ISO 8601 syntax for combined dates and times, including time zone.", + "type": "string", + "format": "date-time" + }, + "contentLanguages": { + "description": "Array of strings containing the identifyer of all languages used anywhere in the message for localized elements, and thus the languages of the intended audience, representaing in an array format the same information than the http Content-Language response header, e.g. \"en, fr-fr\". See IETF Language Tags: https://tools.ietf.org/html/rfc5646#section-2.1. The array's first element indicates the main language used in the message for localized elements. The usage of this property is recommended.", + "type": "array", + "items": { + "type": "string", + "pattern": "^(?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))$|^((?:[a-z]{2,3}(?:(?:-[a-z]{3}){1,3})?)|[a-z]{4}|[a-z]{5,8})(?:-([a-z]{4}))?(?:-([a-z]{2}|[0-9]{3}))?((?:-(?:[0-9a-z]{5,8}|[0-9][0-9a-z]{3}))*)?((?:-[0-9a-wy-z](?:-[0-9a-z]{2,8})+)*)?(-x(?:-[0-9a-z]{1,8})+)?$|^(x(?:-[0-9a-z]{1,8})+)$" + } + }, "name": { - "$ref": "#/definitions/name" - }, - "contact": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { + "description": "Name provides a name for the transmission. Multiple instances allow for parallel language values.", + "$ref": "#/definitions/localisedBestMatchText" + }, + "names": { + "description": "Name provides a name for the transmission. Multiple instances allow for parallel language values.", + "$ref": "#/definitions/localisedText" + }, + "sender": { + "description": "Name provides a name for the transmission. Multiple instances allow for parallel language values.", + "$ref": "#/definitions/party" + }, + "receivers": { + "description": "Receiver is information about the part(y/ies) that is/are the intended recipient(s) of the message. This can be useful if the WS requires authentication.", + "type": "array", + "items": {"$ref": "#/definitions/party"} + }, + "links": {"$ref": "#/definitions/links"} + } + }, + "party": { + "type": "object", + "required": ["id"], + "properties": { + "id": { + "description": "The id holds the identification of the party.", + "type": "string", + "pattern": "^[A-Za-z0-9_@$-]+$" + }, + "name": { + "description": "Name is a human-readable name of the party.", + "$ref": "#/definitions/localisedBestMatchText" + }, + "names": { + "description": "List of localised human-readable name of the party.", + "$ref": "#/definitions/localisedText" + }, + "contact": { + "description": "Contact provides contact information for the party in regard to the transmission of the message.", + "type": "array", + "items": { + "type": "object", + "required": ["name"], + "properties": { + "name": { + "description": "Name contains a humain-readable name for the contact.", + "$ref": "#/definitions/localisedBestMatchText" + }, + "names": { "description": "Name contains a humain-readable name for the contact.", - "$ref": "#/definitions/name" - }, - "department": { + "$ref": "#/definitions/localisedText" + }, + "department": { + "description": "Department is a humain-readable designation of the organisational structure by a linguistic expression, within which the contact person works.", + "$ref": "#/definitions/localisedBestMatchText" + }, + "departments": { "description": "Department is a humain-readable designation of the organisational structure by a linguistic expression, within which the contact person works.", - "$ref": "#/definitions/textType" - }, - "role": { - "description": "Role is the responsibility of the contact person with respect to the object for which this person is the contact.", - "$ref": "#/definitions/textType" - }, - "telephones": { - "type": "array", - "items": { - "description": "Telephone holds the telephone number for the contact person.", - "type": "string" - } - }, - "faxes": { - "type": "array", - "items": { - "description": "Fax holds the fax number for the contact person.", - "type": "string" - } - }, + "$ref": "#/definitions/localisedText" + }, + "role": { + "description": "Role is the responsibility of the contact person with respect to the object for which this person is the contact.", + "$ref": "#/definitions/localisedBestMatchText" + }, + "roles": { + "description": "Role is the responsibility of the contact person with respect to the object for which this person is the contact.", + "$ref": "#/definitions/localisedText" + }, + "telephones": { + "type": "array", + "items": { + "description": "Telephone holds the telephone number for the contact person.", + "type": "string" + } + }, + "faxes": { + "type": "array", + "items": { + "description": "Fax holds the fax number for the contact person.", + "type": "string" + } + }, "x400s": { "type": "array", "items": { @@ -129,609 +152,534 @@ } }, "uris": { - "type": "array", - "items": { - "description": "URI holds an information URL for the contact person.", - "type": "string", - "format": "uri" - } - }, - "emails": { - "type": "array", - "items": { - "description": "Email holds the email address for the contact person.", - "type": "string", - "format": "email" - } - } - } - } - } - } - }, - "name": { - "$ref": "#/definitions/textType", - "description": "Name is a reusable element, used for providing a human-readable localised name for an object." - }, - "textType": { - "description": "TextType provides for a set of language-specific alternates to be provided for any human-readable constructs in the instance. ", - "type": "object", - "patternProperties": { - "^(?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))$|^((?:[a-z]{2,3}(?:(?:-[a-z]{3}){1,3})?)|[a-z]{4}|[a-z]{5,8})(?:-([a-z]{4}))?(?:-([a-z]{2}|[0-9]{3}))?((?:-(?:[0-9a-z]{5,8}|[0-9][0-9a-z]{3}))*)?((?:-[0-9a-wy-z](?:-[0-9a-z]{2,8})+)*)?(-x(?:-[0-9a-z]{1,8})+)?$|^(x(?:-[0-9a-z]{1,8})+)$": { - "type": "string" - } - } - }, - "error": { - "type": "object", - "required": [ - "code" - ], - "properties": { - "code": { - "type": "number" - }, - "title": { - "$ref": "#/definitions/textType" - }, - "detail": { - "$ref": "#/definitions/textType" - }, - "links": { - "$ref": "#/definitions/links" - } - } - }, - "links": { - "description": "Links field is an array of link objects. If appropriate, a collection of links to additional external resources for the header.", - "type": "array", - "items": { - "type": "object", - "properties": { - "href": { - "$ref": "#/definitions/uri" - }, - "rel": { - "description": "Relationship of the object to the external resource. See semantics below. Use 'self' to indicate the urn to the parent object.", - "anyOf": [ - { - "type": "string" - }, - { - "description": "structure: provides a reference to the data structure or metadata structure definition depending on the context. Other SDMX artefact types can be specified, e.g. dataflow, provisionagreement, etc. For the others please see: https://tools.ietf.org/rfc/rfc5988.txt", - "type": "string", - "enum": [ - "agencyscheme", - "alternate", - "appendix", - "bookmark", - "categorisation", - "categoryscheme", - "chapter", - "codelist", - "conceptscheme", - "constraint", - "contents", - "copyright", - "current", - "dataflow", - "dataconsumerscheme", - "dataproviderscheme", - "describedby", - "edit", - "edit-media", - "enclosure", - "first", - "glossary", - "help", - "hierarchicalcodelist", - "hub", - "index", - "last", - "latest-version", - "license", - "metadataflow", - "next", - "next-archive", - "organisationunitscheme", - "payment", - "prev", - "predecessor-version", - "previous", - "prev-archive", - "process", - "provisionagreement", - "related", - "replies", - "reportingtaxonomy", - "section", - "self", - "service", - "start", - "structure", - "structureset", - "stylesheet", - "subsection", - "successor-version", - "up", - "version-history", - "via", - "working-copy", - "working-copy-of" - ] - } - ] - }, - "urn": { - "description": "The urn holds a valid SDMX Registry URN (see SDMX Registry Specification for details).", - "$ref": "#/definitions/urn" - }, - "uri": { - "description": "The uri attribute holds a URI that contains a link to additional information about the resource, such as a web page. This uri is not an SDMX resource.", - "$ref": "#/definitions/uri" - }, - "title": { - "$ref": "#/definitions/textType" - }, - "type": { - "description": "A hint about the type of representation returned by the link.", - "type": "string" - }, - "hreflang": { - "description": "The natural language of the external link, the same as used in the HTTP Accept-Language request header.", - "type": "string", - "pattern": "^(?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))$|^((?:[a-z]{2,3}(?:(?:-[a-z]{3}){1,3})?)|[a-z]{4}|[a-z]{5,8})(?:-([a-z]{4}))?(?:-([a-z]{2}|[0-9]{3}))?((?:-(?:[0-9a-z]{5,8}|[0-9][0-9a-z]{3}))*)?((?:-[0-9a-wy-z](?:-[0-9a-z]{2,8})+)*)?(-x(?:-[0-9a-z]{1,8})+)?$|^(x(?:-[0-9a-z]{1,8})+)$" - } - }, - "anyOf": [ - { - "required": [ - "href", - "rel" - ] - }, - { - "required": [ - "urn", - "rel" - ] - } - ] - } - }, - "structure": { - "type": "object", - "required": [ - "dimensions" - ], - "properties": { - "links": { - "$ref": "#/definitions/links" - }, - "name": { - "$ref": "#/definitions/name" - }, - "description": { - "$ref": "#/definitions/textType" - }, - "dimensions": { - "type": "object", - "properties": { - "dataSet": { - "type": "array", - "items": { - "$ref": "#/definitions/dimension" - }, - "uniqueItems": true - }, - "series": { - "type": "array", - "items": { - "$ref": "#/definitions/dimension" - }, - "uniqueItems": true - }, - "observation": { - "type": "array", - "items": { - "$ref": "#/definitions/dimension" - }, - "uniqueItems": true - } - } - }, - "attributes": { - "type": "object", - "properties": { - "dataSet": { - "type": "array", - "items": { - "$ref": "#/definitions/attribute" - }, - "uniqueItems": true - }, - "series": { - "type": "array", - "items": { - "$ref": "#/definitions/attribute" - }, - "uniqueItems": true - }, - "observation": { - "type": "array", - "items": { - "$ref": "#/definitions/attribute" - }, - "uniqueItems": true - } - } - }, - "annotations": { - "type": "array", - "items": { - "type": "object", - "properties": { - "title": { - "description": "AnnotationTitle provides a title for the annotation.", - "type": "string" - }, - "type": { - "description": "AnnotationType is used to distinguish between annotations designed to support various uses. The types are not enumerated, as these can be specified by the user or creator of the annotations. The definitions and use of annotation types should be documented by their creator.", - "type": "string" - }, - "text": { - "description": "AnnotationText holds a language-specific string containing the text of the annotation.", - "$ref": "#/definitions/textType" - }, - "id": { - "description": "Non-standard identification of an annotation.", - "type": "string" - }, - "links": { - "description": "Links field is an array of link objects. Also used to specify the Annotation URL which points to an external resource which may contain or supplement the annotation (using 'self' as relationship). If a specific behavior is desired, an annotation type should be defined which specifies the use of this field more exactly. If appropriate, a collection of links to additional external resources.", - "$ref": "#/definitions/links" - } - } - } - } - } - }, - "dimension": { - "type": "object", - "required": [ - "id", - "keyPosition", - "values" - ], - "properties": { - "id": { - "type": "string", - "pattern": "^[A-Za-z][A-Za-z0-9_-]*$" - }, - "name": { - "$ref": "#/definitions/name" - }, - "description": { - "$ref": "#/definitions/textType" - }, - "roles": { - "type": "array", - "items": { - "type": "string", - "pattern": "^[A-Za-z][A-Za-z0-9_-]*$" - } - }, - "keyPosition": { - "type": "integer", - "minimum": 0 - }, - "default": { - "type": "string" - }, - "links": { - "$ref": "#/definitions/links" - }, - "annotations": { - "type": "array", - "items": { - "type": "integer", - "minimum": 0 - } - }, - "values": { - "$ref": "#/definitions/values" - } - } - }, - "attribute": { - "type": "object", - "required": [ - "id", - "relationship", - "values" - ], - "properties": { - "id": { - "type": "string", - "pattern": "^[A-Za-z][A-Za-z0-9_-]*$" - }, - "name": { - "$ref": "#/definitions/name" - }, - "description": { - "$ref": "#/definitions/textType" - }, - "roles": { - "type": "array", - "items": { - "type": "string", - "pattern": "^[A-Za-z][A-Za-z0-9_-]*$" - } - }, - "relationship": { - "$ref": "#/definitions/AttributeRelationshipType", - "description": "AttributeRelationship describes how the value of this attribute varies with the values of other components. These relationships expresses the attachment level of the attribute." - }, - "default": { - "type": "string" - }, - "links": { - "$ref": "#/definitions/links" - }, - "annotations": { - "type": "array", - "items": { - "type": [ - "integer" - ], - "minimum": 0 - } - }, - "values": { - "$ref": "#/definitions/attrvalues" - } - } - }, - "values": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "string", - "pattern": "^[A-Za-z0-9_@$-]+$" - }, - "name": { - "$ref": "#/definitions/name" - }, - "description": { - "$ref": "#/definitions/textType" - }, - "start": { - "type": "string", - "format": "date-time" - }, - "end": { - "type": "string", - "format": "date-time" - }, - "parent": { - "type": "string", - "pattern": "^[A-Za-z0-9_@$-]+$" - }, - "order": { - "type": "integer", - "minimum": 0 - }, - "links": { - "$ref": "#/definitions/links" - }, - "annotations": { - "type": "array", - "items": { - "type": [ - "integer" - ], - "minimum": 0 - } - } - } - }, - "minItems": 0, - "uniqueItems": true - }, - "attrvalues": { - "type": "array", - "items": { - "type": [ "null", "object" ], - "properties": { - "id": { - "type": "string", - "pattern": "^[A-Za-z0-9_@$-]+$" - }, - "name": { - "$ref": "#/definitions/name" - }, - "description": { - "$ref": "#/definitions/textType" - }, - "start": { - "type": "string", - "format": "date-time" - }, - "end": { - "type": "string", - "format": "date-time" - }, - "links": { - "$ref": "#/definitions/links" - }, - "annotations": { - "type": "array", - "items": { - "type": "integer", - "minimum": 0 - } - } - } - }, - "minItems": 0, - "uniqueItems": true - }, - "dataSet": { - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "Information", - "Append", - "Replace", - "Delete" - ] - }, - "reportingBegin": { - "type": "string" - }, - "reportingEnd": { - "type": "string" - }, - "validFrom": { - "type": "string", - "format": "date-time" - }, - "validTo": { - "type": "string", - "format": "date-time" - }, - "publicationYear": { - "type": "string" - }, - "publicationPeriod": { - "type": "string" - }, - "annotations": { - "type": "array", - "items": { - "type": "integer", - "minimum": 0 - } - }, - "attributes": { - "type": "array", - "items": { - "type": "integer", - "minimum": 0 - } - }, - "observations": { - "type": "object", - "patternProperties": { - "^[0-9]+(:[0-9]+)*$": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "additionalProperties": false - }, - "series": { - "type": "object", - "patternProperties": { - "^[0-9]+(:[0-9]+)*$": { - "type": "object", - "properties": { - "annotations": { - "type": "array", - "items": { - "type": "integer", - "minimum": 0 - } - }, - "attributes": { - "type": "array", - "items": { - "type": "integer", - "minimum": 0 - } - }, - "observations": { - "type": "object", - "patternProperties": { - "^[0-9]+(:[0-9]+)*$": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - "links": { - "$ref": "#/definitions/links" - } - }, - "required": [ - "links" - ] - }, - "AttributeRelationshipType": { - "description": "AttributeRelationshipType defines the structure for stating the relationship between an attribute and other data structure definition components.", - "type": "object", - "properties": { - "dimensions": { - "type": "array", - "items": { - "$ref": "#/definitions/urn", - "description": "Urn reference to a local dimension. This is used to reference dimensions in the data structure definition on which the value of this attribute depends. An attribute using this relationship can be either a group, series (or section), or observation level attribute. The attachment level of the attribute will be determined by the data format and which dimensions are referenced." - } - }, - "none": { - "type": "object", - "description": "This is an empty object and means that value of the attribute will not vary with any of the other data structure components. This will always be treated as a data set level attribute." - }, - "primaryMeasure": { - "$ref": "#/definitions/urn", - "description": "Urn reference to a primary measure locally, where the reference to the data structure definition which defines the primary measure is provided in another context (for example the data structure definition in which the reference occurs). This is used to specify that the value of the attribute is dependent upon the observed value. An attribute with this relationship will always be treated as an observation level attribute." - } - }, - "anyOf": [ - { - "required": [ - "dimensions" - ] - }, - { - "required": [ - "none" - ] - }, - { - "required": [ - "primaryMeasure" - ] - } - ] - }, - "uri": { - "description": "Contains the URL to the schema allowing to validate the message. This also allows identifying the version of SDMX-JSON format used in this message. Providing the link to the SDMX-JSON schema is recommended.", - "type": "string", - "format": "uri" - }, - "urn": { - "type": "string", - "format": "urn" - } - } + "type": "array", + "items": { + "description": "URI holds an information URL for the contact person.", + "type": "string", + "format": "uri" + } + }, + "emails": { + "type": "array", + "items": { + "description": "Email holds the email address for the contact person.", + "type": "string", + "format": "email" + } + } + } + } + } + } + }, + "localisedBestMatchText": { + "type": "string", + "description": "localisedBestMatchText is a reusable element, used for providing a human-readable best-language-match texts." + }, + "localisedText": { + "description": "localisedText provides for a set of language-specific alternates to be provided for any human-readable constructs in the instance. ", + "type": "object", + "patternProperties": {"^(?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))$|^((?:[a-z]{2,3}(?:(?:-[a-z]{3}){1,3})?)|[a-z]{4}|[a-z]{5,8})(?:-([a-z]{4}))?(?:-([a-z]{2}|[0-9]{3}))?((?:-(?:[0-9a-z]{5,8}|[0-9][0-9a-z]{3}))*)?((?:-[0-9a-wy-z](?:-[0-9a-z]{2,8})+)*)?(-x(?:-[0-9a-z]{1,8})+)?$|^(x(?:-[0-9a-z]{1,8})+)$": {"type": "string"}} + }, + "error": { + "description": "Error describes the structure of an error or warning message.", + "type": "object", + "required": ["code"], + "properties": { + "code": { + "description": "Provides a code number for the error message. Code numbers are defined in the SDMX 2.1 Web Services Guidelines.", + "type": "number" + }, + "title": { + "description": "Title contains the title of the message, in best-match language value. A short, human-readable localised summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.", + "$ref": "#/definitions/localisedBestMatchText" + }, + "titles": { + "description": "Title contains the title of the message, in parallel language values. A list of short, human-readable localised summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.", + "$ref": "#/definitions/localisedText" + }, + "detail": { + "description": "Detail contains the detailed text of the message, in best-match language value. A human-readable localised explanation specific to this occurrence of the problem. Like title, this field’s value can be localized. It is fully customizable by the service providers and should provide enough detail to ease understanding the reasons of the error.", + "$ref": "#/definitions/localisedBestMatchText" + }, + "details": { + "description": "Detail contains the detailed text of the message, in parallel language values. A list of human-readable localised explanations specific to this occurrence of the problem. Like title, this field’s value can be localized. It is fully customizable by the service providers and should provide enough detail to ease understanding the reasons of the error.", + "$ref": "#/definitions/localisedText" + }, + "links": { + "description": "Links field is an array of link objects. If appropriate, a collection of links to additional external resources for the error.", + "$ref": "#/definitions/links" + } + } + }, + "links": { + "description": "Links field is an array of link objects. If appropriate, a collection of links to additional external resources for the header.", + "type": "array", + "items": { + "type": "object", + "properties": { + "href": {"$ref": "#/definitions/uri"}, + "rel": { + "description": "Relationship of the object to the external resource. See semantics below. Use 'self' to indicate the urn to the parent object.", + "anyOf": [ + {"type": "string"}, + { + "description": "structure: provides a reference to the data structure or metadata structure definition depending on the context. Other SDMX artefact types can be specified, e.g. dataflow, provisionagreement, etc. For the others please see: https://tools.ietf.org/rfc/rfc5988.txt", + "type": "string", + "enum": [ + "agencyscheme", + "alternate", + "appendix", + "bookmark", + "categorisation", + "categoryscheme", + "chapter", + "codelist", + "conceptscheme", + "constraint", + "contents", + "copyright", + "current", + "dataflow", + "dataconsumerscheme", + "dataproviderscheme", + "describedby", + "edit", + "edit-media", + "enclosure", + "first", + "glossary", + "help", + "hierarchicalcodelist", + "hub", + "index", + "last", + "latest-version", + "license", + "metadataflow", + "next", + "next-archive", + "organisationunitscheme", + "payment", + "prev", + "predecessor-version", + "previous", + "prev-archive", + "process", + "provisionagreement", + "related", + "replies", + "reportingtaxonomy", + "section", + "self", + "service", + "start", + "structure", + "structureset", + "stylesheet", + "subsection", + "successor-version", + "up", + "version-history", + "via", + "working-copy", + "working-copy-of" + ] + } + ] + }, + "urn": { + "description": "The urn holds a valid SDMX Registry URN (see SDMX Registry Specification for details).", + "$ref": "#/definitions/urn" + }, + "uri": { + "description": "The uri attribute holds a URI that contains a link to additional information about the resource, such as a web page. This uri is not an SDMX resource.", + "$ref": "#/definitions/uri" + }, + "title": {"$ref": "#/definitions/localisedBestMatchText"}, + "titles": {"$ref": "#/definitions/localisedText"}, + "type": { + "description": "A hint about the type of representation returned by the link.", + "type": "string" + }, + "hreflang": { + "description": "The natural language of the external link, the same as used in the HTTP Accept-Language request header.", + "type": "string", + "pattern": "^(?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))$|^((?:[a-z]{2,3}(?:(?:-[a-z]{3}){1,3})?)|[a-z]{4}|[a-z]{5,8})(?:-([a-z]{4}))?(?:-([a-z]{2}|[0-9]{3}))?((?:-(?:[0-9a-z]{5,8}|[0-9][0-9a-z]{3}))*)?((?:-[0-9a-wy-z](?:-[0-9a-z]{2,8})+)*)?(-x(?:-[0-9a-z]{1,8})+)?$|^(x(?:-[0-9a-z]{1,8})+)$" + } + }, + "anyOf": [ + {"required": [ + "href", + "rel" + ]}, + {"required": [ + "urn", + "rel" + ]} + ] + } + }, + "structure": { + "type": "object", + "required": ["dimensions"], + "properties": { + "links": {"$ref": "#/definitions/links"}, + "name": {"$ref": "#/definitions/localisedBestMatchText"}, + "names": {"$ref": "#/definitions/localisedText"}, + "description": {"$ref": "#/definitions/localisedBestMatchText"}, + "descriptions": {"$ref": "#/definitions/localisedText"}, + "dimensions": { + "type": "object", + "properties": { + "dataSet": { + "type": "array", + "items": {"$ref": "#/definitions/dimension"}, + "uniqueItems": true + }, + "series": { + "type": "array", + "items": {"$ref": "#/definitions/dimension"}, + "uniqueItems": true + }, + "observation": { + "type": "array", + "items": {"$ref": "#/definitions/dimension"}, + "uniqueItems": true + } + } + }, + "attributes": { + "type": "object", + "properties": { + "dataSet": { + "type": "array", + "items": {"$ref": "#/definitions/attribute"}, + "uniqueItems": true + }, + "series": { + "type": "array", + "items": {"$ref": "#/definitions/attribute"}, + "uniqueItems": true + }, + "observation": { + "type": "array", + "items": {"$ref": "#/definitions/attribute"}, + "uniqueItems": true + } + } + }, + "annotations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "description": "AnnotationTitle provides a title for the annotation.", + "type": "string" + }, + "type": { + "description": "AnnotationType is used to distinguish between annotations designed to support various uses. The types are not enumerated, as these can be specified by the user or creator of the annotations. The definitions and use of annotation types should be documented by their creator.", + "type": "string" + }, + "text": { + "description": "AnnotationText holds a best language match string containing the text of the annotation.", + "$ref": "#/definitions/localisedBestMatchText" + }, + "texts": { + "description": "AnnotationText holds language-specific strings containing the texts of the annotation.", + "$ref": "#/definitions/localisedText" + }, + "id": { + "description": "Non-standard identification of an annotation.", + "type": "string" + }, + "links": { + "description": "Links field is an array of link objects. Also used to specify the Annotation URL which points to an external resource which may contain or supplement the annotation (using 'self' as relationship). If a specific behavior is desired, an annotation type should be defined which specifies the use of this field more exactly. If appropriate, a collection of links to additional external resources.", + "$ref": "#/definitions/links" + } + } + } + } + } + }, + "dimension": { + "type": "object", + "required": [ + "id", + "keyPosition", + "values" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_-]*$" + }, + "name": {"$ref": "#/definitions/localisedBestMatchText"}, + "names": {"$ref": "#/definitions/localisedText"}, + "description": {"$ref": "#/definitions/localisedBestMatchText"}, + "descriptions": {"$ref": "#/definitions/localisedText"}, + "roles": { + "type": "array", + "items": { + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_-]*$" + } + }, + "keyPosition": { + "type": "integer", + "minimum": 0 + }, + "default": {"type": "string"}, + "links": {"$ref": "#/definitions/links"}, + "annotations": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0 + } + }, + "values": {"$ref": "#/definitions/values"} + } + }, + "attribute": { + "type": "object", + "required": [ + "id", + "relationship", + "values" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_-]*$" + }, + "name": {"$ref": "#/definitions/localisedBestMatchText"}, + "names": {"$ref": "#/definitions/localisedText"}, + "description": {"$ref": "#/definitions/localisedBestMatchText"}, + "descriptions": {"$ref": "#/definitions/localisedText"}, + "roles": { + "type": "array", + "items": { + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_-]*$" + } + }, + "relationship": { + "$ref": "#/definitions/AttributeRelationshipType", + "description": "AttributeRelationship describes how the value of this attribute varies with the values of other components. These relationships expresses the attachment level of the attribute." + }, + "default": {"type": "string"}, + "links": {"$ref": "#/definitions/links"}, + "annotations": { + "type": "array", + "items": { + "type": ["integer"], + "minimum": 0 + } + }, + "values": {"$ref": "#/definitions/attrvalues"} + } + }, + "values": { + "type": "array", + "items": { + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^[A-Za-z0-9_@$-]+$" + }, + "name": {"$ref": "#/definitions/localisedBestMatchText"}, + "names": {"$ref": "#/definitions/localisedText"}, + "description": {"$ref": "#/definitions/localisedBestMatchText"}, + "descriptions": {"$ref": "#/definitions/localisedText"}, + "start": { + "type": "string", + "format": "date-time" + }, + "end": { + "type": "string", + "format": "date-time" + }, + "parent": { + "type": "string", + "pattern": "^[A-Za-z0-9_@$-]+$" + }, + "order": { + "type": "integer", + "minimum": 0 + }, + "links": {"$ref": "#/definitions/links"}, + "annotations": { + "type": "array", + "items": { + "type": ["integer"], + "minimum": 0 + } + } + } + }, + "minItems": 0, + "uniqueItems": true + }, + "attrvalues": { + "type": "array", + "items": { + "type": [ + "null", + "object" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^[A-Za-z0-9_@$-]+$" + }, + "name": {"$ref": "#/definitions/localisedBestMatchText"}, + "names": {"$ref": "#/definitions/localisedText"}, + "description": {"$ref": "#/definitions/localisedBestMatchText"}, + "descriptions": {"$ref": "#/definitions/localisedText"}, + "start": { + "type": "string", + "format": "date-time" + }, + "end": { + "type": "string", + "format": "date-time" + }, + "links": {"$ref": "#/definitions/links"}, + "annotations": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0 + } + } + } + }, + "minItems": 0, + "uniqueItems": true + }, + "dataSet": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "Information", + "Append", + "Replace", + "Delete" + ] + }, + "reportingBegin": {"type": "string"}, + "reportingEnd": {"type": "string"}, + "validFrom": { + "type": "string", + "format": "date-time" + }, + "validTo": { + "type": "string", + "format": "date-time" + }, + "publicationYear": {"type": "string"}, + "publicationPeriod": {"type": "string"}, + "annotations": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0 + } + }, + "attributes": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0 + } + }, + "observations": { + "type": "object", + "patternProperties": {"^[0-9]+(:[0-9]+)*$": { + "type": "array", + "items": {"type": "number"} + }}, + "additionalProperties": false + }, + "series": { + "type": "object", + "patternProperties": {"^[0-9]+(:[0-9]+)*$": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0 + } + }, + "attributes": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0 + } + }, + "observations": { + "type": "object", + "patternProperties": {"^[0-9]+(:[0-9]+)*$": { + "type": "array", + "items": {"type": "number"} + }}, + "additionalProperties": false + } + }, + "additionalProperties": false + }}, + "additionalProperties": false + }, + "links": {"$ref": "#/definitions/links"} + }, + "required": ["links"] + }, + "AttributeRelationshipType": { + "description": "AttributeRelationshipType defines the structure for stating the relationship between an attribute and other data structure definition components.", + "type": "object", + "properties": { + "dimensions": { + "type": "array", + "items": { + "$ref": "#/definitions/urn", + "description": "Urn reference to a local dimension. This is used to reference dimensions in the data structure definition on which the value of this attribute depends. An attribute using this relationship can be either a group, series (or section), or observation level attribute. The attachment level of the attribute will be determined by the data format and which dimensions are referenced." + } + }, + "none": { + "type": "object", + "description": "This is an empty object and means that value of the attribute will not vary with any of the other data structure components. This will always be treated as a data set level attribute." + }, + "primaryMeasure": { + "$ref": "#/definitions/urn", + "description": "Urn reference to a primary measure locally, where the reference to the data structure definition which defines the primary measure is provided in another context (for example the data structure definition in which the reference occurs). This is used to specify that the value of the attribute is dependent upon the observed value. An attribute with this relationship will always be treated as an observation level attribute." + } + }, + "anyOf": [ + {"required": ["dimensions"]}, + {"required": ["none"]}, + {"required": ["primaryMeasure"]} + ] + }, + "uri": { + "description": "Contains the URL to the schema allowing to validate the message. This also allows identifying the version of SDMX-JSON format used in this message. Providing the link to the SDMX-JSON schema is recommended.", + "type": "string", + "format": "uri" + }, + "urn": { + "type": "string", + "format": "urn" + } + } } diff --git a/data-message/tools/schemas/TODO.md b/data-message/tools/schemas/TODO.md deleted file mode 100644 index e44304a..0000000 --- a/data-message/tools/schemas/TODO.md +++ /dev/null @@ -1,13 +0,0 @@ -# TODO - - - -# DONE - -- Update to latest stable json-schema version (latest version is still v4). -- add id to the schema root -- additionalProperties allowed everywhere except observations and series -- Update description -- implement links arrays -- move error to definition -- implememt dataprovider (dataprovider is one of the supported links)