The Dublin Core™ Element Set V1.1 (DCES)
can be represented in many syntax formats. This document
explains how to encode the DCES in XML, provides a DTD to
validate the documents and describes a method to link them
from web pages.
1. Introduction
The Dublin Core™ Element Set V1.1 (DCES) [DCES] can be represented in many syntax formats. This document explains how to encode the DCES in XML[XML-SPEC], provides a DTD to validate the documents and describes a method to link them from web pages.
This document describes encoding the DCES in XML subject to these restrictions:
The Dublin Core™ elements described in the DCES V1.1 reference can be used
No other elements can be used
No element qualifiers can be used
The resulting XML cannot be embedded in web pages
This document is based on previous work done in [DCRDF], [EM-DTD], [BATHP], [CIMI-XML-TB] and [CIMI-DC-DTD].
2. Writing Dublin Core™ in XML
This section describes step by step how to create a document for the DCES in XML.
2.1. XML version declaration
Any well-formed XML document will include a statement of the version of XML used. At present, the only valid version of XML, as defined in the W3C Recommendation, is 1.0. Documents should therefore include the statement
<?xml version="1.0"?>
on their first line.
2.2. Referencing the XML DTD
<!DOCTYPE rdf:RDF SYSTEM "http://purl.org/dc/schemas/dcmes-xml-20000714.dtd">
2.3. Declaring the use of RDF
It is necessary to declare that RDF[RDFMS] is being used, as this makes it easier for programs to interpret the meaning of the document. This is done by including
as the next line in the document, following the XML DTD reference.
2.4. Describing the resources
For each resource described by Dublin Core™ elements, they must be enclosed in a container element - a pair of rdf:Description tags - with one container for each resource. Resources must be identified by URIs and one URI must be inserted in the about attribute of the rdf:Description element like this:
(see below for what to do about other _Identifier_ elements)
Inside the rdf:Description container, put each of the Dublin Core™ elements with the dc: namespace prefix before them, so for example the Title element becomes dc:title (all lowercase) and used inside the rdf:Description container like this:
<rdf:Description about="http://..../">
<dc:title>My Home Page</dc:title>
</rdf:Description>
This can be repeated for all other DCES elements that are needed with the standard Dublin Core™ guidelines - all elements are repeatable and optional. Note that the order of the elements is not guaranteed to be preserved.
There must be at least one Identifier element for the resource containing a URI and this must be made the value of the about attribute of the rdf:description element as described above. The values of other Identifier elements should be contained in the same manner as the other elements.
2.5. Language and character encoding
XML provides an xml:lang attribute that can be used on any element. This provides a way to describe the language used for the content of the element. The DCES provides a Language element which is used to describe the language of the resource.
The value of the elements needs to be encoded using the rules of XML when there are special characters in the value. The special characters that need to be encoded are summarised here for reference:
All other characters with a value higher than 127 should not be encoded with the HTML entities such as é since these are not defined in XML. Numerical values either as &#nnn; or hexadecimal as &xxx; should be used, or Unicode in the UTF-8 encoding.
(The above examples were machine generated from the actual XML source file so should be correct)
4. Linking to Dublin Core™ metadata in XML from HTML
Dublin Core™ encoded in the method described here can be refered to from an HTML document and associated with it by means of the HTML element. The recommended relation type for this purpose is REL="meta", used like this:
<LINK REL="meta" HREF="mydoc.dcxml">
where mydoc.dcxml is the URI of the XML document being refered to.
5. Validating the XML with the DTD
The DTD and example documents have to be validated with an XML parser that can handle URIs for the DTDs. Unfortunately, this isn't very widely supported at present. One online validator that seems to handle this is the service at http://www.stg.brown.edu/service/xmlvalid/
All validating XML parsers support using local files for DTDs in the SYSTEM parameter. This can be used to validate with the DTD by saving it from the URL given in section 2.2 to a local file and amending the DC/XML documents to have, for example: <!DOCTYPE rdf:RDF SYSTEM "dces.dtd">
at the start and then validating with the XML parser. However DO NOT publish documents with this local URL!
The examples in this document have been validated (using the trick described in the previous paragraph) with James Clarks' SP validating SGML parser V1.3.4 used with XML encoding and XML catalog (xml.soc) as described in his XML support page.
This document was written to provide an "official" DTD for encoding simple Dublin Core™ metadata in XML. Simple here means that there are no extra elements, qualifiers, optional or varying parts. This allows the resulting data to be validated by existing XML parsers. XML Schema may in future allow extra validation to be done on XML but at the time of writing is not standardised.
We realised that the should be other DTDs for encoding DC in XML (DC with qualifiers, DC in RDF/XML written all as attributes, ...) but this document is for the simplest possible version.
Our goal was also to make this simple XML format also be valid RDF since this allows even the simplest DC in XML document to be manipulated using the power of RDF. We have tried to limit the RDF "baggage" to the minimum for users, and it is mostly a standard header and footer to the documents which should be familiar to people from HTML.
Appendix A - DTD for Dublin Core™ Element Set 1.1 in XML
<!--
DRAFT XML DTD 20000619 for Dublin Core™ Element Set version 1.1
http://purl.org/dc/schemas/dcmes-xml-20000714.dtd
See
Using Dublin Core™ in XML
http://http://purl.org/dc/specifications/dublin-core/wd/dcmes-xml-20000714.htm
Authors:
Dave Beckett <[email protected]>
Eric Miller <[email protected]>
Dan Brickley <[email protected]>
Based on
Dublin Core™ Metadata Element Set, Version 1.1: Reference Description
http://purl.org/DC/documents/rec-dces-19990702.htm
-->
<!-- The namespaces for RDF and DCES 1.1 respectively -->
<!ENTITY rdfns 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' >
<!ENTITY dcns 'http://purl.org/dc/elements/1.1/' >
<!-- Magic - do not look behind the curtain -->
<!ENTITY % rdfnsdecl 'xmlns:rdf CDATA # fixed "&rdfns;"' >
<!ENTITY % dcnsdecl 'xmlns:dc CDATA # fixed "&dcns;"' >
<!-- The wrapper element -->
<!ELEMENT rdf:RDF (rdf:Description)* >
<!ATTLIST rdf:RDF %rdfnsdecl; %dcnsdecl; >
<!ENTITY % dces "dc:title | dc:creator | dc:subject | dc:description |
dc:publisher | dc:contributor | dc:date | dc:type | dc:format |
dc:identifier | dc:source | dc:language | dc:relation | dc:coverage |
dc:rights" >
<!-- The resource description container element -->
<!ELEMENT rdf:Description (%dces;)* >
<!ATTLIST rdf:Description about CDATA #REQUIRED>
<!-- The elements from DCES 1.1 -->
<!-- The name given to the resource. -->
<!ELEMENT dc:title (#PCDATA)>
<!-- An entity primarily responsible for making the content of the
resource. -->
<!ELEMENT dc:creator (#PCDATA)>
<!-- The topic of the content of the resource. -->
<!ELEMENT dc:subject (#PCDATA)>
<!-- An account of the content of the resource. -->
<!ELEMENT dc:description (#PCDATA)>
<!-- The entity responsible for making the resource available. -->
<!ELEMENT dc:publisher (#PCDATA)>
<!-- An entity responsible for making contributions to the content of
the resource. -->
<!ELEMENT dc:contributor (#PCDATA)>
<!-- A date associated with an event in the life cycle of the resource. -->
<!ELEMENT dc:date (#PCDATA)>
<!-- The nature or genre of the content of the resource. -->
<!ELEMENT dc:type (#PCDATA)>
<!-- The physical or digital manifestation of the resource. -->
<!ELEMENT dc:format (#PCDATA)>
<!-- An unambiguous reference to the resource within a given context. -->
<!ELEMENT dc:identifier (#PCDATA)>
<!-- A Reference to a resource from which the present resource is derived. -->
<!ELEMENT dc:source (#PCDATA)>
<!-- A language of the intellectual content of the resource. -->
<!ELEMENT dc:language (#PCDATA)>
<!-- A reference to a related resource. -->
<!ELEMENT dc:relation (#PCDATA)>
<!-- The extent or scope of the content of the resource. -->
<!ELEMENT dc:coverage (#PCDATA)>
<!-- Information about rights held in and over the resource. -->
<!ELEMENT dc:rights (#PCDATA)>
(The above DTD was machine generated from the actual DTD source file so should be correct)