You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Next »

this is the Perl script that parses MARC records and POSTs instances, holdingsRecords, and items.

first it loads various db table names, (sometimes) codes, and UUIDs into hashes - this way the script only has to ask FOLIO for these values once and can then access the info quickly for each of the hundreds of thousands of MARC records that need to be processed - these db tables include

then it fetches a MARC record from Walter's folio::marcRecords db table like so : select marc from marcRecords where instanceId is null limit 1;

next it parses the MARC record for the following tags and puts whatever data it finds into the relevant JSON string or array

    • 130 → alternativeTitles
    • 210 → alternativeTitles
    • 222 → alternativeTitles
    • 240 → alternativeTitles
    • 242 → alternativeTitles
    • 243 → alternativeTitles
    • 246 → alternativeTitles
      • # - No type specified
      • 0 - Portion of title
      • 1 - Parallel title
      • 2 - Distinctive title
      • 3 - Other title
      • 4 - Cover title
      • 5 - Added title page title
      • 6 - Caption title
      • 7 - Running title
      • 8 - Spine title
    • 247 → alternativeTitles
    • 730 → alternativeTitles
    • 740 → alternativeTitles


when it's all done it updates Walter's folio::marcRecords db table like so : update marcRecords set instanceId=$instanceId where catalogKey=$catalogKey; 

rinse & repeat

  • No labels