Maps & Data Warehouse GIS & Visualization Web-based Software Geographic Metadata Interactive Maps Site Search Site Index Help Home Ansari Map Library UNR Libraries About the Keck Center W.M Keck Earth Sciences & Mining Research Information Center
 

Metadata
Tutorial

  We are in the process of including FGDC Standard metadata with our data where possible.  This page is a simple tutorial that describes how we process our metadata and what formats we use.
* What You'll Need
* Your Metadata File
* Running "chew and spit"
* Parsing Your Metadata
 

* What You'll Need:
You will need two DOS utilities:

* cns.exe (chew and spit)
* mp.exe (metadata parser)

Information about both are available here at the FGDC site and at the USGS metadata site.

To get these utilities, go to the USGS metadata site and download the "small package".  The two files are included in the package and can be copied into other directories independently.

* Your Metadata File:
To get started you will need a metadata file.  This can be a file that you've created from scratch (usually with a metadata creation utility) or one that you've borrowed, with permission, from another source (such as USGS).  Your metadata should be in plain ASCII text format in order for the cns utility to read it.

* Running "chew and spit":
The first step in creating a well-formatted metadata file is to run cns (chew and spit) on it.  This utility formats your metadata with things like proper syntax and indentation so it conforms to FGDC Standards and to allow the mp utility to process it correctly.  If there are errors in your metadata file, cns will list them by line number on the screen.  You can also have errors written to a file so you can use it as reference when repairing the errors in your metadata file.  You should have the file cns.exe in the directory that you're using for your metadata.  You can copy your metadata file to the directory that has the cns.exe file or vice versa.

Example of cns command in DOS window:

C:> cns -o myfile2.txt myfile.txt

This tells the program to use the input file myfile.txt to create the new file (output file--indicated by the "-o") myfile2.txt.

(Note: you can name the input and output files the same--if you're sure you don't mind the original file being overwritten with the new file)

Parsing Your Metadata:
After creating a new file that has been successfully processed by cns, you are ready to run the metadata parser.  The metadata parser allows you to create your metadata in several formats.   The most common formats are, .txt, .html, and .sgml (.sgml is used by many metadata search-engines).  An .xml file (another format used by many metadata search engines) and an FAQ format .html file are also popular formats.  At this point we include .txt, .html, FAQ .html, and .sgml metadata files with our data.

Example of mp command in DOS window:

C:> mp -t myfile.txt -h myfile.html -f myfile-faq.html -s myfile.sgml myfile.txt

You are choosing what each file name will be.  The switches (-t, -h, -f, -s) determine what kind of file they are going to be.  Warning:  Make sure you name your "-h" and your "-f" files different names or one will overwrite the other.  You can see I've added a "-faq" to the FAQ file.  You can choose how you wish to rename yours (or if you want the FAQ file at all).  Other logical options would be things like "myfile-f.html" or "myfilef.html".  The input file should be an ASCII text file that has been through the cns program.   The extension of the input file does not have to be .txt as long as the file is in the ASCII format (could be .met, for example).

It is also important to make all of the formatted files that you want at the same time.  The program makes links at the top of each metadata file to the other formats that are available.  If you don't make them all at once, it will not know which other formats to link to.  This is why, in the above example, I am overwriting the original text file, even though I obviously already have the metadata in .txt format (because it is the input file at the end of the command line).  If you decide later that you'd like the metadata in .xml format as well, you should start from scratch by including all of the switches from the example and add "-x myfile.xml" into the line.

 

Updated: Oct. 25, 2001

DataWorks Home  UNR Home University of Nevada, Reno