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
<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.
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:
Plain text |
XML Encoding |
& |
& |
< |
< |
> |
> |
' (apostrophe / single quote) |
' |
" (double quote) |
" |
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.
3. Examples
Example 1 |
<?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://www.ilrt.bristol.ac.uk/people/cmdjb/">
<dc:title>Dave Beckett's Home Page</dc:title>
<dc:creator>Dave Beckett</dc:creator>
<dc:publisher>ILRT, University of Bristol</dc:publisher>
<dc:date>2000-06-06</dc:date>
</rdf:Description>
</rdf:RDF>
|
Example 2 |
<?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>
|
(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 <LINK> 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.
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://purl.org/dc/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 <dave.beckett@bristol.ac.uk>
Eric Miller <emiller@oclc.org>
Dan Brickley <daniel.brickley@bristol.ac.uk>
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)
References
[DCES] Dublin Core Metadata Element
Set, Version 1.1: Reference Description
http://purl.org/DC/documents/rec-dces-19990702.htm
[XML-SPEC] Extensible Markup
Language (XML) 1.0, W3C Recommendation, 10 February 1998
http://www.w3.org/TR/REC-xml
[DCRDF] Guidance on expressing
the Dublin Core within the Resource Description Framework
(RDF)
http://www.ukoln.ac.uk/metadata/resources/dc/datamodel/WD-dc-rdf/
[EM-DTD] DTD's for the Dublin
Core Element Set, Eric Miller
http://rdf.dev.oclc.org/dc/xml/dtd.html
[BATHP] Bath
Profile Appendix D - eXtensible Markup Language (XML)
Document Type Definition for Dublin Core Simple
http://www.ukoln.ac.uk/interop-focus/activities/z3950/int_profile/bath/draft/Appendix_D__XML_DTD.htm
[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
[RDFMS] Resource Description Framework
(RDF) Model and Syntax Specification, W3C Recommendation,
22 February 1999 http://www.w3.org/TR/REC-rdf-syntax
|