Skip to content

Metadata manipulator: AddCsvData

Mark Jordan edited this page Jan 6, 2016 · 1 revision

Overview

This metadata manipulator adds the complete CSV record for an object to an <extension><CSVData></CSVData></extension> element in the object's MODS.xml.

Toolchains

This metadata manipulator applies to all CSV toolchains.

Configuration

To register this manipulator in your toolchain, add the following line to the "[MANIPULATORS]" section of your .ini file:

metadatamanipulators[] = "AddCsvData"

Also note that the mappings file must contain a row that adds the following element to your MODS: <extension><CSVData></CSVData></extension>, e.g.,

null5,<extension><CSVData></CSVData></extension>

Parameters

This manipulator does not take any parameters.

Functionality

The purpose of this metadata manipulator is to include the entire CSV record for an object in the object's MODS.xml document. The principle use case for doing this is that the CSV record contains more data than you want to map to standard MODS elements.

The data is wrapped in a <CSVData> element, and is stored as JSON wrapped in a CDATA section. Timestamp and mimetype attributes are added automatically. The value of the timestamp attribute is when the MODS document was created.

Some typical <extension><CSVData> markup added to a MODS document by this manipulator looks like this:

 <extension>
    <CSVData>
      <id_in_csv>6971</id_in_csv>
      <CSVRecord timestamp="2016-01-06 07:35:05" mimetype="application/json"><![CDATA[{"CartoonID":"6971","CartoonKey":"3-2004-03-29","Cartoonist":"Krieger, Bob","Date":"2004-03-29","CartoonText":"Finally acting like a premier","PhysicalDescription":"20.5 cm x 24.7 cm","PublicationInfo":"The Provine","DisplayNotes":"","MsCCode":"MsC 25.KRI.6.67","MD5Checksum":"c27fa07e838ec02146e738c9a9478585","Subjects":"MacPhail, Joy","Subjects_TGM1":"Feet;Mouths","Subjects_LCSH":"Premiers (Canada)","File":"3-2004-03-29.tif","key":"6971"}]]></CSVRecord>
    </CSVData>
  </extension>
Clone this wiki locally