# Inconsistency in NBB data

**URL:** <https://dbnomics.discourse.group/t/inconsistency-in-nbb-data/261>\
**Category:** Data Issues\
**Created:** [June 27, 2019, 1:56pm UTC](https://dbnomics.discourse.group/t/inconsistency-in-nbb-data/261 "2019-06-27T13:56:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![acottrell](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@acottrell](https://dbnomics.discourse.group/u/acottrell)\
**Post date:** [June 27, 2019, 1:56pm UTC](https://dbnomics.discourse.group/t/inconsistency-in-nbb-data/261/1 "2019-06-27T13:56:22Z")

</div>

The JSON representation of data from the National Bank of Belgium appears to be inconsistent with what one finds from other providers, in respect of the dimensions\_values\_labels. Usually these labels are given as JSON objects but in the NBB case they are JSON arrays. Code written to handle the first case fails on the second.

I’m putting below snipped versions of IMF and NBB output to illustrate what I’m talking about. First IMF, which is the form that I’ve come to expect from dbnomics:

```
{
  "_meta" : {
    "args" : {
      [...]
      "series_ids" : [
        [
          "IMF",
          "BOP",
          "A.FR.BACK_BP6_USD"
        ]
      ]
    },
    "version" : "22.0.0"
  },
  "datasets" : {
    "IMF/BOP" : {
      [...]
      "code" : "BOP",
      "converted_at" : "2019-05-24T04:16:34Z",
      "description" : "Contains balance of payments ...,
      "dimensions_codes_order" : [
        "FREQ",
        "REF_AREA",
        "INDICATOR"
      ],
      "dimensions_labels" : {
        "FREQ" : "Frequency",
        "INDICATOR" : "Indicator",
        "REF_AREA" : "Reference Area"
      },
      "dimensions_values_labels" : {
        "FREQ" : {
          "A" : "Annual",
          "B" : "Bi-annual",
          "D" : "Daily",
          "M" : "Monthly",
          "Q" : "Quarterly",
          "W" : "Weekly"
        },
        "INDICATOR" : {
          "BACK_BP6_EUR" : "Net Lending ...",
          "BACK_BP6_USD" : "Net Lending ...",
  (and so on)

```

Now NBB: note that in this case the dimensions\_values\_labels are given as arrays:

```
{
  "_meta" : {
    "args" : {
      [...]
      "series_ids" : [
        [
          "NBB",
          "NADETP51N",
          "AN1.L.A"
        ]
      ]
    },
    "version" : "22.0.0"
  },
  "datasets" : {
    "NBB/NADETP51N" : {
      "code" : "NADETP51N",
      "converted_at" : "2018-12-18T14:21:29Z",
      "created_at" : "2018-12-18T14:21:29Z",
      "dimensions_codes_order" : [
        "NADETP51N_CATEGORY",
        "NADETP51N_PRICE",
        "FREQUENCY"
      ],
      "dimensions_labels" : {
        "FREQUENCY" : "Frequency",
        "NADETP51N_CATEGORY" : "Category",
        "NADETP51N_PRICE" : "Price type and unit"
      },
      "dimensions_values_labels" : {
        "FREQUENCY" : [
          [
            "A",
            "Annual"
          ]
        ],
        "NADETP51N_CATEGORY" : [
          [
            "TOT",
            "Fixed assets (AN.11000)"
          ],
```

---

<div class="post-metadata">

**Author:** ![pdi](https://avatars.discourse-cdn.com/v4/letter/p/e36b37/32.png) [@pdi](https://dbnomics.discourse.group/u/pdi)\
**Post date:** [July 1, 2019, 7:50am UTC](https://dbnomics.discourse.group/t/inconsistency-in-nbb-data/261/2 "2019-07-01T07:50:17Z")

</div>

Hi @acottrell,

In fact, it’s a feature, not an inconsistency.

Dimensions\_values\_labels property can be either a dict or a tuple (value, label) array, see [dataset.json schema](https://git.nomics.world/dbnomics/dbnomics-data-model/blob/master/dbnomics_data_model/schemas/dataset.json#L42).

This feature has been introduced on July 9, 2018 into [dbnomics data-model release 0.8.1](https://git.nomics.world/dbnomics/dbnomics-data-model/tree/0.8.1) to

> allow `dimensions_values_labels` (property of `dataset.json` ) to contain ordered list of values when lexicography sort is not appropriate.

See [CHANGELOG.md](https://git.nomics.world/dbnomics/dbnomics-data-model/blob/0.8.1/CHANGELOG.md#080-081)

Most DBnomics dataset.json files have `dimensions_values_labels` as dict (as it was the only option 1 year ago) but some (as you noticed) are arrays.

Regards

---

<div class="post-metadata">

**Author:** ![acottrell](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@acottrell](https://dbnomics.discourse.group/u/acottrell)\
**Post date:** [July 1, 2019, 3:06pm UTC](https://dbnomics.discourse.group/t/inconsistency-in-nbb-data/261/3 "2019-07-01T15:06:29Z")

</div>

OK, thank you for the explanation.
