A quick one: Use Metafacture to create a list of records with cataloging errors

Some records in our library catalog contain an error that causes trouble when we distribute catalog data to national aggregators like the Zentrales Verzeichnis Digitalisierter Drucke (ZVDD) central access point to printed works from the 15th century up to today, digitized in Germany. The catalogers made a typo and didn't separate the name of the publisher and the place of publication.

Metafacture is a really helpful suite of tools when working with a comparatively large set of records in a somewhat unwieldy format. The following Metamorph transformation runs over a dump of our catalog and outputs a list that contains the record's primary key Pica production number, PPN, an indicator of the resource type, and the erroneous publication statement.

<metamorph xmlns="http://www.culturegraph.org/metamorph" version="1" entityMarker="$">   <rules>     <!-- Titel, bei denen Verlag und Ort nicht getrennt sind            -->     <!-- Bsp. http://uri.hab.de/instance/proxy/opac-de-23/391719076.xml -->     <!-- hier 033A $p[Strassburg: Prüss]                                -->     <combine name="" value="${ppn} - ${mat} - ${fehler-verlag}">       <data source="003@$0" name="ppn"/>       <data source="002@$0" name="mat">         <substring start="0" end="1"/>       </data>       <data source="033A$p" name="fehler-verlag">         <regexp match=".+: .+" format="${0}"/>         <normalize-utf8/>       </data>     </combine>   </rules> </metamorph>

If the subfield p of the field 033A matches the specified regular expression, and both the subfield 0 of field 003@ and subfield 0 of field 002@ are present, combine these three fields to an unnamed output entity. Because 002@ and 003@ are always present, the combine acts as a filter and generates an output entity only if the erroneous 033A is detected.

I run this morph with a simple flux pipeline.

default src = "s:\\edoc\\ed000242\\2017\\20170429-title.pp"; default dst = "stdout"; src| open-file| as-records| decode-pica| morph(FLUX_DIR + morph)| encode-literals| write(dst);

Turns out that only 678 of appr. 1.2 million records or 0.06% are affected. This speaks volumes for the dedication of our staff and makes the problem managable.
http://dmaus.name/blog/2018.09/index.html
dmaus.name
crawl=CC-MAIN-2018-22
7454
application/http; msgtype=response
sha1:2EILDG4WSOFFIYCX2A2PXOQQQXR54ZSS
<urn:uuid:5a82968f-8e1e-40cb-9e95-7a586dd96ddb>
2018-05-27T03:16:59Z
46.38.249.94
text/html
sha1:XWCT3ZXBLAUDT7MOXN5NQIB2OW46DWZN
<urn:uuid:1fd90c4b-8d47-45ea-9593-c5379fd6b30b>
http://dmaus.name/blog/2018.09/index.html
response
<urn:uuid:016416e6-2fa7-4d25-ae86-ff27d9044f51>
robots: classic
hostname: ip-10-148-11-10.ec2.internal
software: Nutch 1.6 (CC)
isPartOf: CC-MAIN-2018-22
operator: Common Crawl Admin
description: Wide crawl of the web for May 2018
publisher: Common Crawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf