17  Avram Schemas

The definition of valid MARC21 in QA catalogue is partly hard-coded in form of Java classes. The Avram Schema format has been developed to encode information about MARC and related formats independent from implementations (see MARC21 structure in JSON for some historical background). The definition of PICA-based formats and UNIMARC has already been moved to Avram Schemas. Repository directory avram-schemas contains the following schema files:

Format File
MARC21 marc.json
UNIMARC unimarc.json
K10plus PICA (title) k10plus-title.json

To check schema files against the Avram specification. Install a node script with npm ci and run:

./avram-schemas/validate-schemas

To generate HTML display of schema files (see Self Descriptive MARC code for an earlier version):

./avram-schemas/html-schemas

17.1 Export Java classes to MARC21 schemas

The script export-schema, implemented in de.gwdg.metadataqa.marc.cli.utils.MappingToJson can be used to export an Avram Schema for MARC21 from Java classes. Some additional, non-standard information is included on request.

Options:

To export the most used forms of the schema into into directory avram-schemas/, call:

./qa-catalogue export-schema-files

The script version generates 3 files, with different details:

  • avram-schemas/marc.json (valid Avram)
  • avram-schemas/marc-schema-with-solr.json
  • avram-schemas/marc-schema-with-solr-and-extensions.json
Listing 17.1: An excerpt of the MARC21 Avram Schema with extension compliance-level, frbr-functions, and code lists
{
"010":{
  "tag":"010",
  "label":"Library of Congress Control Number",
  "url":"https://www.loc.gov/marc/bibliographic/bd010.html",
  "repeatable":false,
  "compilance-level":{
    "national":"Mandatory if applicable",
    "minimal":"Mandatory if applicable"
  },
  "indicator1":null,
  "indicator2":null,
  "subfields":{
    "a":{
      "label":"LC control number",
      "repeatable":false,
      "frbr-functions":[
        "Data Management/Identify",
        "Data Management/Process"
      ],
      "compilance-level":{
        "national":"Mandatory if applicable",
        "minimal":"Mandatory if applicable"
      }
    },
    ...
  }
},
"013":{
  "tag":"013",
  "label":"Patent Control Information",
  "url":"https://www.loc.gov/marc/bibliographic/bd013.html",
  "repeatable":true,
  "compilance-level":{"national":"Optional"},
  "indicator1":null,
  "indicator2":null,
  "subfields":{
    "b":{
      "label":"Country",
      "repeatable":false,
      "codelist":{
        "name":"MARC Code List for Countries",
        "url":"http://www.loc.gov/marc/countries/countries_code.html",
        "codes":{
          "aa":{"label":"Albania"},
          "abc":{"label":"Alberta"},
          "-ac":{"label":"Ashmore and Cartier Islands"},
          "aca":{"label":"Australian Capital Territory"},