Metadata Resolver Quick Start Guide

From NOAA Environmental Data Management Wiki

Xlink Resolver Quick Start Guide

The Xlink Resolver is a tool developed at NGDC for building a composite XML from a collection of components. Components are referenced from unresolved XML using the xlink attribute. Each xlink points to the storage location of the component. The resolver retrieves components via the xlink URL. Currently, the most common storage locations for components are Web Accessible Folders (WAFs) and the Docucomp Component Library. When the resolver runs it fetches each component from it's xlink referenced location, and embeds it in the input XML. Thus the input XML becomes resolved. For specific information about creating unresolved XML see the help section Creating an Unresolved Record.

Resolving

Metadata Resolver

To access the single file resolver go to Record Services and select resolver.

1. To resolve enter the file path or URL to the unresolved XML record.
2. Select the 'File' or 'URL' Input Type radio button.
3. Select the 'Resolve' radio button.
4. Click submit and an XML view of the resolved record will display in the browser.

The resolved record will include a uuid attribute reference in the root element of each component. This reference lets human readers know that a component is being referenced, and the unique identifier for the component. The parent element of the component will include the xlink title attribute providing it was included in the input XML. Note the resolver tool will resolve nested components. It's not uncommon for component A to contain an xlink reference to component B, which contains an xlink reference to component C. In this case all nested components will be resolved recursively.

Simple Example

1. Create a simple component
a. Note the namespace declarations (xmlns) and uuid attribute in the root element.
b. A namespace declaration is required for each namespace (gmd and gco) used in the component.
c. A uuid is required for each component. It tags the component with a unique identifier.
    <gmd:CI_OnlineResource xmlns:gss="http://www.isotc211.org/2005/gss" 
     xmlns:gts="http://www.isotc211.org/2005/gts" 
     xmlns:gml="http://www.opengis.net/gml/3.2" 
     xmlns:xlink="http://www.w3.org/1999/xlink" 
     xmlns:gmi="http://www.isotc211.org/2005/gmi" 
     xmlns:gco="http://www.isotc211.org/2005/gco" 
     xmlns:gmd="http://www.isotc211.org/2005/gmd" 
     xmlns:gmx="http://www.isotc211.org/2005/gmx" 
     xmlns:gsr="http://www.isotc211.org/2005/gsr" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://www.isotc211.org/2005/gmi http://www.ngdc.noaa.gov/metadata/published/xsd/schema.xsd" 
     uuid="5e4e9d00-4288-11df-9879-0800200c9a66">
        <gmd:linkage>
            <gmd:URL>http://gcmd.nasa.gov/index.html</gmd:URL>
        </gmd:linkage>
        <gmd:protocol>
            <gco:CharacterString>http</gco:CharacterString>
        </gmd:protocol>
        <gmd:applicationProfile>
            <gco:CharacterString>web browser</gco:CharacterString>
        </gmd:applicationProfile>
        <gmd:name>
            <gco:CharacterString>NASA Global Change Master Directory</gco:CharacterString>
        </gmd:name>
        <gmd:description>
            <gco:CharacterString>Home Page</gco:CharacterString>
        </gmd:description>
        <gmd:function>
            <gmd:CI_OnLineFunctionCode 
              codeList="http://www.ngdc.noaa.gov/metadata/published/xsd/schema/resources/Codelist/gmxCodelists.xml#CI_OnLineFunctionCode" 
              codeListValue="information">
               information
            </gmd:CI_OnLineFunctionCode>
        </gmd:function>
    </gmd:CI_OnlineResource>


2. Publish the component to a web accessible location. For example the component created in step 1 has been published to the Docucomp library, and is accessible via the URL below. This is just an example. The component could be published to any web accessible location.
http://www.ngdc.noaa.gov/docucomp/iso/5e4e9d00-4288-11df-9879-0800200c9a66


3. Create Input XML
a. Below is the unresolved parent XML to the component created in step 2.
b. This xml contains an xlink reference to the components web accessible location.
c. Save this file to a local directory.
   <gmd:CI_ResponsibleParty>
        <gmd:organisationName>
            <gco:CharacterString>NASA Global Change Master Directory (GCMD) User Support Office</gco:CharacterString>
        </gmd:organisationName>
        <gmd:contactInfo>
            <gmd:CI_Contact>
                <gmd:phone gco:nilReason="missing"/>
                <gmd:address gco:nilReason="missing"/>
                <gmd:onlineResource xlink:href="http://www.ngdc.noaa.gov/docucomp/component/5e4e9d00-4288-11df-9879-0800200c9a66" xlink:title="GCMD"/>  
                <gmd:contactInstructions>
                    <gco:CharacterString>http://gcmd.nasa.gov/MailComments/MailComments.jsf?rcpt=gcmduso</gco:CharacterString>
                </gmd:contactInstructions>
            </gmd:CI_Contact>
        </gmd:contactInfo>
        <gmd:role/>
    </gmd:CI_ResponsibleParty>


4. Resolve with Single File Resolver
Metadata Resolver
a. Browse to Input XML File (See Resolver Image to Right).
b. Set 'Input Type' to File
c. Set 'Xlink Action' to Resolve
d. Click the Submit button