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 and puts whatever data it finds into the relevant JSON string or array - see mapping bib/item data to FOLIO

since FOLIO associates locations with call numbers and the ILS associated locations with items Walter has to figure how to do that...

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