Skip to content

Metadata Mappings Helper

Mark Jordan edited this page Apr 24, 2018 · 13 revisions

MIK mappings files are CSV files that contain a set of two-column rows. Each row represents a mapping from one source metadata field to MODS top-level element. The first column contains source metadata field names and the second column contains XML (called "snippets") representing MODS top-level elements. A MODS snippet may contain the placeholder %value%, which represents the value of the corresponding source field. An example mapping looks like this:

Title,"<titleInfo><title>%value%</title></titleInfo>"

The MIK Metadata Mappings Helper is a simple Google spreadsheet that allows you to create mappings files. It provides a drop-down list of commonly used MODS snippets and a rudimentary tool for checking a snippet's syntax.

The high-level workflow for using the Helper is:

  1. copy the spreadsheet into your own Google Drive space,
  2. create some mappings,
  3. check the syntax of any MODS snippets that you have modified or entered yourself, and
  4. export your mappings as a CSV file for use with MIK.

Detailed instructions for using the Helper are:

  1. Visit the MIK Mappings Helper spreadsheet in Google Drive.

  2. When prompted to make a copy of the "MIK mappings file helper", do so. You may be asked to accept some authorization requests before you can make a copy.

  3. Once you make the copy, wait until the small yellow "Working..." message disappears. After it disappears, you will have your own copy of the spreadsheet that you can use to create your mappings file.

  4. The first column of the spreadsheet (column A) contains your source metadata field names; the second column (column B) contains the corresponding MODS XML snippets.

    • You will notice that the Helper provides a sample mapping for from Title to a basic MODS <titleInfo> snippet. The down-pointing arrows at the end of the second column will display the list of available snippets. Also notice that there is a "Move to Islandora Kit" menu, which we will use in step 7, below:

    screenshot 1

  5. In column A, add a source field name.

  6. In column B, type a MODS element name, or click on the down-pointing arrow to see a list of available MODS snippets. Choose the one you want:

    screenshot 2

  7. If desired, modify the snippet. You can even manually add a snippet that is not in the list. If you modify a snippet from the list or add a new one:

    • Google Sheets will indicate that you have a validation error because your snippet will no longer match an item from the list. A red triangle will appear in the upper-right corner of the cell, and you will see the message "Input must fall within the specified range". This is OK, it just indicates that your snippet is not in the controlled list.
    • You can check the syntax of the your modified snippet by making the cell containing the snippet the "current" cell (which means putting your cursor in the cell containing the snippet), and the opening the "Move to Islandora Kit" menu in Google Sheets and choosing the "Check snippet syntax" command. If the Helper finds no syntax errors, it will display a dialog box indicating that the snippet is OK:

    screenshot 3

    • If the Helper did find a syntax error in your modified snippet, it will display some information on the error in a red error dialog at the top of the spreadsheet, like this (note that the black circle and explanation text are part of this screenshot, and will not appear when you use the Helper):

    screenshot 4

    • The error messages that the Google Sheets XML parser provide are sometimes a bit inscrutable. At least they confirm that there is some illegal XML syntax in the snippet. Common problems to watch out for include missing opening or closing double quotation marks, missing < or > characters, or opening/closing XML tag mismatches, including improperly nested XML tags.
  8. Add new source metadata fields on the left, and choose corresponding MODS snippets on the right, until you have completed your mappings.

    • Remember, you only need to check a snippet's syntax if you modify one from the provided list, or if you create an entirely new snippet.
  9. Once you have completed all of your mappings, export them as a CSV file:

    1. open the Google Sheets' "File" menu
    2. select "Download as...."
    3. choose "Comma-separated values"
  10. The downloaded file can be used as your MIK mappings file. You can also edit if if you wish before using it.

Clone this wiki locally