Using Dublin Core in XML
Institute for Learning and Research Technology (ILRT)
University of Bristol
|Is Replaced By:||http://dublincore.org/documents/2000/11/dcmes-xml/|
|Status of document:||This is a DCMI Working Draft.|
|Description of document:||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.|
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:
This document is based on previous work done in [DCRDF], [EM-DTD], [BATHP], [CIMI-XML-TB] and [CIMI-DC-DTD].
This section describes step by step how to create a document for the DCES in XML.
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
on their first line.
<!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
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">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:
<rdf:Description about="http://..../"> ... </rdf:Description>(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.
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:
<?xml version="1.0"?> <!DOCTYPE rdf:RDF SYSTEM "http://purl.org/dc/schemas/dcmes-xml-20000714.dtd"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc ="http://purl.org/dc/elements/1.1/"> <rdf:Description about="http://purl.org/DC/index.htm"> <dc:title>Dublin Core Metadata Initiative - Home Page</dc:title> <dc:description>The Dublin Core Metadata Initiative Web site.</dc:description> <dc:date>1998-10-10</dc:date> <dc:format>text/html</dc:format> <dc:language>en</dc:language> <dc:contributor>The Dublin Core Metadata Initiative</dc:contributor> </rdf:Description> </rdf:RDF>
<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/](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](http://www.jclark.com/sp/index.htm) validating SGML parser V1.3.4 used with XML encoding and XML catalog (xml.soc) as described in his [XML support page](http://www.jclark.com/sp/xml.htm). The configuration used on unix was as follows:
unix% export SP_CHARSET_FIXED=yes unix% export SP_ENCODING=XML unix% export SGML_CATALOG_FILES=/usr/local/lib/sgml/xml.soc unix% nsgmls -wxml document.dcxml## 6. Rationale 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 The URL for this DTD is [http://dublincore.org/schemas/dcmes-xml-20000714.dtd](/schemas/dcmes-xml-20000714.dtd)
<!-- 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/documents/wd/dcmes-xml-20000714.htm Authors: Dave Beckett <firstname.lastname@example.org> Eric Miller <email@example.com> Dan Brickley <firstname.lastname@example.org> 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)
[DCRDF] Guidance on expressing the Dublin Core within the Resource Description Framework (RDF)
[BATHP] Bath Profile Appendix D - eXtensible Markup Language (XML) Document Type Definition for Dublin Core Simple
[CIMI-XML-TB] The use of XML as a transfer syntax for museum records during the CIMI Dublin Core test bed : some practical experiences, Bert Degenhart Drenth
MS Word (no non-proprietary format available): http://www.cimi.org/documents/XML_for_DC_testbed_rev.doc
[CIMI-DC-DTD] CIMI Dublin Core DTD
MS Word (no non-proprietary format available): http://www.cimi.org/documents/CIMI-DC-DTD_210400.doc