Primary validation: checking metadata format and structure

You may find it helpful to have a plain text editor such as Notepad++. These examples will use the metadata parser. The Geospatial Metadata Validation Service provides a web interface for mp in the way it is most commonly used. That web interface will suffice to carry out these exercises.

Using the metadata parser mp through the Geospatial Metadata Validation Service

  1. We begin with a complete but uncomplicated metadata record: example-1.txt
  2. Open the Geospatial Metadata Validation Service
  3. Click and navigate to example-1.txt, which is probably in your Downloads folder. Click Open to select it.
  4. Click to run the validator, examine the various output files.

Common warning messages

  1. Example: example-warning.txt
  2. Types of warnings you may encounter:
    Mandatory if applicable
    A few major sections are mandatory if applicable; mp does not know whether they are applicable for your data, so generates a warning.
    Element names where general text is expected
    When parsing text values, mp must decide whether a word that matches an element name or is plain text or the start of another element; a warning is issued.
    Inconsistent indentation
    In text files, indentation indicates the structure, like an outline. Where the indentation is inconsistent, the meaning may be in doubt.
  3. Run this through the validation process (above) to see the error messages that result.

Recognizing simple errors

  1. Example containing errors: example-errors.txt
  2. Types of errors you may encounter:
    UnrecognizedElements that are misspelled or come from unrelated standards (for example HTML tags in an XML document)
    MisplacedElements put in the wrong place lose their semantic relationships.
    Too manySome elements may be repeated, others may not be.
    MissingA required element is not found.
    EmptyThe element is present but it doesn't have a value.
    Improper valuesFor a small number of elements, the Standard specifies what values are permitted, or the format of the values (for example, dates are always written YYYYMMDD, like 20160811, not 8/11/2016.
  3. Run this through the validation process (above) to see the error messages that result.

Format problems: minor indentation mistakes

  1. Small mistakes in formatting may occur: example-indent.txt
  2. Run this through the validation process (above) to see the error messages that result.

Format problems: lack of indentation

  1. Occasionally you may see a text metadata record lacking indentation: example-no-indent.txt
  2. Run this through the validation process (above) to see the error messages that result.
  3. This problem will require significant changes to the input file. The process will not be explored in this session, but you may explore it Here.

Working with XML

  1. Commonly metadata are produced in XML: example-1.xml
  2. The syntax of XML allows the metadata to be parsed with less ambiguity, so there are fewer warnings.

Errors in XML

  1. Editing XML directly using a text editor may introduce errors: example-xml-errors.xml
  2. Errors of this nature can be fixed using a plain text editor.

XML can be all on one line

  1. Diagnosing XML errors can be difficult because the entire document can be on one line: example-one-line.xml
  2. Several errors, in different locations within the file, are all on line 1.
  3. Copy the XML into the box at XML Pretty Print and click to re-format the XML document.

No errors? Great! Now the real review begins.

  1. Just because a record passes mp without error doesn't mean it's any good: minimal.met
  2. Next: Substantive review of metadata