Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Creation of metadata for larger sets of assets can be easier to manage in tabular form. Sometimes metadata is already available in a format that can be easily transformed to a spreadsheet. The template provided here serves as a generalized, extensible starting point for organizing metadata in tables. Metadata organized according to this template can be transformed to XML files with OpenRefine. Use the step-by-step-instructions on this page: Convert tabular metadata to XML

Works out of the box

The template provided here will work out of the box without the need to create an individual XML template. Cells in the metadata spreadsheet that are left empty will not result in empty XML elements or attributes.

Extending the generic template

If your metadata contains multiple titles, descriptions, or notes per asset, you will need to extend the template files: For each data column you add in the spreadsheet you will have to repeat a block of code in the XML document (dams-xml-template.xml).

The XML template document contains comments that detail which blocks of code can be repeated if necessary:

Example: repeatable template block
<!-- Add'l Genre term; duplicate section as necessary -->
	{{if(isNull(cells['Genre2']), "", jsonize("<genre").replace('"',''))}}
        {{if(isNull(cells['Genre2Authority']), "", jsonize("authority='" + cells['Genre2Authority'].value + "'").replace('"',''))}} 
        {{if(isNull(cells['Genre2AuthorityURI']), "", jsonize("authorityURI='" + cells['Genre2AuthorityURI'].value + "'").replace('"',''))}}
        {{if(isNull(cells['Genre2Lang']), "", jsonize("lang='" + cells['Genre2Lang'].value + "'").replace('"',''))}}
    {{if(isNull(cells['Genre2']), "", jsonize(">" + cells['Genre2'].value + "</genre>").replace('"',''))}}

The code references the spreadsheet columns that are going to populate the XML template: Genre2, Genre2Authority, Genre2AuthorityURI, Genre2Lang. If you duplicate a code block in the XML document, make sure to change the code to reference the new metadata columns you are adding (e.g. Genre3, Genre3Authority, Genre3AuthorityURI, Genre3Lang).

Remember that some XML elements like Identifiers or Notes always need a respective Type attribute to be specified (e.g. OCLC number, call number, etc.)


  File Modified

  • No labels