Update of mapping to correct handling of repeated classification fields and subfields

MODDICORE-323 - Getting issue details... STATUS

Update to the default MARC Bib-to-Inventory Instance MAP:

  • Update mapping rules for the classification field in order to create separate entities per subfield 'a'

Update script: MODSOURMAN-1052 - Getting issue details... STATUS

Steps:

  1. If library tenant is using default mapping rules with NO changes (no customizations), then call PUT  /mapping-rules/marc-bib/restore
  2. If library tenant is using default mapping rules, WITH changes (local customization), then follow the next steps:
    • Send a GET request to /mapping-rules/marc-bib to retrieve the mapping rules
    • Update rules for classification type and id. Under fields 050, 060, 082, 090 add new property entityPerRepeatedSubfield :

      "entityPerRepeatedSubfield": true,
    • Under fields 050, 060, 082, 090 in target "classifications.classificationTypeId" remove property  applyRulesOnConcatenatedData:
      "applyRulesOnConcatenatedData": true
    • Under fields 050, 060, 082, 090 in target "classifications.classificationTypeId" remove "b" from subfield, result: 

      "subfield": [
         "a"
      ],
    • Under fields 050, 060, 082, 090 in target "classifications.classificationNumber" remove applyRulesOnConcatenatedData:

      "applyRulesOnConcatenatedData": true
    • Under fields 050, 060, 082, 090 in target "classifications.classificationNumber" remove "b" from subfield, result: 

      "subfield": [
         "a"
      ],
    •  Under fields 050, 060, 082, 090 in target "classifications.classificationNumber" add rule concat_subfields_by_name (NOTE: for 082 do not delete existing rule):
        "rules": [
          {
            "conditions": [
              {
                "type": "concat_subfields_by_name",
                "parameter": {
                  "subfieldsToConcat": [
                    "b"
                  ]
                }
              }
            ]
          }
        ]

Expected result:

  • Before changes:
      "050": [
        {
          "entity": [
            {
              "target": "classifications.classificationTypeId",
              "description": "Type for LC classification",
              "applyRulesOnConcatenatedData": true,
              "subfield": [
                "a",
                "b"
              ],
              "rules": [
                {
                  "conditions": [
                    {
                      "type": "set_classification_type_id",
                      "parameter": {
                        "name": "LC"
                      }
                    }
                  ]
                }
              ]
            },
            {
              "target": "classifications.classificationNumber",
              "description": "LC classification",
              "applyRulesOnConcatenatedData": true,
              "subfield": [
                "a",
                "b"
              ]
            }
          ]
        }
      ]
  • After changes: 
    "050": [
        {
          "entityPerRepeatedSubfield": true,
          "entity": [
            {
              "target": "classifications.classificationTypeId",
              "description": "Type for LC classification",
              "subfield": [
                "a"
              ],
              "rules": [
                {
                  "conditions": [
                    {
                      "type": "set_classification_type_id",
                      "parameter": {
                        "name": "LC"
                      }
                    }
                  ]
                }
              ]
            },
            {
              "target": "classifications.classificationNumber",
              "description": "LC classification",
              "subfield": [
                "a"
              ],
              "rules": [
                {
                  "conditions": [
                    {
                      "type": "concat_subfields_by_name",
                      "parameter": {
                        "subfieldsToConcat": [
                          "b"
                        ]
                      }
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]

       

  • Send PUT request to /mapping-rules/marc-bib and put in the body the updated JSON