Catmandu

Catmandu is a suite of processing tools that can transform library data into various formats. We can read and process MARC, MAB, PubMed but also JSON, YAML, Excel, CSV or many other import formats and protocols. We can store data easily in MongoDB, MySQL, Postgres, ElasticSearch, Solr and more. We can export data as SRU, OAI-PMH and many other formats. To transform the data we use a small language called 'Fix'. Using 'Fix' we can provide librarians and coders a way to cooperate on data cleaning projects. The Fix routines should be easy to read and write. With this functions you can transform any data model that can be expressed as JSON. In this demo application you can try out the Fix routines on an example MARC record. Follow the examples at the end of this page to transform our MARC example into RDF.

Fix


Export to:

Need help? Read our documentation or follow the examples at the end of this web page. When writing RDF we use Jakob Voss aREF RDF serialization format (see examples below).

Output


--- {}


MARC

FMT
LDR 00000cam a2200253 i 4500
001 000000008
005 20060913124037.0
008 780615s1977^^^^gw^a^^^^^b^^^^001^0^ger^^
010 $$a78364964
015 $$aGFR78-A51
020 $$a3770515366 : $$cDM36.00
035 $$9(DLC) 78364964
040 $$aDLC $$cDLC $$dDLC
050 $$aPN5220.S7 $$bS58
245 $$a"Der Spiegel" 28 (1972) : $$bAnalyse, Interpretation, Kritik / $$chrsg. von Helmut Arntzen undinfried Nolting.
260 $$aM√ľnchen : $$bFink, $$c1977.
300 $$a188, xxxiii p. : $$bill. ; $$c21 cm.
490 $$aLiteratur und Presse $$v3
504 $$aIncludes bibliographical references and indexes.
630 $$aSpiegel (Hamburg)
700 1 $$aArntzen, Helmut.
700 1 $$aNolting, Winfried.
852 4 $$xPS $$bPS01 $$cPS01 $$jPS01.S.0364 $$p000000015529
920 $$abook
SID $$aZ39 $$bLOC
Z30 1 $$lRUG01 $$LRUG01 $$mBOOK $$xPS $$1PS01 $$2PS01 $$3PS01.S.0364 $$5000000015529 $$819920902 $$f01 $$FLOAN/closed stacks

Examples

Map the marc 245a field to 'title'.

marc_map('245a','title');

Map both the 245a and 245b field to 'title'.

marc_map('245ab','title');

Map the 008 position 7 to 10 to 'year'.

marc_map('008/7-10','year');

Map the 020a to ISBN and clean the data with a regular expression.

marc_map('020a','isbn');
replace_all('isbn',' .*','');

Add a deeply.nested.field.

add_field('my.deeply.nested.field','hello');

Map all the authors in the 700a field into a list.

marc_map('700a','author.$append');

Join all authors of the previous step with a semi colon ';'.

marc_map('700a','author.$append');
join_field('author','; ');

Create an RDF triple with 001 as subject , dc:title as predicate and a cleaned up 245 as object. [Choose: RDF as export format to see the RDF/Turtle expression]

marc_map('001','_id');
prepend('_id','http://example.org/');
marc_map('245ab','dc:title', -join=>' ');
replace_all('dc:title',' /.*$','');
Choose: RDF as export format to see the RDF/Turtle expression.

Extend the previous example and add all authors as dc:creator. Clean the authors a bit too get rid of the period (.) at the end of the name. [Choose: RDF as export format to see the RDF/Turtle expression]

marc_map('001','_id');
prepend('_id','http://example.org/');
marc_map('245ab','dc:title', -join=>' ');
replace_all('dc:title',' /.*$','');
marc_map('700a','dc:creator.$append');
replace_all('dc:creator.*','\.$','');

Extend the previous example and add an Europeana 'Book' type to this record. [Choose: RDF as export format to see the RDF/Turtle expression]

marc_map('001','_id');
prepend('_id','http://example.org/');
marc_map('245ab','dc:title', -join=>' ');
replace_all('dc:title',' /.*$','');
marc_map('700a','dc:creator.$append');
replace_all('dc:creator.*','\.$','');
add_field('a','edm:Book');