Skip to content

Cookbook: Mapping data to MODS that doesn't map nicely

Mark Jordan edited this page Apr 14, 2016 · 3 revisions

This recipe applies to all toolchains.

Islandora can use any XML-based metadata, but MODS is by far the most common schema. MODS offers a fairly rich tagset, but sometimes your source metadata contains fields that don't map to any MODS elements cleanly.

This is where MODS' <extension> element is useful. The Library of Congress documentation explains its purpose succinctly: "<extension> may be used for elements that are local to the creator of the data."

You can stuff whatever you want in an <extension> element as long as it's XML. For example, at Simon Fraser University, we have put both XML and JSON metadata (including structural metadata) for newspaper issues from our previous repository platform (CONTENTdm) in an <extension> element. We've also wrapped both the XML and JSON in a CDATA section since we don't want the XML to interfere with validating our MODS and since that is an easy way to make JSON well-formed XML. Here's an example of an issue-level MODS document:

<?xml version="1.0"?>
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:mods="http://www.loc.gov/mods/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
  <titleInfo>
    <nonSort>The</nonSort>
    <title>Canadian Jewish news</title>
  </titleInfo>
  <language>
    <languageTerm type="text">English</languageTerm>
    <languageTerm type="code" authority="iso639-2b">eng</languageTerm>
  </language>
  <genre authority="lcgft">newspapers</genre>
  <identifier type="local">Canadi600129</identifier>
  <accessCondition type="use and reproduction">Copyright the Multicultural History Society of Ontario.</accessCondition>
  <typeOfResource>text</typeOfResource>
  <note>Place of publication varies</note>
  <extension>
    <CONTENTdmData>
      <alias>cjn2_m</alias>
      <pointer>4543</pointer>
      <dmGetItemInfo timestamp="2016-03-31 10:04:22" mimetype="application/json" source="http://142.58.129.180:81/dmwebservices/index.php?q=dmGetItemInfo/cjn2_m/4543/json"><![CDATA[{"title":"Canadian Jewish News, January 29, 1960","langua":"eng","subjec":"Jews -- Canada -- Periodicals; Israel -- Politics and government -- Periodicals; Israel -- Foreign relations -- Periodicals","publis":"D.C. Nurenberger; Don Mills","date":"1960-01-29","type":"text","format":"Image\/jpeg2000","rights":"Copyright the Multicultural History Society of Ontario. Please see the terms of use at http:\/\/multiculturalcanada.ca\/cco_rights.htm","identi":"Canadi600129","fullte":{},"fullrs":{},"find":"4544.cpd","dmaccess":{},"dmimage":{},"dmcreated":"2015-03-18","dmmodified":"2015-03-18","dmoclcno":{},"dmrecord":"4543","restrictionCode":"1","cdmfilesize":"1043","cdmfilesizeformatted":"0.00 MB","cdmprintpdf":"0","cdmhasocr":"0","cdmisnewspaper":"0"}]]></dmGetItemInfo>
      <dmGetCompoundObjectInfo timestamp="2016-03-31 10:04:22" mimetype="text/xml" source="http://142.58.129.180:81/dmwebservices/index.php?q=dmGetCompoundObjectInfo/cjn2_m/4543/xml"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<cpd>
  <type>Document</type>
  <page>
    <pagetitle>Page 1</pagetitle>
    <pagefile>4536.jp2</pagefile>
    <pageptr>4535</pageptr>
  </page>
  <page>
    <pagetitle>Page 2</pagetitle>
    <pagefile>4537.jp2</pagefile>
    <pageptr>4536</pageptr>
  </page>
  <page>
    <pagetitle>Page 3</pagetitle>
    <pagefile>4538.jp2</pagefile>
    <pageptr>4537</pageptr>
  </page>
  <page>
    <pagetitle>Page 4</pagetitle>
    <pagefile>4539.jp2</pagefile>
    <pageptr>4538</pageptr>
  </page>
  <page>
    <pagetitle>Page 5</pagetitle>
    <pagefile>4540.jp2</pagefile>
    <pageptr>4539</pageptr>
  </page>
  <page>
    <pagetitle>Page 6</pagetitle>
    <pagefile>4541.jp2</pagefile>
    <pageptr>4540</pageptr>
  </page>
  <page>
    <pagetitle>Page 7</pagetitle>
    <pagefile>4542.jp2</pagefile>
    <pageptr>4541</pageptr>
  </page>
  <page>
    <pagetitle>Page 8</pagetitle>
    <pagefile>4543.jp2</pagefile>
    <pageptr>4542</pageptr>
  </page>
</cpd>
]]></dmGetCompoundObjectInfo>
    </CONTENTdmData>
  </extension>
  <identifier type="uuid">04b56b6f-ba31-443a-9376-1a0102f301e9</identifier>
  <identifier type="uri" invalid="yes" displayLabel="Migrated From">http://content.lib.sfu.ca/cdm/ref/collection/cjn2_m/id/4543</identifier>
  <originInfo>
    <place>
      <placeTerm type="code" authority="marccountry">onc</placeTerm>
      <placeTerm type="text">Toronto, Ontario</placeTerm>
    </place>
    <publisher>%value</publisher>
    <dateIssued encoding="w3cdtf" keyDate="yes">1960-01-29</dateIssued>
  </originInfo>
  <subject authority="lcsh">
    <topic>Jews, Canadian--Newspapers</topic>
    <topic>Jews--Newspapers</topic>
    <topic>Jews, Canadian--Ontario--Toronto--Newspapers</topic>
    <topic>Jews--Ontario--Toronto--Newspaperso</topic>
    <geographic>Ontario--Newspapers</geographic>
    <geographic>Toronto (Ont.)--Newspapers</geographic>
  </subject>
</mods>

To include this data in our MODS, we used the AddContentdmData metadata manipulator.

As an added bonus, the XML elements you put within <extension> can be used in Islandora Solr metadata displays and advanced search forms.

Cookbook table of contents

Clone this wiki locally