Creating and Using Metadata

Embedding RDF in your pages

Creative Commons no longer recommends including RDF inside of an HTML comment. If you wish to provide RDF metadata, Creative Commons recommends using RDFa or linking to an external file.

Displaying licence metadata

This code fragment will place a Creative Commons logo on your pages, and link to the Creative Commons site:

<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/">
<img alt="Creative Commons License" style="border-width: 0" src="creativecommons.png"/></a>
<br/>This work is licensed under a 
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/">
Creative Commons Attribution-NonCommercial-ShareAlike 2.0 Licence</a>.

Note that including rel="license" marks the link as the license for crawlers and other software.

Don’t forget to change the href target to the licence that you have chosen, and pick the appropriate licence image from the Creative Commons website

RDFa

RDFa is a W3 Proposed Recommendation for including machine readable metadata in [X]HTML. A primer is available. Including the license statement as described above (including rel="license") is enough RDFa to mark your work as licensed. You can include additional information such as subject tags, language, education level and attribution requirements as well. While the exact format will vary depending on your site’s templates, the following is an example of how the course History as commemoration might be marked up:

<html xmlns:dc="http://purl.org/dc/terms/"
      xmlns:cc="http://creativecommons.org/ns#">
<body>

<h1 property="dc:title">History as commemoration</h1>
<h2 property="dc:creator dc:contributor">The Open University</h2>

<p property="dc:description">
Commemoration - remembering and marking your past - makes an 
important contribution to our sense of community. Written texts, 
memorials, letters and photographs can all serve to commemorate 
events, people and values we wise to remember from our past.
</p>

<p>Available languages: <span property="dc:language" content="en-gb">
English (Great Britain)</span></p>
<p>Subjects: <span property="dc:subject">Arts and History</span></p>
<p>Licensed under a 
   <a href="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/" rel="license">
     Creative Commons Attribution - NonCommercial-ShareAlike 2.0 Licence</a>. 
   Original copyright <a href="http://www.open.ac.uk/" rel="dc:publisher">The Open University</a>.
   Attribute use to <a href="http://www.open.ac.uk/" rel="cc:attributionURL" 
property="cc:attributionName">The Open University</a>.</p>
</body>

</html>

RDF in an external file

To link a page to an external RDF file, put the following tag in the <head> section of your page:

<link rel="alternate" type="application/rdf+xml" href="Your RDF url here"/>

Then your RDF file should open like this:

<rdf:RDF xmlns="http://creativecommons.org/ns#" 
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <Work rdf:about="">

and end like this:

    </Work>
</rdf:RDF>

In the middle you should put tags using the Dublin Core extension which suit your content. Further information about these tags can be found on the RSS feeds page.

An example from OpenLearn:

<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <Work rdf:about="">
      <dc:contributor>The Open University</dc:contributor>
      <dc:creator>The Open University</dc:creator>
      <dc:date>2008-01-23T09:09:21Z</dc:date>
      <dc:description>Commemoration - remembering and marking your past - makes an important 
contribution to our sense of community. Written texts, memorials, letters and photographs can all 
serve to commemorate events, people and values we wise to remember from our past.</dc:description>
      <dc:format>text/html</dc:format>

      <dc:language>en-gb</dc:language>
      <dc:publisher>The Open University</dc:publisher>
      <dc:rights>Licensed under a Creative Commons Attribution - NonCommercial-ShareAlike 2.0 
Licence - see http://creativecommons.org/licenses/by-nc-sa/2.0/uk/ - Original copyright The Open 
University</dc:rights>
      <dc:subject>Arts and History</dc:subject>
      <dc:title>History as commemoration</dc:title>
      <dc:type>Course</dc:type>

    </Work>
</rdf:RDF>

This portion of the OCW Toolkit is currently under development.  If you are interested in joining the development team, please email us at feedback@ocwconsortium.org.