<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>

<rfc number="2731" category="info" xmlns:grddl='http://www.w3.org/2003/g/data-view#' grddl:transformation='rfc2629grddl.xslt'>
   
<front>
  <title>Encoding Dublin Core Metadata in HTML</title>
  <author initials="J." surname="Kunze" fullname="John A. Kunze">
    <organization abbrev="UC San Francisco">Center for Knowledge Management, University of California</organization>
    <address>
      <postal>
        <street>530 Parnassus Ave, Box 0840</street>
        <city>San Francisco</city><region>CA</region><code>94143-0840</code><country>USA</country>
      </postal>
      <facsimile>+1 415-476-4653</facsimile>
      <email>jak@ckm.ucsf.edu</email>
    </address>
  </author>
  <date month='December' year='1999'></date>
  <abstract>
  <t>
   The Dublin Core <xref target="DC1"/> is a small set of metadata elements for
   describing information resources.  This document explains how these
   elements are expressed using the META and LINK tags of HTML
   <xref target="HTML4.0"/>.  A sequence of metadata elements embedded in an HTML file
   is taken to be a description of that file.  Examples illustrate
   conventions allowing interoperation with current software that
   indexes, displays, and manipulates metadata, such as <xref target="SWISH-E"/>,
   <xref target="freeWAIS-sf2.0"/>, <xref target="GLIMPSE"/>, <xref target="HARVEST"/>, <xref target="ISEARCH"/>, etc., and the Perl
   <xref target="PERL"/> scripts in the appendix.
  </t>
  </abstract>
</front>

<middle>
<section title="Abstract">
<t>
  <spanx>(see above)</spanx>
</t>
</section>

<section title="HTML, Dublin Core, and Non-Dublin Core Metadata">
<t>
   The Dublin Core (DC) metadata initiative <xref target="DCHOME"/> has produced a
   small set of resource description categories <xref target="DC1"/>, or elements of
   metadata (literally, data about data).  Metadata elements are
   typically small relative to the resource they describe and may, if
   the resource format permits, be embedded in it.  Two such formats are
   the Hypertext Markup Language (HTML) and the Extensible Markup
   Language (XML); HTML is currently in wide use, but once standardized,
   XML <xref target="XML"/> in conjunction with the Resource Description Framework
   <xref target="RDF"/> promise a significantly more expressive means of encoding
   metadata.  The <xref target="RDF"/> specification actually describes a way to use
   RDF within an HTML document by adhering to an abbreviated syntax.
</t>
<t>
   This document explains how to encode metadata using HTML 4.0
   <xref target="HTML4.0"/>.  It is not concerned with element semantics, which are
   defined elsewhere.  For illustrative purposes, some element semantics
   are alluded to, but in no way should semantics appearing here be
   considered definitive.
</t>
<t>
   The HTML encoding allows elements of DC metadata to be interspersed
   with non-DC elements (provided such mixing is consistent with rules
   governing use of those non-DC elements).  A DC element is indicated
   by the prefix "DC", and a non-DC element by another prefix; for
   example, the prefix "AC" is used with elements from the A-Core <xref target="AC"/>.
</t>
</section>

<section title="The META Tag">
<t>
   The META tag of HTML is designed to encode a named metadata element.
   Each element describes a given aspect of a document or other
   information resource.  For example, this tagged metadata element,
</t>
<figure><artwork>
&lt;meta name    = "DC.Creator"
      content = "Simpson, Homer">
</artwork></figure>
<t>
   says that Homer Simpson is the Creator, where the element named
   Creator is defined in the DC element set.  In the more general form,
</t>
<figure><artwork>
&lt;meta name    = "PREFIX.ELEMENT_NAME"
      content = "ELEMENT_VALUE">
</artwork></figure>
<t>
   the capitalized words are meant to be replaced in actual
   descriptions; thus in the example,
</t>
<figure><artwork>
ELEMENT_NAME   was:  Creator
ELEMENT_VALUE  was:  Simpson, Homer
and PREFIX     was:  DC
</artwork></figure>
<t>
   Within a META tag the first letter of a Dublin Core element name is
   capitalized.  DC places no restriction on alphabetic case in an
   element value and any number of META tagged elements may appear
   together, in any order.  More than one DC element with the same name
   may appear, and each DC element is optional.  The next example is a
   book description with two authors, two titles, and no other metadata.
</t>
<figure><artwork>
&lt;meta name    = "DC.Title"
      content = "The Communist Manifesto">
&lt;meta name    = "DC.Creator"
      content = "Marx, K.">
&lt;meta name    = "DC.Creator"
      content = "Engels, F.">
&lt;meta name    = "DC.Title"
      content = "Capital">
</artwork></figure>
<t>
   The prefix "DC" precedes each Dublin Core element encoded with META,
   and it is separated by a period (.) from the element name following
   it.  Each non-DC element should be encoded with a prefix that can be
   used to trace its origin and definition; the linkage between prefix
   and element definition is made with the LINK tag, as explained in the
   next section.  Non-DC elements, such as Email from the A-Core <xref target="AC"/>,
   may appear together with DC elements, as in
</t>
<figure><artwork>
&lt;meta name    = "DC.Creator"
      content = "Da Costa, Jos&amp;eacute;">
&lt;meta name    = "AC.Email"
      content = "dacostaj@peoplesmail.org">
&lt;meta name    = "DC.Title"
      content = "Jesse &amp;#34;The Body&amp;#34; Ventura--A Biography">
</artwork></figure>
<t>
   This example also shows how some special characters may be encoded.
   The author name in the first element contains a diacritic encoded as
   an HTML character entity reference -- in this case an accented letter
   E.  Similarly, the last line contains two double-quote characters
   encoded so as to avoid being interpreted as element content
   delimiters.
</t>
</section>

<section title="The LINK Tag">
<t>
   The LINK tag of HTML may be used to associate an element name prefix
   with the reference definition of the element set that it identifies.
   A sequence of META tags describing a resource is incomplete without
   one such LINK tag for each different prefix appearing in the
   sequence.  The previous example could be considered complete with the
   addition of these two LINK tags:
</t>
<figure><artwork>
&lt;link rel     = "schema.DC"
     href    = "http://purl.org/DC/elements/1.0/">
&lt;link rel     = "schema.AC"
     href    = "http://metadata.net/ac/2.0/">
</artwork></figure>
<t>
   In general, the association takes the form
</t>
<figure><artwork>
&lt;link rel     = "schema.PREFIX"
     href    = "LOCATION_OF_DEFINITION">
</artwork></figure>
<t>
   where, in actual descriptions, PREFIX is to be replaced by the prefix
   and LOCATION_OF_DEFINITION by the URL or URN of the defining
   document.  When embedded in the HEAD part of an HTML file, a sequence
   of LINK and META tags describes the information in the surrounding
   HTML file itself.  Here is a complete HTML file with its own embedded
   description.
</t>
<figure><artwork>
&lt;html>
&lt;head>
&lt;title> A Dirge &lt;/title>
&lt;link rel     = "schema.DC"
     href    = "http://purl.org/DC/elements/1.0/">
&lt;meta name    = "DC.Title"
     content = "A Dirge">
&lt;meta name    = "DC.Creator"
     content = "Shelley, Percy Bysshe">
&lt;meta name    = "DC.Type"
     content = "poem">
&lt;meta name    = "DC.Date"
     content = "1820">
&lt;meta name    = "DC.Format"
     content = "text/html">
&lt;meta name    = "DC.Language"
     content = "en">
&lt;/head>
&lt;body>&lt;pre>
       Rough wind, that moanest loud
         Grief too sad for song;
       Wild wind, when sullen cloud
         Knells all the night long;
       Sad storm, whose tears are vain,
       Bare woods, whose branches strain,
       Deep caves and dreary main, -
         Wail, for the world's wrong!
&lt;/pre>&lt;/body>
&lt;/html>
</artwork></figure>
</section>

<section title="Encoding Recommendations">
<t>
   HTML allows more flexibility in principle and in practice than is
   recommended here for encoding metadata.  Limited flexibility
   encourages easy development of software for extracting and processing
   metadata.  At this early evolutionary stage of internet metadata,
   easy prototyping and experimentation hastens the development of
   useful standards.
</t>
<t>
   Adherence is therefore recommended to the tagging style exemplified
   in this document as regards prefix and element name capitalization,
   double-quoting (") of attribute values, and not starting more than
   one META tag on a line.  There is much room for flexibility, but
   choosing a style and sticking with it will likely make metadata
   manipulation and editing easier.  The following META tags adhere to
   the recommendations and carry identical metadata in three different
   styles:
</t>
<figure><artwork>
&lt;META NAME="DC.Format"
     CONTENT="text/html; 12 Kbytes">
&lt;meta
       Content = "text/html; 12 Kbytes"
       Name = "DC.Format"
>
&lt;meta name = "DC.Format" content = "text/html; 12 Kbytes">
</artwork></figure>
<t>
   Use of these recommendations is known to result in metadata that may
   be harvested, indexed, and manipulated by popular, freely available
   software packages such as <xref target="SWISH-E"/>, <xref target="freeWAIS-sf2.0"/>, <xref target="GLIMPSE"/>,
   <xref target="HARVEST"/>, and <xref target="ISEARCH"/>, among others.  These conventions also work
   with the metadata processing scripts appearing in the appendix, as
   well as with most of the <xref target="DCPROJECTS"/> applications referenced from
   the <xref target="DCHOME"/> site.  Software support for the LINK tag and qualifier
   conventions (see the next section) is not currently widespread.
</t>
<t>
   Ordering of metadata elements is not preserved in general.  Writers
   of software for metadata indexing and display should try to preserve
   relative ordering among META tagged elements having the same name
   (e.g., among multiple authors), however, metadata providers and
   searchers have no guarantee that ordering will be preserved in
   metadata that passes through unknown systems.
</t>
</section>

<section title="Dublin Core in Real Descriptions">
<t>
   In actual resource description it is often necessary to qualify
   Dublin Core elements to add nuances of meaning.  While neither the
   general principles nor the specific semantics of DC qualifiers are
   within scope of this document, everyday uses of the qualifier syntax
   are illustrated to lend realism to later examples.  Without further
   explanation, the three ways in which the optional qualifier syntax is
   currently (subject to change) used to supplement the META tag may be
   summarized as follows:
</t>
<figure><artwork>
&lt;meta lang    = "LANGUAGE_OF_METADATA_CONTENT" ... >

&lt;meta scheme  = "CONTROLLED_FORMAT_OR_VOCABULARY_OF_METADATA" ... >

&lt;meta name    = "PREFIX.ELEMENT_NAME.SUBELEMENT_NAME" ... >
</artwork></figure>
<t>
   Accordingly, a posthumous work in Spanish might be described with
</t>
<figure><artwork>
&lt;meta name    = "DC.Language"
     scheme  = "rfc1766"
     content = "es">
&lt;meta name    = "DC.Title"
     lang    = "es"
     content = "La Mesa Verde y la Silla Roja">
&lt;meta name    = "DC.Title"
     lang    = "en"
     content = "The Green Table and the Red Chair">
&lt;meta name    = "DC.Date.Created"
     content = "1935">
&lt;meta name    = "DC.Date.Available"
     content = "1939">
</artwork></figure>
<t>
   Note that the qualifier syntax and label suffixes (which follow an
   element name and a period) used in examples in this document merely
   reflect current trends in the HTML encoding of qualifiers.  Use of
   this syntax and these suffixes is neither a standard nor a
   recommendation.
</t>
</section>

<section title="Encoding Dublin Core Elements">
<t>
   This section consists of very simple Dublin Core encoding examples,
   arranged by element.
</t>
<figure><preamble>
   Title (name given to the resource)
</preamble><artwork>
&lt;meta name    = "DC.Title"
      content = "Polycyclic aromatic hydrocarbon contamination">

&lt;meta name    = "DC.Title"
      content = "Crime and Punishment">

&lt;meta name    = "DC.Title"
      content = "Methods of Information in Medicine, Vol 32, No 4">

&lt;meta name    = "DC.Title"
      content = "Still life #4 with flowers">

&lt;meta name    = "DC.Title"
      lang    = "de"
      content = "Das Wohltemperierte Klavier, Teil I">
</artwork></figure>

<figure><preamble>
   Creator (entity that created the content)
</preamble><artwork>
&lt;meta name    = "DC.Creator"
      content = "Gogh, Vincent van">
&lt;meta name    = "DC.Creator"
      content = "van Gogh, Vincent">

&lt;meta name    = "DC.Creator"
      content = "Mao Tse Tung">
&lt;meta name    = "DC.Creator"
      content = "Mao, Tse Tung">

&lt;meta name    = "DC.Creator"
      content = "Plato">
&lt;meta name    = "DC.Creator"
      lang    = "fr"
      content = "Platon">

&lt;meta name    = "DC.Creator.Director"
      content = "Sturges, Preston">
&lt;meta name    = "DC.Creator.Writer"
      content = "Hecht, Ben">
&lt;meta name    = "DC.Creator.Producer"
      content = "Chaplin, Charles">
</artwork></figure>

<figure><preamble>
   Subject (topic or keyword)
</preamble><artwork>
&lt;meta name    = "DC.Subject"
      content = "heart attack">
&lt;meta name    = "DC.Subject"
      scheme  = "MESH"
      content = "Myocardial Infarction; Pericardial Effusion">

&lt;meta name    = "DC.Subject"
      content = "vietnam war">
&lt;meta name    = "DC.Subject"
      scheme  = "LCSH"
      content = "Vietnamese Conflict, 1961-1975">

&lt;meta name    = "DC.Subject"
      content = "Friendship">
&lt;meta name    = "DC.Subject"
      scheme  = "ddc"
      content = "158.25">
</artwork></figure>

<figure><preamble>
   Description (account, summary, or abstract of the content)
</preamble><artwork>
&lt;meta name    = "DC.Description"
      lang    = "en"
      content = "The Author gives some Account of Himself and Family
                 -- His First Inducements to Travel -- He is
                 Shipwrecked, and Swims for his Life -- Gets safe on
                 Shore in the Country of Lilliput -- Is made a
                 Prisoner, and carried up the Country">

&lt;meta name    = "DC.Description"
      content = "A tutorial and reference manual for Java.">

&lt;meta name    = "DC.Description"
      content = "Seated family of five, coconut trees to the left,
                 sailboats moored off sandy beach to the right,
                 with volcano in the background.">
</artwork></figure>

<figure><preamble>
   Publisher (entity that made the resource available)
</preamble><artwork>
&lt;meta name    = "DC.Publisher"
      content = "O'Reilly">

&lt;meta name    = "DC.Publisher"
      content = "Digital Equipment Corporation">

&lt;meta name    = "DC.Publisher"
      content = "University of California Press">

&lt;meta name    = "DC.Publisher"
      content = "State of Florida (USA)">
</artwork></figure>

<figure><preamble>
   Contributor (other entity that made a contribution)
</preamble><artwork>
&lt;meta name    = "DC.Contributor"
      content = "Curie, Marie">

&lt;meta name    = "DC.Contributor.Photographer"
      content = "Adams, Ansel">
&lt;meta name    = "DC.Contributor.Artist"
      content = "Sendak, Maurice">
&lt;meta name    = "DC.Contributor.Editor"
      content = "Starr, Kenneth">
</artwork></figure>

<figure><preamble>
   Date (of an event in the life of the resource; <xref target="WTN8601"/> recommended)
</preamble><artwork>
&lt;meta name    = "DC.Date"
      content = "1972">

&lt;meta name    = "DC.Date"
      content = "1998-05-14">
&lt;meta name    = "DC.Date"
      scheme  = "WTN8601"
      content = "1998-05-14">

&lt;meta name    = "DC.Date.Created"
      content = "1998-05-14">
&lt;meta name    = "DC.Date.Available"
      content = "1998-05-21">
&lt;meta name    = "DC.Date.Valid"
      content = "1998-05-28">

&lt;meta name    = "DC.Date.Created"
      content = "triassic">
&lt;meta name    = "DC.Date.Acquired"
      content = "1957">

&lt;meta name    = "DC.Date.Accepted"
      scheme  = "WTN8601"
      content = "1998-12-02T16:59">

&lt;meta name    = "DC.Date.DataGathered"
      scheme  = "ISO8601"
      content = "98-W49-3T1659">

&lt;meta name    = "DC.Date.Issued"
      scheme  = "ANSI.X3.X30-1985"
      content = "19980514">
</artwork></figure>

<figure><preamble>
   Type (nature, genre, or category; <xref target="DCT1"/> recommended)
</preamble><artwork>
&lt;meta name    = "DC.Type"
      content = "poem">

&lt;meta name    = "DC.Type"
      scheme  = "DCT1"
      content = "software">
&lt;meta name    = "DC.Type"
      content = "software program source code">
&lt;meta name    = "DC.Type"
      content = "interactive video game">

&lt;meta name    = "DC.Type"
      scheme  = "DCT1"
      content = "dataset">

&lt;meta name    = "DC.Type"
      content = "web home page">
&lt;meta name    = "DC.Type"
      content = "web bibliography">

&lt;meta name    = "DC.Type"
      content = "painting">
&lt;meta name    = "DC.Type"
      content = "image; woodblock">
&lt;meta name    = "DC.Type"
      scheme  = "AAT"
      content = "clipeus (portrait)">
&lt;meta name    = "DC.Type"
      lang    = "en-US"
      content = "image; advertizement">

&lt;meta name    = "DC.Type"
      scheme  = "DCT1"
      content = "event">
&lt;meta name    = "DC.Type"
      content = "event; periodic">
</artwork></figure>

<figure><preamble>
   Format (physical or digital data format, plus optional dimensions)
</preamble><artwork>
&lt;meta name    = "DC.Format"
      content = "text/xml">
&lt;meta name    = "DC.Format"
      scheme  = "IMT"
      content = "text/xml">

&lt;meta name    = "DC.Format"
      scheme  = "IMT"
      content = "image/jpeg">
&lt;meta name    = "DC.Format"
      content = "A text file with mono-spaced tables and diagrams.">

&lt;meta name    = "DC.Format"
      content = "video/mpeg; 14 minutes">

&lt;meta name    = "DC.Format"
      content = "unix tar archive, gzip compressed; 1.5 Mbytes">

&lt;meta name    = "DC.Format"
      content = "watercolor; 23 cm x 31 cm">
</artwork></figure>

<figure><preamble>
   Identifier (of the resource)
</preamble><artwork>
&lt;meta name    = "DC.Identifier"
      content = "http://foo.bar.org/zaf/">

&lt;meta name    = "DC.Identifier"
      content = "urn:ietf:rfc:1766">

&lt;meta name    = "DC.Identifier"
      scheme  = "ISBN"
      content = "1-56592-149-6">

&lt;meta name    = "DC.Identifier"
      scheme  = "LCCN"
      content = "67-26020">

&lt;meta name    = "DC.Identifier"
      scheme  = "DOI"
      content = "10.12345/33-824688ab">
</artwork></figure>

<figure><preamble>
   Source (reference to the resource's origin)
</preamble><artwork>
&lt;meta name    = "DC.Source"
      content = "Shakespeare's Romeo and Juliet">

&lt;meta name    = "DC.Source"
      content = "http://a.b.org/manon/">
</artwork></figure>

<figure><preamble>
   Language (of the content of the resource; <xref target="RFC1766"/> recommended)
</preamble><artwork>
&lt;meta name    = "DC.Language"
      content = "en">
&lt;meta name    = "DC.Language"
      scheme  = "rfc1766"
      content = "en">
&lt;meta name    = "DC.Language"
      scheme  = "ISO639-2"
      content = "eng">
&lt;meta name    = "DC.Language"
      scheme  = "rfc1766"
      content = "en-US">

&lt;meta name    = "DC.Language"
      content = "zh">
&lt;meta name    = "DC.Language"
      content = "ja">
&lt;meta name    = "DC.Language"
      content = "es">
&lt;meta name    = "DC.Language"
      content = "de">

&lt;meta name    = "DC.Language"
      content = "german">
&lt;meta name    = "DC.Language"
      lang    = "fr"
      content = "allemand">
</artwork></figure>

<figure><preamble>
   Relation (reference to a related resource)
</preamble><artwork>
&lt;meta name    = "DC.Relation.IsPartOf"
      content = "http://foo.bar.org/abc/proceedings/1998/">

&lt;meta name    = "DC.Relation.IsFormatOf"
      content = "http://foo.bar.org/cd145.sgml">

&lt;meta name    = "DC.Relation.IsVersionOf"
      content = "http://foo.bar.org/draft9.4.4.2">

&lt;meta name    = "DC.Relation.References"
      content = "urn:isbn:1-56592-149-6">

&lt;meta name    = "DC.Relation.IsBasedOn"
      content = "Shakespeare's Romeo and Juliet">

&lt;meta name    = "DC.Relation.Requires"
      content = "LWP::UserAgent; HTML::Parse; URI::URL;
                 Net::DNS; Tk::Pixmap; Tk::Bitmap; Tk::Photo">
</artwork></figure>

<figure><preamble>
   Coverage (extent or scope of the content)
</preamble><artwork>
&lt;meta name    = "DC.Coverage"
      content = "US civil war era; 1861-1865">

&lt;meta name    = "DC.Coverage"
      content = "Columbus, Ohio, USA; Lat: 39 57 N Long: 082 59 W">

&lt;meta name    = "DC.Coverage"
      scheme  = "TGN"
      content = "Columbus (C,V)">

&lt;meta name    = "DC.Coverage.Jurisdiction"
      content = "Commonwealth of Australia">
</artwork></figure>

<figure><preamble>
   Rights (text or identifier of a rights management statement)
</preamble><artwork>
&lt;meta name    = "DC.Rights"
      lang    = "en"
      content = "Copyright Acme 1999 - All rights reserved.">

&lt;meta name    = "DC.Rights"
      content = "http://foo.bar.org/cgi-bin/terms">
</artwork></figure>
</section>

<section title="Security Considerations">
<t>
   The syntax rules for encoding Dublin Core metadata in HTML that are
   documented here pose no direct risk to computers and networks.
   People can use these rules to encode metadata that is inaccurate or
   even deliberately misleading (creating mischief in the form of "index
   spam"), however, this reflects a general pattern of HTML META tag
   abuse that is not limited to the encoding of metadata from the Dublin
   Core set.  Even traditional metadata encoding schemes (e.g., <xref target="MARC"/>)
   are not immune to inaccuracy, although they are generally followed in
   environments where production quality greatly exceeds that of the
   average Web site.
</t>
<t>
   Systems that process metadata encoded with META tags need to consider
   issues related to its accuracy and validity as part of their design
   and implementation, and users of such systems need to consider the
   design and implementation assumptions.  Various approaches may be
   relevant for certain applications, such as adding statements of
   metadata provenance, signing of metadata with digital signatures, and
   automating certain aspects of metadata creation; but these are far
   outside the scope of this document and the underlying META tag syntax
   that it describes.
</t>
</section>

<section title="Perl Scripts that Manipulate HTML Encoded Metadata">
<t>
   This section contains two simple programs that work with versions 4
   and 5 of the Perl <xref target="PERL"/> scripting language interpreter.  They may be
   taken and freely adapted for local organizational needs, research
   proposals, venture capital bids, etc.  A variety of applications are
   within easy reach of implementors that choose to build on these
   scripts.
</t>
<section title="Metadata Format Conversion">
<t>
   Here is a simple Perl script that correctly recognizes every example
   of metadata encoding in this document.  It shows how a modest
   scripting effort can produce a utility that converts metadata from
   one format to another.  Minor changes are sufficient to support a
   number of output formats.
</t>
<figure><artwork>
#!/depot/bin/perl
#
# This simple perl script extracts metadata embedded in an HTML file
# and outputs it in an alternate format.  Issues warning about missing
# element name or value.
#
# Handles mixed case tags and attribute values, one per line or spanning
# several lines.  Also handles a quoted string spanning multiple lines.
# No error checking.  Does not tolerate more than one "&lt;meta" per line.

print "@(urc;\n";
while (&lt;>) {
        next if (! /&lt;meta/i);
        ($meta) = /(&lt;meta.*$)/i;
        if (! /&lt;meta.*>/i) {
                while (&lt;>) {
                        $meta .= $_;
                        last if (/>/);
                }
        }
        $name     =    $meta =~ /name\s*=\s*"([^"]*)"/i
                        ? $1 : "MISSING ELEMENT NAME";
        $content  = $meta =~ /content\s*=\s*"([^"]*)"/i
                        ? $1 : "MISSING ELEMENT VALUE";
        ($scheme) =  $meta =~ /scheme\s*=\s*"([^"]*)"/i;
        ($lang)   =    $meta =~ /lang\s*=\s*"([^"]*)"/i;

        if ($lang || $scheme) {
                $mod = " ($lang";
                if (! $scheme)
                        { $mod .= ")"; }
                elsif (! $lang)
                        { $mod .= "$scheme)" }
                else
                        { $mod .= ", $scheme)"; }
        }
        else
                { $mod = ""; }

        print "    @|$name$mod; $content\n";
}
print "@)urc;\n";
# ---- end of Perl script ----
</artwork></figure>
<t>
   When the conversion script is run on the metadata file example from
   the LINK tag section (section 4), it produces the following output.
</t>
<figure><artwork>
        @(urc;
            @|DC.Title; A Dirge
            @|DC.Creator; Shelley, Percy Bysshe
            @|DC.Type; poem
            @|DC.Date; 1820
            @|DC.Format; text/html
            @|DC.Language; en
        @)urc;
</artwork></figure>
</section>

<section title="Automated Metadata Creation">
<t>
   The creation and maintenance of high-quality metadata can be
   extremely expensive without automation to assist in processes such as
   supplying pre-set or computed defaults, validating syntax, verifying
   value ranges, spell checking, etc.  Considerable relief could be had
   from a script that reduced an individual provider's metadata burden
   to just the title of each document.  Below is such a script.  It lets
   the provider of an HTML document abbreviate an entire embedded
   resource description using a single HTML comment statement that looks
   like
</t>
<figure><artwork>
   &lt;!--metablock Little Red Riding Hood -->
</artwork></figure>
<t>
   Our script processes this statement specially as a kind of "metadata
   block" declaration with attached title.  The general form is
</t>
<figure><artwork>
   &lt;!--metablock TITLE_OF_DOCUMENT -->
</artwork></figure>
<t>
   This statement works much like a "Web server-side include" in that
   the script replaces it with a fully-specified block of metadata and
   triggers other replacements.  Once installed, the script can output
   HTML files suitable for integration into one's production Web server
   procedures.
</t>
<t>
   The individual provider keeps a separate "template" file of
   infrequently changing pre-set values for metadata elements.  If the
   provider's needs are simple enough, the only element values besides
   the title that differ from one document to the next may be generated
   automatically.  Using the script, values may be referenced as
   variables from within the template or within the document.  Our
   variable references have the form "(--mbVARNAME)", and here is what
   they look like inside a template:
</t>
<figure><artwork>
   &lt;title> (--mbtitle) &lt;/title>
   &lt;meta name    = "DC.Creator"
         content = "Simpson, Homer">
   &lt;meta name    = "DC.Title"
         content = "(--mbtitle)">
   &lt;meta name    = "DC.Date.Created"
         content = "(--mbfilemodtime)">
   &lt;meta name    = "DC.Identifier"
         content = "(--mbbaseURL)/(--mbfilename)">
   &lt;meta name    = "DC.Format"
         content = "text/html; (--mbfilesize)">
   &lt;meta name    = "DC.Language"
         content = "(--mblanguage)-BUREAUCRATESE">
   &lt;meta name    = "RC.MetadataAuthority"
         content = "Springfield Nuclear">
   &lt;link rel     = "schema.DC"
         href    = "http://purl.org/DC/elements/1.0/">
   &lt;link rel     = "schema.RC"
         href    = "http://nukes.org/ReactorCore/rc">
</artwork></figure>
<t>
   The above template represents the metadata block that will describe
   the document once the variable references are replaced with real
   values.  By the conventions of our script, the following variables
   will be replaced in both the template and in the document:
</t>
<figure><artwork>
   (--mbfilesize)            size of the final output file
   (--mbtitle)               title of the document
   (--mblanguage)            language of the document
   (--mbbaseURL)             beginning part of document identifier
   (--mbfilename)            last part (minus .html) of identifier
   (--mbfilemodtime)         last modification date of the document
</artwork></figure>
<t>
   Here's an example HTML file to run the script on.
</t>
<figure><artwork>
   &lt;html>
   &lt;head>
   &lt;!--metablock Nutritional Allocation Increase -->
   &lt;meta name    = "DC.Type"
         content = "Memorandum">
   &lt;/head>
   &lt;body>
   &lt;p>
   From:  Acting Shift Supervisor
   To:    Plant Control Personnel
   RE:    (--mbtitle)
   Date:  (--mbfilemodtime)
   &lt;p>
   Pursuant to directive DOH:10.2001/405aec of article B-2022,
   subsection 48.2.4.4.1c regarding staff morale and employee
   productivity standards, the current allocation of doughnut
   acquisition funds shall be increased effective immediately.
   &lt;/body>
   &lt;/html>
</artwork></figure>
<t>
   Note that because replacement occurs throughout the document, the
   provider need only enter the title once instead of twice (normally
   the title must be entered once in the HTML head and again in the HTML
   body).  After running the script, the above file is transformed into
   this:
</t>
<figure><artwork>
   &lt;html>
   &lt;head>
       &lt;title> Nutritional Allocation Increase &lt;/title>
   &lt;meta name    = "DC.Creator"
         content = "Simpson, Homer">
   &lt;meta name    = "DC.Title"
         content = "Nutritional Allocation Increase">
   &lt;meta name    = "DC.Date.Created"
         content = "1999-03-08">
   &lt;meta name    = "DC.Identifier"
         content = "http://moes.bar.com/doh/homer.html">
   &lt;meta name    = "DC.Format"
         content = "text/html;    1320  bytes">
   &lt;meta name    = "DC.Language"
         content = "en-BUREAUCRATESE">
   &lt;meta name    = "RC.MetadataAuthority"
         content = "Springfield Nuclear">
   &lt;link rel     = "schema.DC"
         href    = "http://purl.org/DC/elements/1.0/">
   &lt;link rel     = "schema.RC"
         href    = "http://nukes.org/ReactorCore/rc">
   &lt;meta name    = "DC.Type"
         content = "Memorandum">
   &lt;/head>
   &lt;body>
   &lt;p>
   From:  Acting Shift Supervisor
   To:    Plant Control Personnel
   RE:    Nutritional Allocation Increase
   Date:  1999-03-08
   &lt;p>
   Pursuant to directive DOH:10.2001/405aec of article B-2022,
   subsection 48.2.4.4.1c regarding staff morale and employee
   productivity standards, the current allocation of doughnut
   acquisition funds shall be increased effective immediately.
   &lt;/body>
   &lt;/html>
</artwork></figure>
<t>
   Here is the script that accomplishes this transformation.
</t>
<figure><artwork>
#!/depot/bin/perl
#
# This Perl script processes metadata block declarations of the form
# &lt;!--metablock TITLE_OF_DOCUMENT --> and variable references of the
# form (--mbVARNAME), replacing them with full metadata blocks and
# variable values, respectively.  Requires a "template" file.
# Outputs an HTML file.
#
# Invoke this script with a single filename argument, "foo".  It creates
# an output file "foo.html" using a temporary working file "foo.work".
# The size of foo.work is measured after variable replacement, and is
# later inserted into the file in such a way that the file's size does
# not change in the process.  Has little or no error checking.

$infile = shift;
open(IN, "&lt; $infile")
        or die("Could not open input file \"$infile\"");
$workfile = "$infile.work";
unlink($workfile);
open(WORK, "+> $workfile")
        or die("Could not open work file \"$workfile\"");

@offsets = ();          # records locations for late size replacement
$title = "";            # gets the title during metablock processing
$language = "en";       # pre-set language here (not in the template)
$baseURL = "http://moes.bar.com/doh";   # pre-set base URL here also
$filename = "$infile.html";             # final output filename
$filesize = "(--mbfilesize)";           # replaced late (separate pass)
($year, $month, $day) = (localtime( (stat IN) [9] ))[5, 4, 3];
$filemodtime = sprintf "%s-%02s-%02s", 1900 + $year, 1 + $month, $day;

sub putout {            # outputs current line with variable replacement
        if (! /\(--mb/) {
                print WORK;
                return;
        }
        if (/\(--mbfilesize\)/)                 # remember where it was
                { push @offsets, tell WORK; }   # but don't replace yet
        s/\(--mbtitle\)/$title/g;
        s/\(--mblanguage\)/$language/g;
        s/\(--mbbaseURL\)/$baseURL/g;
        s/\(--mbfilename\)/$filename/g;
        s/\(--mbfilemodtime\)/$filemodtime/g;
        print WORK;
}

while (&lt;IN>) {                          # main loop for input file
        if (! /(.*)&lt;!--metablock\s*(.*)/) {
                &amp;putout;
                next;
        }
        $title = $2;
        $_ = $1;
        &amp;putout;
        if ($title =~ s/\s*-->(.*)//) {
                $remainder = $1;
        }
        else {
                while (&lt;IN>) {
                        $title .= $_;
                        last if (/(.*)\s*-->(.*)/);
                }
                $title .= $1;
                $remainder = $2;
        }
        open(TPLATE, "&lt; template")
                or die("Could not open template file");
        while (&lt;TPLATE>)                # subloop for template file
                { &amp;putout; }
        close(TPLATE);
        $_ = $remainder;
        &amp;putout;
}
close(IN);

# Now replace filesize variables without altering total byte count.
select( (select(WORK), $| = 1) [0] );   # first flush output so we
if (($size = -s WORK) &lt; 100000)         # can get final file size
        { $scale = 0; }                 # and set scale factor or
else {                  # compute it, keeping width of size field low
        for ($scale = 0; $size >= 1000; $scale++)
                { $size /= 1024; }
}
$filesize = sprintf "%7.7s %sbytes",
        $size, (" ", "K", "M", "G", "T", "P") [$scale];

foreach $pos (@offsets) {       # loop through saved size locations
        seek WORK, $pos, 0;             # read the line found there
        $_ = &lt;WORK>;
        # $filesize must be exactly as wide as "(--mbfilesize)"
        s/\(--mbfilesize\)/$filesize/g;
        seek WORK, $pos, 0;             # rewrite it with replacement
        print WORK;
}

close(WORK);
rename($workfile, "$filename")
        or die("Could not rename \"$workfile\" to \"$filename\"");
# ---- end of Perl script ----
</artwork></figure>
</section>
</section>

</middle>
<back>
<references>

<reference anchor="AAT" target="http://shiva.pub.getty.edu/aat_browser/">
<front>
  <title>Art and Architecture Thesaurus</title>
  <author>
    <organization>Getty Information Institute</organization>
  </author>
  <date/>
</front>
</reference>


<reference anchor="AC" target="http://metadata.net/ac/draft-iannella-admin-01.txt">
<front>
  <title>The A-Core: Metadata about Content Metadata</title>
  <author>
    <organization/>
  </author>
  <date/>
</front>
<annotation>(in progress)</annotation>
</reference>

<reference anchor='DC1'>
<front>
<title abbrev='DC Metadata for Resource Discovery'>
Dublin Core Metadata for Resource Discovery</title>
<author initials='S.L.' surname='Weibel' fullname='Stuart L. Weibel'>
<organization>OCLC Online Computer Library Center, Inc., Office of Research</organization>
<address>
<postal>
<street>6565 Frantz Rd.</street>
<city>Dublin</city>
<region>OH</region>
<code>43017</code>
<country>USA</country></postal>
<phone>+1 614 764 6081</phone>
<facsimile>+1 614 764 2344</facsimile>
<email>weibel@oclc.org</email></address></author>
<author initials='J.A.' surname='Kunze' fullname='John A. Kunze'>
<organization>University of California, San Francisco, Center for Knowledge Management</organization>
<address>
<postal>
<street>530 Parnassus Ave, Box 0840</street>
<city>San Francisco</city>
<region>CA</region>
<code>94143-0840</code>
<country>USA</country></postal>
<phone>+1 510 525 8575</phone>
<facsimile>+1 415 476 4653</facsimile>
<email>jak@ckm.ucsf.edu</email></address></author>
<author initials='C.' surname='Lagoze' fullname='Carl Lagoze'>
<organization>Cornell University, University Library and Department of Computer Science</organization>
<address>
<postal>
<street />
<city>Ithaca</city>
<region>NY</region>
<code>14853</code>
<country>USA</country></postal>
<phone>+1 607 255 6046</phone>
<facsimile>+1 607 255 4428</facsimile>
<email>lagoze@cs.cornell.edu</email></address></author>
<author initials='M.' surname='Wolf' fullname='Misha Wolf'>
<organization>Reuters Limited</organization>
<address>
<postal>
<street>85 Fleet Street</street>
<city>London</city>
<code>EC4P 4AJ</code>
<country>UK</country></postal>
<phone>+44 171 542 6722</phone>
<facsimile>+44 171 542 8314</facsimile>
<email>misha.wolf@reuters.com</email></address></author>
<date month='September' year='1998' />
<area>Applications</area>
<keyword>discovery</keyword>
<keyword>Dublin Core</keyword>
<keyword>metadata</keyword></front>
<seriesInfo name='RFC' value='2413' />
</reference>

<reference anchor="DCHOME" target="http://purl.org/DC/">
<front>
  <title>Dublin Core Initiative Home Page</title>
  <author>
    <organization/>
  </author>
  <date/>
</front>
</reference>

<reference anchor="DCPROJECTS" target="http://purl.org/DC/projects/">
<front>
  <title>Projects Using Dublin Core Metadata</title>
  <author>
    <organization/>
  </author>
  <date/>
</front>
</reference>

<reference anchor="DCT1" target="http://www.loc.gov/marc/typelist.html">
<front>
  <title>Dublin Core Type List 1</title>
  <author>
    <organization>DC Type Working Group</organization>
  </author>
  <date year="1999" month="March"/>
</front>
</reference>

<reference anchor="freeWAIS-sf2.0" target="http://ls6-www.cs.uni-dortmund.de/ir/projects/freeWAIS-sf/">
<front>
  <title>The enhanced freeWAIS distribution</title>
  <author>
    <organization/>
  </author>
  <date year="1999" month="February"/>
</front>
</reference>

<reference anchor="GLIMPSE" target="http://glimpse.cs.arizona.edu/">
<front>
  <title>Glimpse Home Page</title>
  <author>
    <organization/>
  </author>
  <date/>
</front>
</reference>

<reference anchor="HARVEST" target="http://www.tardis.ed.ac.uk/harvest/">
<front>
  <title>Harvest Web Indexing</title>
  <author>
    <organization/>
  </author>
  <date/>
</front>
</reference>


<reference anchor='HTML4.0' target="http://www.w3.org/TR/1998/REC-html40-19980424/">
<front>
<title>HTML 4.0 Specification</title>
<author initials='D.' surname='Raggett' fullname='David Raggett'>
  <organization />
</author>
<date month='April' day='24' year='1998' />
</front>
<seriesInfo name='W3C REC' value='REC-html40-19980424' />
</reference>


<reference anchor="ISEARCH" target="http://www.etymon.com/Isearch/">
<front>
  <title>Isearch Resources Page</title>
  <author>
    <organization/>
  </author>
  <date/>
</front>
</reference>

<reference anchor="ISO639-2" target="http://www.indigo.ie/egt/standards/iso639/iso639-2-en.html">
<front>
<title abbrev="ISO 639">Code for the representation of names
                   of languages.</title>
<author>
<organization>International Organization for Standardization</organization>
<address><uri>http://www.iso.ch</uri></address>
</author>
<date year="1996" month="???"/>
</front>
</reference>

<reference anchor="ISO8601" target="http://www.iso.ch/markete/8601.pdf">
<front>
<title abbrev="ISO 8601">ISO 8601, Data elements and interchange formats -- Information
interchange -- Representation of dates and times</title>
<author>
<organization>International Organization for Standardization</organization>
<address><uri>http://www.iso.ch</uri></address>
</author>
<date month="June" year="1988"/>
</front>
</reference>

<reference anchor="MARC" target="http://lcweb.loc.gov/marc/marc.html">
  <front>
    <title>USMARC Format for Bibliographic Data</title>
    <author><organization>US Library of Congress</organization></author>
    <date/>
  </front>
</reference>              

<reference anchor='PERL' target="urn:isbn:1565921496">
<front>
<title>Programming Perl, Second Edition</title>
<author initials='L.' surname='Wall' fullname='L. Wall'>
    <organization />
</author>
<author initials='T.' surname='Christiansen' fullname='T. Christiansen'>
    <organization />
</author>
<author initials='R.' surname='Schwartz' fullname='R. Schwartz'>
    <organization />
</author>
<date year='1996' />
</front>
<seriesInfo name="O'Reilly" value=""/> 
</reference>

<reference anchor='RDF' target="http://www.w3.org/TR/1999/REC-rdf-syntax-19990222">
<front>
<title>Resource Description Framework (RDF) Model and Syntax Specification</title>
<author initials='O.' surname='Lassila' fullname='Ora Lassila'>
    <organization />
</author>
<author initials='R.' surname='Swick' fullname='Ralph R. Swick'>
    <organization />
</author>
<date month='February' day='22' year='1999' />
</front>
<seriesInfo name="W3C REC" value="REC-rdf-syntax-19990222" /> 
</reference>


<reference anchor='RFC1766'>
<front>
<title>Tags for the Identification of Languages</title>
<author initials='H.T.' surname='Alvestrand' fullname='Harald Tveit Alvestrand'>
<organization></organization></author>
<date month='March' year='1995'></date></front>
<seriesInfo name='RFC' value='1766' />
</reference>

<reference anchor="SWISH-E" target="http://sunsite.Berkeley.EDU/SWISH-E/">
<front>
  <title>Simple Web Indexing System for Humans - Enhanced</title>
  <author>
    <organization/>
  </author>
  <date/>
</front>
</reference>

<reference anchor="TGN" target="http://shiva.pub.getty.edu/tgn_browser/">
<front>
  <title>Thesaurus of Geographic Names</title>
  <author>
    <organization>Getty Information Institute</organization>
  </author>
  <date/>
</front>
</reference>

<reference anchor="WTN8601" target="http://www.w3.org/TR/1998/NOTE-datetime-19980827">
<front>
<title>Date and Time Formats</title>
<author initials="M." surname="Wolf" fullname="Misha Wolf">
    <organization />
</author>
<author initials="C." surname="Wicksteed" fullname="Charles Wicksteed">
    <organization />
</author>
<date month="August" day="27" year="1998" />
</front>
<seriesInfo name="W3C NOTE" value="NOTE-datetime-19980827" />
</reference>

<reference anchor="XML" target="http://www.w3.org/TR/1998/REC-xml-19980210">
<front>
<title>Extensible Markup Language (XML) 1.0</title>
<author>
<organization abbrev="W3C">World Wide Web Consortium</organization>
<address>
<postal>
<street>MIT Laboratory for Computer Science</street>
<street>545 Technology Square</street>
<city>Cambridge</city> <region>MA</region> <code>02139</code>
<country>US</country>
</postal>
<phone>+ 1 617 253 2613</phone>
<facsimile>+ 1 617 258 5999</facsimile>
<uri>http://www.w3c.org</uri>
</address>
</author>
<author initials="T." surname="Bray">
	<organization /><address><email>tbray@textuality.com</email></address>
</author>
<author initials="J." surname="Paoli">
	<organization /><address><email>jeanpa@microsoft.com</email></address>
</author>
<author initials="C.M." surname="Sperberg-McQueen">
	<organization /><address><email>cmsmcq@uic.edu</email></address>
</author>
<date month="February" year="1998" />
</front>
<seriesInfo name="W3C" value="XML" />
</reference>
</references>
</back>
</rfc>

