[librecat-dev] Camandu, data lookup

Uldis Bojars captsolo at gmail.com
Tue Jan 7 16:43:37 CET 2020


Hi Patrick,

Thanks!

Is this file lookup approach viable in case if the lookup table is large
(40+ thousand entries)?

I noticed that Catmandu can work with MongoDB or other databases and was
wondering if they might be useful here. Unfortunately, I don't have
experience using Catmandu with these databases.

Cheers,
Uldis


On Tue, 7 Jan 2020 at 17:32, Patrick Hochstenbach <
Patrick.Hochstenbach at ugent.be> wrote:

> First create a file lookup.csv:
>
> name,value
> foo,bar
> bla,blo
> test,rest
>
> Now you can process your marc with this fix:
>
> do marc_each()
>   if marc_has(372a)
>     marc_map(372a,tmp)
>     lookup(tmp,”lookup.csv",delete:1)
>     if exists(tmp)
>         marc_set(3720,$.tmp)
>     end
>   end
> end
>
> The ‘do marc_each’ will make sure this fix is executed for each seperate
> field  in the marc (and supports repeated fields). This fix will not work
> when you want to set the value of another MARC fields at a different place
> in the MARC record.
>
> Patrick
>
> > On 7 Jan 2020, at 13:48, Uldis Bojars <captsolo at gmail.com> wrote:
> >
> > Hi all,
> >
> > How can I use Catmandu to look up values in a MARC subfield (e.g. 372
> $a) in a database and add information found in the database to this MARC
> field (in subfield $0 in this case)?
> >
> > The list of values to look up comes from the a MARC authority file:
> system numbers (fld. 001) and labels (fld. 150 $a) of MARC 150 records.
> >
> > It makes sense to preprocess the MARC file and extract the fields to
> look up (system number, label) but what is the best practice for storing
> and looking up this information using Catmandu?
> >
> > Best regards,
> > Uldis
> >
> > _______________________________________________
> > librecat-dev mailing list
> > - send list mails to librecat-dev at lists.uni-bielefeld.de
> > - to unsubscribe or change options, visit
> https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev
> > - project website: http://librecat.org/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-bielefeld.de/mailman2/unibi/public/librecat-dev/attachments/20200107/7867025e/attachment.html>


More information about the librecat-dev mailing list