Skip to content

Instantly share code, notes, and snippets.

@krebeck
Forked from sallain/modstemplate.xml
Last active March 1, 2022 19:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krebeck/1c3c0257cecb25eb1a7c to your computer and use it in GitHub Desktop.
Save krebeck/1c3c0257cecb25eb1a7c to your computer and use it in GitHub Desktop.
MODS Template for Open Refine
<!-- For Prefix -->
<?xml version="1.0" encoding="UTF-8"?>
<modsCollection xmlns="http://www.loc.gov/mods/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd">
<!-- For Row Template -->
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd">
<titleInfo>
<title>{{jsonize(cells["name_of_title_column"].value).replace('"', '')}}</title>
</titleInfo>
<name>
<namePart>{{jsonize(cells["name_of_creator_column"].value).replace('"', '')}}</namePart>
<role>
<roleTerm type="text">Creator</roleTerm>
</role>
</name>
<genre>{{jsonize(cells["name_of_genre/type_column"].value).replace('"', '')}}</genre>
<subject>
<topic>{{jsonize(cells["name_of_subject_column"].value).replace('"', '')}}</topic>
</subject>
<note>{{jsonize(cells["name_of_note/description_column"].value).replace('"', '')}}</note>
<originInfo>
<publisher>{{jsonize(cells["name_of_publisher_column"].value).replace('"', '')}}</publisher>
</originInfo>
<originInfo>
<dateCreated>{{jsonize(cells["name_of_date_column"].value).replace('"', '')}}</dateCreated>
</originInfo>
<physicalDescription>
<extent>{{jsonize(cells["name_of_coverage_column"].value).replace('"', '')}}</extent>
</physicalDescription>
<identifier type="handle">{{jsonize(cells["name_of_identifier_column"].value).replace('"', '')}}</identifier>
<language>
<languageTerm type="text">{{jsonize(cells["name_of_language_column"].value).replace('"', '')}}</languageTerm>
</language>
<accessCondition>{{jsonize(cells["name_of_rights_column"].value).replace('"', '')}}</accessCondition>
</mods>
<!-- Don't put anything in Row Separator -->
<!-- For Suffix -->
</modsCollection>
@krebeck
Copy link
Author

krebeck commented Oct 21, 2015

added .replace() after .value) to get rid of quotes if necessary.

Example {{jsonize(cells["Rights"].value).replace('"', '')}} (that's a single quotes with a double quote inside...comma...single quotes with nothing inside).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment