Validating MODS

From UA Libraries Digital Services Planning and Documentation
Jump to: navigation, search

When you run makeMODS.pl to generate MODS from your tab-delimited UTF8 spreadsheet, the script will generate a manifest.xml file in the directory where the spreadsheet is located. It will be named for the spreadsheet, for example: u0001_2011012.12.m01.txt will have a manifest named u0001_2011012.12.manifest.xml. For remediated MODS, see the manifestMods script to create the manifest used in XMLSpy. In this file are links to each of the MODS files, so:

YOU MUST VALIDATE THE MODS BEFORE YOU MOVE THEM!!

1) Right click on this XML file and select to open it with XMLSpy. For this to work, see XMLSpy settings at the bottom of this page.

2) At the top of the XMLSpy window, click on XSL/XQuery and select XSL Transformation from the top of the dropdown list

HowToValidateBatch.png

3) XMLSpy will read the manifest (which contains a list of identifiers and links to each MODS file) and will test each one against the MODS_full_check.xsl in S:\\Metadata\Code\Schematron\. It will also validate each file.

4) When it has finished, an XSL Output.txt file will pop up with notes of problems found with each identifier (if no notes follow the identifier -- and the MODS file isn't listed at the bottom saying it's not valid, it's fine.)

ValidationOutputInfo.png

5) Also when it has finished, if any of the MODS failed to validate, that will show up in the bottom center window of XMLSpy, with a message such as:

  File:S\Digital Projects\Completed\u0002_0000006_0001993.mods.xml is not valid
  Reason:  The following elements are expected at this location(see below)

a) If this happens, either there was something unexpected or missing in the spreadsheet -- or something happened with the script.

b) Review the spreadsheet to look for what might be different

c) Contact someone who maintains this script.



6) If XMLSpy hangs, it's usually due to a non-UTF8 character in one of the files. When it hangs, a window will pop up that says "MODS_Schematron.xsl" at the top, and in the window at the bottom of the XMLSpy screen, you'll see a message such as

 "Cannot retrieve resource file:///S/:/Digital Projects/Completed/u0002_0000006/Metadata/MODS/u0002_0000006_0002011.mods.xml" 

Utf8problemInValidation.png


a) open the offending MODS file in XMLSpy. You will get a message such as "Your file contains 1 character(s) that should not be present in a file using the Unicode UTF-8 encoding. If you proceed, these characters will be replaced by a substitution character in the document window. Do you wish to continue opening the document?"

BadCharXMLspy.png

b) Click "OK".

c) Save the file and close it.

d) Close the Schematron window.

e) Go back to Step 2 above and continue.


7) When validation is complete, and all errors corrected, Metadata Librarians are ready to move the collection directory containing jpegs, MODS, and spreadsheet files (EXCEL, UTF.txt, and manifest) to Digital Projects folder named "Return_To-Digital_Services." Digital Services will move content and MODS to the server.

  • For the validation to work in xmlSpy, review the XSL tab under Tools>Options. The first item must be checked, "Built-in RaptorXML XSLT engine..." and check box to "Validate XML files used in transformation." Default file extension of output file is .xml, check box to "Reuse output window", and check box "Use file extension from <xsl:output method=""> attribute if provided."
http://www.lib.ua.edu/wiki/digcoll/index.php?title=Validating_MODS&printable=yes
www.lib.ua.edu
crawl=CC-MAIN-2019-09
15659
application/http; msgtype=response
sha1:LOJE3G7SC35WFWUJSF5DTVV5KK5G2S5F
<urn:uuid:d8447937-f2a6-43cf-8511-d9ab0f7a498e>
2019-02-23T09:45:18Z
130.160.24.157
text/html
sha1:BOJ2LB2CR2OOA2YFHZU435TNEQPDGXHX
<urn:uuid:a952d034-4498-4c8d-a21a-810d2035cbaa>
http://www.lib.ua.edu/wiki/digcoll/index.php?title=Validating_MODS&printable=yes
response
<urn:uuid:4244abe9-0e0f-44e9-9707-d20d5d857343>
isPartOf: CC-MAIN-2019-09
publisher: Common Crawl
description: Wide crawl of the web for February 2019
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-141-122-116.ec2.internal
software: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 0.11-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/