Expressing Simple Dublin Core™ in RDF/XML

Title:

Expressing Simple Dublin Core™ in RDF/XML

Creator: Dave Beckett
Institute for Learning and Research Technology (ILRT)
University of Bristol
Creator: Eric Miller
Creator: Dan Brickley
Date Issued: 2001-11-28
Identifier: http://dublincore.org/specifications/dublin-core/dcmes-xml/2001-11-28/
Replaces: http://dublincore.org/specifications/dublin-core/dcmes-xml/2001-09-20/
Is Replaced By: http://dublincore.org/specifications/dublin-core/dcmes-xml/2002-04-22/
Latest version: http://dublincore.org/specifications/dublin-core/dcmes-xml/
Status of document: This is a Dublin Core™ Metadata Initiative Proposed Recommendation.
Description of document: The Dublin Core™ Metadata Element Set V1.1 (DCMES) can be represented in many syntax formats. This document explains how to encode the DCMES in RDF/XML, provides a DTD to validate the documents and describes a method to link them from web pages.

1. Introduction and Goals

The Dublin Core™ Metadata Element Set V1.1 (DCMES) [DCMES] can be represented in many syntax formats. This document gives an encoding for the DCMES in XML[XML-SPEC] using simple RDF[RDFMS], provides a DTD and XML Schema[XMLSCHEMA] to validate the documents and describes a method to link them from web pages.

This document describes an encoding for the DCMES in XML subject to these restrictions:

  • The Dublin Core™ elements described in the DCMES V1.1 reference can be used
  • No other elements can be used
  • No element qualifiers can be used
  • The resulting RDF/XML cannot be embedded in web pages

The primary goal for this document is to provide a simple encoding, where there are no extra elements, qualifiers, optional or varying parts allowed. This allows the resulting data to be validated against a DTD and guaranteed usable by XML parsers. A secondary goal was to make the encoding also be valid RDF[RDFMS] which allows the document to be manipulated using the RDF model. We have tried to limit the RDF constructs to the minimum, and the result is a mostly standard header and footer for every document.

We acknowledge that there will be further documents describing other encodings for DC without these restrictions however this one is for the simplest possible form. One result of the restrictions is that the encoding does not create documents that can be embedded in HTML pages. Please refer to other Dublin Core™ documents that can describe how to do that.

This document is based on previous work such as [EM-DTD], [CIMI-XML-TB] and [CIMI-DC-DTD].

2. An Encoding of Dublin Core™ in XML

This section describes step by step, this method of how to create a document for the DCMES in XML.

2.1. XML declaration

Any well-formed XML document should include a statement of the version of XML used (and content encoding). At present, the only valid version of XML, as defined in the W3C Recommendation, is 1.0. It is therefore strongly recommended to include the statement

<?xml version="1.0"?>

on the first line.

2.2. Referencing the XML DTD

<!DOCTYPE rdf:RDF PUBLIC "-//DUBLIN CORE//DCMES DTD 2001 11 28//EN" "http://dublincore.org/specifications/dublin-core/dcmes-xml/2001-11-28/dcmes-xml-dtd.dtd">

2.3. Declaring the use of RDF

It is necessary to declare that RDF[RDFMS] is being used so that software can recognise this is an RDF/XML application. This declares the outer rdf:RDF containing tag with its XML namespace and the XML namespace for the DCMES elements.

<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

The format can describe multiple resources therefore for each one, they must be enclosed in a container element - a pair of rdf:Description tags. Resources may have no, one or several identifiers and some of these may be URIs. If a resource has at least one URI, the most appropriate one should be used as the value of the rdf:about attribute of the rdf:Description tag like this:

<rdf:Description rdf: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 rdf:about="http://..../">
  <dc:title>My Home Page</dc:title>
</rdf:Description>

This can be repeated for all other DCMES elements that are needed with the standard Dublin Core™ guidelines - all elements are repeatable and optional. Note that there is no requirement on applications consuming this document to preserve the order of elements in the container and therefore you should not expect this to be preserved.

If the value of the Dublin Core™ element is a resource which has a URI rather than plain text, it should be recorded in the value of the rdf:resource attribute on the tag, with empty tag content. For example, if the value of the source was a URI, it would be recorded like this:

<rdf:Description rdf:about="http://..../">
  <dc:source rdf:resource="http://.../"/>
</rdf:Description>

There may be more than one Identifier element for the resource containing URIs or other identifiers. If a URI identifier is available and appropriate to use, it should be made the value of the about attribute of the rdf:Description element as described above. The other Identifier element values should be encoded in the same manner as the other elements as described below. Here is a fragment of a description of a book which has a non-URI identifier:

<rdf:Description>
  <dc:title>Internet Ethics</dc:title>
  <dc:creator>Duncan Langford</dc:creator>
  <dc:format>Book</dc:format>
  <dc:identifier>ISBN 0333776267</dc:identifier>
</rdf:Description>

It may be that there is no identifier for the resource, in which case neither of the above methods should be used and both the about attribute and Identifier element left out. This is used something like this:

<rdf:Description>
  <dc:title>The Mona Lisa</dc:title>
  <dc:description>A painting by ...</dc:description>
</rdf:Description>

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 DCMES provides a Language element which is used to describe the language of the resource.

The values of the elements and attributes will need to be encoded using the rules of XML when there are special characters in the value. The special characters that need to be encoded, and when they need to be are summarised here for reference:

        <th>XML Encoding</th>

        <th>Required in</th>
      </tr>

      <tr>
        <td>&amp;</td>

        <td>&amp;amp;</td>

        <td>Element and attribute values</td>
      </tr>

      <tr>
        <td>&lt;</td>

        <td>&amp;lt;</td>

        <td>Element and attribute values</td>
      </tr>

      <tr>
        <td>&gt;</td>

        <td>&amp;gt;</td>

        <td>Element and attribute values</td>
      </tr>

      <tr>
        <td>' (apostrophe / single quote)</td>

        <td>&amp;apos;</td>

        <td>Attribute values</td>
      </tr>

      <tr>
        <td>" (double quote)</td>

        <td>&amp;quot;</td>

        <td>Attribute values</td>
      </tr>
    </tbody>
  </table>

</center>

Note that the ' and " only need to be used for those character inside attribute values, which are only needed for the rdf:resource attribute (see Section 2.4) and the xml:lang attribute (see Section 2.5).

All other characters outside the core US-ASCII range of 32-126 should not be encoded with the HTML entities such as é since these are not defined in XML. Numeric entities for the characters should be used which are written as &#ddd; in decimal or ઼ in hexadecimal. Alternatively they can be encoded as Unicode in one of the formats such as UTF-8 which is widely supported.

2.6. Finishing off the document

The final thing that needs to be done is to close the rdf:RDF element opened at the top of the document by adding the following line:

</rdf:RDF>

3. Examples (Non-Normative)

Plain text
      <tr>
        <td>
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF PUBLIC "-//DUBLIN CORE//DCMES DTD 2001 11 28//EN" "http://dublincore.org/specifications/dublin-core/dcmes-xml/2001-11-28/dcmes-xml-dtd.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 rdf: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>

        </td>
      </tr>
    </tbody>
  </table>

</center><center>
  <table summary="A table showing examples." align="center" bgcolor="#ffffff" border="1" cellpadding="10">
    <tbody>
      <tr>
        <td align="center"><a id="example2" name="example2"><strong>Example 2</strong></a></td>
      </tr>

      <tr>
        <td>
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF PUBLIC "-//DUBLIN CORE//DCMES DTD 2001 11 28//EN" "http://dublincore.org/specifications/dublin-core/dcmes-xml/2001-11-28/dcmes-xml-dtd.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 rdf:about="http://dublincore.org/">
   <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>
   <!-- guesses for the translation of the above titles -->
   <dc:title xml:lang="fr">L'Initiative de métadonnées du Dublin Core</dc:title>
   <dc:title xml:lang="de">der Dublin-Core Metadata-Diskussionen</dc:title>
 </rdf:Description>
</rdf:RDF>

        </td>
      </tr>
    </tbody>
  </table>

</center>

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.

Appendix A - DTD for Simple Dublin Core™ Metadata Element Set 1.1 in RDF/XML (Non-Normative)

This section is for information only and not part of the document.

The URI for this DTD is http://dublincore.org/specifications/dublin-core/dcmes-xml/2001-11-28/dcmes-xml-dtd.dtd

<!--

  XML DTD 2000-12-01 for Dublin Core™ Metadata Element Set version 1.1
  http://dublincore.org/specifications/dublin-core/2000/11/dcmes-xml/dcmes-xml-dtd.dtd

  See 
    An XML Encoding of Simple Dublin Core™ Metadata - 2000-12-01
    http://dublincore.org/specifications/dublin-core/2000/11/dcmes-xml/

  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://dublincore.org/specifications/dublin-core/rec/dces-19990702.shtml

-->

<!-- The namespaces for RDF and DCMES 1.1 respectively -->
<!ENTITY rdfns 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' >
<!ENTITY dcns 'http://purl.org/dc/elements/1.1/' >

<!-- Declare convenience entities for XML namespace declarations -->
<!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 % dcmes "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 (%dcmes;)* >

<!ATTLIST rdf:Description rdf:about CDATA #IMPLIED>

<!-- The elements from DCMES 1.1 -->

<!-- The name given to the resource. -->
<!ELEMENT dc:title (#PCDATA)>
<!ATTLIST dc:title xml:lang CDATA #IMPLIED>

<!-- An entity primarily responsible for making the content of the
resource. -->
<!ELEMENT dc:creator (#PCDATA)>
<!ATTLIST dc:creator xml:lang CDATA #IMPLIED>

<!-- The topic of the content of the resource. -->
<!ELEMENT dc:subject (#PCDATA)>
<!ATTLIST dc:subject xml:lang CDATA #IMPLIED>

<!-- An account of the content of the resource. -->
<!ELEMENT dc:description (#PCDATA)>
<!ATTLIST dc:description xml:lang CDATA #IMPLIED>

<!-- The entity responsible for making the resource available. -->
<!ELEMENT dc:publisher (#PCDATA)>
<!ATTLIST dc:publisher xml:lang CDATA #IMPLIED>

<!-- An entity responsible for making contributions to the content of
the resource. -->
<!ELEMENT dc:contributor (#PCDATA)>
<!ATTLIST dc:contributor xml:lang CDATA #IMPLIED>

<!-- A date associated with an event in the life cycle of the resource. -->
<!ELEMENT dc:date (#PCDATA)>
<!ATTLIST dc:date xml:lang CDATA #IMPLIED>

<!-- The nature or genre of the content of the resource. -->
<!ELEMENT dc:type (#PCDATA)>
<!ATTLIST dc:type xml:lang CDATA #IMPLIED>

<!-- The physical or digital manifestation of the resource. -->
<!ELEMENT dc:format (#PCDATA)>
<!ATTLIST dc:format xml:lang CDATA #IMPLIED>

<!-- An unambiguous reference to the resource within a given context. -->
<!ELEMENT dc:identifier (#PCDATA)>
<!ATTLIST dc:identifier xml:lang CDATA #IMPLIED>
<!ATTLIST dc:identifier rdf:resource CDATA #IMPLIED>

<!-- A Reference to a resource from which the present resource is derived. -->
<!ELEMENT dc:source (#PCDATA)>
<!ATTLIST dc:source xml:lang CDATA #IMPLIED>
<!ATTLIST dc:source rdf:resource CDATA #IMPLIED>

<!-- A language of the intellectual content of the resource. -->
<!ELEMENT dc:language (#PCDATA)>
<!ATTLIST dc:language xml:lang CDATA #IMPLIED>

<!-- A reference to a related resource. -->
<!ELEMENT dc:relation (#PCDATA)>
<!ATTLIST dc:relation xml:lang CDATA #IMPLIED>
<!ATTLIST dc:relation rdf:resource CDATA #IMPLIED>

<!-- The extent or scope of the content of the resource. -->
<!ELEMENT dc:coverage (#PCDATA)>
<!ATTLIST dc:coverage xml:lang CDATA #IMPLIED>

<!-- Information about rights held in and over the resource. -->
<!ELEMENT dc:rights (#PCDATA)>
<!ATTLIST dc:rights xml:lang CDATA #IMPLIED>

Appendix B - XML Schema for Simple Dublin Core™ Metadata Element Set 1.1 in RDF/XML (Non-Normative)

This section is for information only and not part of the document.

The URI for this XML Schema is http://dublincore.org/specifications/dublin-core/dcmes-xml/2001-11-28/dcmes-xml-xsd.xsd

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd">
<schema xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:t="http://dublincore.org/specifications/dublin-core/dcmes-xml/2001-11-28/"
        targetNamespace="http://dublincore.org/specifications/dublin-core/dcmes-xml/2001-11-28/">

  <annotation>
    <documentation xml:lang="en"
                   source="http://dublincore.org/specifications/dublin-core/dcmes-xml/2001-11-28/">

  XML Schema 2001-11-28 by Dave Beckett - http://purl.org/net/dajobe
  for
    Expressing Simple Dublin Core™ in RDF/XML - 2001-11-28
    http://dublincore.org/specifications/dublin-core/dcmes-xml/2001-11-28/

  Based on
    Dublin Core™ Metadata Element Set, Version 1.1: Reference Description
    http://dublincore.org/specifications/dublin-core/dces/1999-07-02/

    This XML Schema is for information only and NON-NORMATIVE.

    </documentation>
  </annotation>

   <import namespace="http://www.w3.org/XML/1998/namespace" 
           schemaLocation="http://www.w3.org/2001/xml.xsd">
     <annotation>
       <documentation xml:lang="en">
          Get access to the xml: attribute groups for xml:lang
          as declared on various elements below
       </documentation>
     </annotation>
   </import>

   <import namespace="http://www.w3.org/2000/10/XMLSchema" 
           schemaLocation="http://www.w3.org/2001/XMLSchema.xsd">
     <annotation>
       <documentation xml:lang="en">
          Get access to the XML Schema for 2001-05-02 W3C REC
       </documentation>
     </annotation>
   </import>

  <element name="rdf:RDF">
    <complexType>
      <sequence>
        <element ref="t:rdf"/>
      </sequence>     
      <attribute name="xmlns:rdf" type="string" use="required" fixed="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
      <attribute name="xmlns:dc" type="string" use="required" fixed="http://purl.org/dc/elements/1.1/"/>
    </complexType>
  </element>

  <element name="rdf:Description">
    <complexType>
      <sequence>
        <element ref="t:dc"/>
      </sequence>     
      <attribute name="rdf:about" type="string" use="optional"/>
    </complexType>
  </element>

  <complexType name="dc:title" mixed="true">
     <sequence minOccurs="0" maxOccurs="unbounded">
        <any processContents="lax"/>
     </sequence>
     <anyAttribute processContents="lax"/>
  </complexType>

  <element name="dc:title" type="dc:title"/>

  <complexType name="dc:creator" mixed="true">
     <sequence minOccurs="0" maxOccurs="unbounded">
        <any processContents="lax"/>
     </sequence>
     <anyAttribute processContents="lax"/>
  </complexType>

  <element name="dc:creator" type="dc:creator"/>

  <complexType name="dc:subject" mixed="true">
     <sequence minOccurs="0" maxOccurs="unbounded">
        <any processContents="lax"/>
     </sequence>
     <anyAttribute processContents="lax"/>
  </complexType>

  <element name="dc:subject" type="dc:subject"/>

  <complexType name="dc:description" mixed="true">
     <sequence minOccurs="0" maxOccurs="unbounded">
        <any processContents="lax"/>
     </sequence>
     <anyAttribute processContents="lax"/>
  </complexType>

  <element name="dc:description" type="dc:description"/>

  <complexType name="dc:publisher" mixed="true">
     <sequence minOccurs="0" maxOccurs="unbounded">
        <any processContents="lax"/>
     </sequence>
     <anyAttribute processContents="lax"/>
  </complexType>

  <element name="dc:publisher" type="dc:publisher"/>

  <complexType name="dc:contributor" mixed="true">
     <sequence minOccurs="0" maxOccurs="unbounded">
        <any processContents="lax"/>
     </sequence>
     <anyAttribute processContents="lax"/>
  </complexType>

  <element name="dc:contributor" type="dc:contributor"/>

  <complexType name="dc:date" mixed="true">
     <sequence minOccurs="0" maxOccurs="unbounded">
        <any processContents="lax"/>
     </sequence>
     <anyAttribute processContents="lax"/>
  </complexType>

  <element name="dc:date" type="dc:date"/>

  <complexType name="dc:type" mixed="true">
     <sequence minOccurs="0" maxOccurs="unbounded">
        <any processContents="lax"/>
     </sequence>
     <anyAttribute processContents="lax"/>
  </complexType>

  <element name="dc:type" type="dc:type"/>

  <complexType name="dc:format" mixed="true">
     <sequence minOccurs="0" maxOccurs="unbounded">
        <any processContents="lax"/>
     </sequence>
     <anyAttribute processContents="lax"/>
  </complexType>

  <element name="dc:format" type="dc:format"/>

  <complexType name="dc:identifier" mixed="true">
     <sequence minOccurs="0" maxOccurs="unbounded">
        <any processContents="lax"/>
     </sequence>
     <anyAttribute processContents="lax"/>
  </complexType>

  <element name="dc:identifier" type="dc:identifier"/>

  <complexType name="dc:source" mixed="true">
     <sequence minOccurs="0" maxOccurs="unbounded">
        <any processContents="lax"/>
     </sequence>
     <anyAttribute processContents="lax"/>
  </complexType>

  <element name="dc:source" type="dc:source"/>

  <complexType name="dc:language" mixed="true">
     <sequence minOccurs="0" maxOccurs="unbounded">
        <any processContents="lax"/>
     </sequence>
     <anyAttribute processContents="lax"/>
  </complexType>

  <element name="dc:language" type="dc:language"/>

  <complexType name="dc:relation" mixed="true">
     <sequence minOccurs="0" maxOccurs="unbounded">
        <any processContents="lax"/>
     </sequence>
     <anyAttribute processContents="lax"/>
  </complexType>

  <element name="dc:relation" type="dc:relation"/>

  <complexType name="dc:coverage" mixed="true">
     <sequence minOccurs="0" maxOccurs="unbounded">
        <any processContents="lax"/>
     </sequence>
     <anyAttribute processContents="lax"/>
  </complexType>

  <element name="dc:coverage" type="dc:coverage"/>

  <complexType name="dc:rights" mixed="true">
     <sequence minOccurs="0" maxOccurs="unbounded">
        <any processContents="lax"/>
     </sequence>
     <anyAttribute processContents="lax"/>
  </complexType>

  <element name="dc:rights" type="dc:rights"/>

</schema>

References

[DCMES] Dublin Core™ Metadata Element Set, Version 1.1: Reference Description
http://dublincore.org/specifications/dublin-core/dces/1999-07-02/

[XML-SPEC] Extensible Markup Language (XML) 1.0, W3C Recommendation, 10 February 1998
http://www.w3.org/TR/REC-xml

[EM-DTD] DTD's for the Dublin Core™ Element Set, Eric Miller
http://dublincore.org/specifications/dublin-core/dcmes-xml/2001-11-28/dcmes-xml-dtd.dtd

[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/wg/xml_spectrum/XML_for_DC_testbed_rev.doc

[CIMI-DC-DTD]CIMI Dublin Core™ DTD
MS Word (no non-proprietary format available): http://www.cimi.org/public_docs/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

[XMLSCHEMA] XML Schema, W3C Recommendation, 2 May 2001 http://www.w3.org/TR/xmlschema-1/

Example 1