Skip to content

Ending punctuation

natlibfi-arlehiko edited this page Sep 6, 2018 · 2 revisions

Description

Checks whether data fields follow MARC ending punctuation rules and applies the missing punctuation.

Examples

Valid record

{
  "fields": [
    {
      "tag": "245",
      "subfields": [
        {
          "code": "a",
          "value": "Elämäni ja tutkimusretkeni / "
        },
        {
          "code": "c",
          "value": "Roald Amundsen ; suomentanut Sulo Veikko Pekkola."
        },
        {
          "code": "6",
          "value": "FOO"
        }
      ]
    },
    {
      "tag": "337",
      "subfields": [
        {
          "code": "a",
          "value": "käytettävissä ilman laitetta"
        },
        {
          "code": "b",
          "value": "n"
        },
        {
          "code": "2",
          "value": "rdamedia"
        }
      ]
    },
    {
      "tag": "500",
      "subfields": [
        {
          "code": "a",
          "value": "FOO (Bar)"
        }
      ]
    }
  ]
}

Invalid record

{
  "fields": [
    {
      "tag": "245",
      "subfields": [
        {
          "code": "a",
          "value": "Elämäni ja tutkimusretkeni / "
        },
        {
          "code": "c",
          "value": "Roald Amundsen ; suomentanut Sulo Veikko Pekkola"
        },
        {
          "code": "6",
          "value": "FOO"
        }
      ]
    },
    {
      "tag": "337",
      "subfields": [
        {
          "code": "a",
          "value": "käytettävissä ilman laitetta"
        },
        {
          "code": "b",
          "value": "n."
        },
        {
          "code": "2",
          "value": "rdamedia"
        }
      ]
    },
    {
      "tag": "500",
      "subfields": [
        {
          "code": "a",
          "value": "FOO (Bar)."
        }
      ]
    }
  ]
}

Result

{
  valid: false,
  messages: [
    'Field 245 has invalid ending punctuation',
    'Field 337 has invalid ending punctuation',
    'Field 500 has invalid ending punctuation',
  ]
}