pkiraly / qa-catalogue

QA catalogue – a metadata quality assessment tool for library catalogue records (MARC, PICA)
GNU General Public License v3.0
78 stars 17 forks source link

Referencing code lists in JSON export #341

Open pkiraly opened 11 months ago

pkiraly commented 11 months ago

code lists should be reorganize so that they should be references.

Originally posted by @pkiraly in https://github.com/pkiraly/qa-catalogue/issues/45#issuecomment-1782642514

pkiraly commented 11 months ago

@nichtich @timathom I have implemented what Jakob suggested, but I have two notes:

An example:

    "013": {
      ...
      "subfields": {
        ...
        "b": {
          "label": "Country",
          "repeatable": false,
          "codes": "https://www.loc.gov/marc/countries/countries_code.html"
        },
        ...
      }
    }

then the codelist might be a pure list of codes

  "codelists": {
    "https://www.loc.gov/marc/countries/countries_code.html": {
      "aa": {
        "label": "Albania"
      },
      "abc": {
        "label": "Alberta"
      },
        ...
      }
    }

or it might have additional metadata, such as a name:

  "codelists": {
    "https://www.loc.gov/marc/countries/countries_code.html": {
      "name": "MARC Code List for Countries",                 ← here is the name of the code list 
      "codes": {
        "aa": {
          "label": "Albania"
        },
        "abc": {
          "label": "Alberta"
        },
        ...
      }
    }
nichtich commented 11 months ago

Having only some codelists under codelists is ok and the position of this key does not matter as JSON knowns no key order. The extension of referenced codelists with metadata makes sense. This requires a breaking change in Avram specification but its worth to do. See https://github.com/gbv/avram/issues/37