W3C

XHTML and Metadata

note 24 October 2003

This version:
Editor:
Mark Birbeck, x-port.net Ltd. <Mark.Birbeck@x-port.net>

Abstract

The aim of this document is to discuss the relationship between XHTML and metadata.

Status of this Document

This is an internal working draft.

Last Modified: $Date: $

Table of Contents

1 Motivation
2 Types of Metadata in XHTML Documents
    2.1 Putting it all together
        2.1.1 Statements About the Containing Document
        2.1.2 Statements About Other Resources
        2.1.3 Avoiding Ambiguity Using External Resources
    2.2 Carrying Metadata
        2.2.1 RDF
3 bibl


1 Motivation

The role of this document is to begin the discussion about XHTML 2.0 and metadata, and it will unapologetically attempt to put RDF at the centre of XHTML's metadata story. For too long now RDF has had to shyly stand in the corner at parties it has not even been invited to. It is constantly accused of being the most obtuse set of standards ever to emerge from the W3C, widely regarded as irrelevant. Yet ironically, every day millions of web users are kept up to date on changes to web sites and blogs using RSS - a simple syndication structure specified in RDF. RDF must be doing something right.

An essential part of the XHTML metadata story, will therefore be to make use of the principles of RDF. A secondary goal will be to harmonise as much as possible with the XML mark-up for RDF. By principles we simply mean that the whole notion of triples and statements will be at the centre of what we do. But in bringing these principles into XHTML, we will also aim to make it as easy as possible for RDF/XML parsers to process metadata contained in XHTML documents.

2 Types of Metadata in XHTML Documents

There are a number of sets of useful meta information that may be contained in, or relate to, an XHTML document:

To introduce the issues we'll go through some examples of each of these, using the RDF notion of triples.

[Big snip of introductory material]

2.1 Putting it all together

According to 7.2.1 of [RDF-SYNTAX] it is possible to begin parsing for RDF at a set of elements that are not in the RDF namespace, provided that one of the RDF attributes is present. We make use of this feature to allow our XHTML markup to be understandable by an RDF parser.

2.1.1 Statements About the Containing Document

The normal behaviour for meta is to make statements about the document that contains it:

<html xmlns:dc="http://purl.org/dc/elements/1.1/">
	<head>
		<title>How to complete Memorandum cover sheets</title>
		<meta name="dc:creator">John Doe</meta>
		<meta name="dc:rights">&copy; 1997 Acme Corp.</meta>
		<meta name="dc:subject">corporate,guidelines,cataloging</meta>
		<meta name="dc:date">1994-11-06T08:49:37+00:00</meta>
	</head>
	...
					

However, if we want to make our metadata available to an RDF parser, we need an RDF attribute on our meta elements. We need to have a root meta that ensures the subject is the document:

<html xmlns:dc="http://purl.org/dc/elements/1.1/">
	<head>
		<title>How to complete Memorandum cover sheets</title>
		<meta rdf:about="#">
			<meta rdf:type="dc:creator" rdf:value="John Doe" />
		</meta>
	</head>
	...
					
Editorial note 
This is the only way I can see to get this to work ... otherwise we lose the rdf:type.
Editorial note 
This could also be abbreviated to <meta rdf:about="#" dc:creator="John Doe" />. What's the consequence for validation of many attributes ini different namespaces?

2.1.2 Statements About Other Resources

Sometimes we need to be able to make statements about resources within the document, or resources outside of the document. For example, we may know that the resource identified by http://people.com/TonyBlair has a con:fullName of "Tony Blair". We could place this in our document, as follows:

<html xmlns:dc="http://purl.org/dc/elements/1.1/">
	<head>
		<title>How to complete Memorandum cover sheets</title>
		<meta rdf:about="#">
			<meta rdf:type="dc:creator" rdf:value="John Doe" />
		</meta>
		<meta rdf:about="http://people.com/TonyBlair">
			<meta rdf:type="con:fullName" rdf:value="Tony Blair" />
		</meta>
	</head>
	...
					
Editorial note 
Another way to do this would be to put rdf:about in the schema for head, with a fixed value of "#". That would make all meta elements that are children of head and that have an RDF attribute, take the containing document as their subject. The problem with that though is I think it makes it difficult to then make the statements about Tony Blair, that we have done in the example.

2.1.3 Avoiding Ambiguity Using External Resources

Again, relying on 7.2.1 of [RDF-SYNTAX] we assume that the presence of an attribute in the RDF namespace would causee an RDF parser to parse this:

I stayed in the <meta rdf:resource="http://www.examples.org/city#london">capital</meta> for a week.
					

into this:

@prefix city: <http://www.examples.org/city#> .

<>  :meta city:london .
					

by beginning at 7.2.21. Note that the inner content should be ignored.

Editorial note 
No matter which way I tried to twist and turn, I could not see how to stop the element's URI-string-value from being the predicate. I therefore felt that the all embracing xhtml2:meta was better than allowing anything, and so ending up with xhtml2:span, xhtml2:div and so on.

A browser could render something smart if the author has made anything available:

<html xmlns:dc="http://purl.org/dc/elements/1.1/">
	<head>
		<title>How to complete Memorandum cover sheets</title>
		<meta rdf:about="#">
			<meta rdf:type="dc:creator" rdf:value="John Doe" />
		</meta>
		<meta rdf:about="http://people.com/TonyBlair">
			<meta rdf:type="con:fullName" rdf:value="Tony Blair" />
		</meta>
	</head>
	<body>
		<div1>
			Tomorrow the <meta rdf:resource="http://people.com/TonyBlair">Prime Minister</meta>
			is expected to fly to ...
		</div1>
	</body>
</html>
					

This could be rendered something like this:

2.2 Carrying Metadata

2.2.1 RDF

This is to some extent outside the scope of what we are doing, but we do need to state our view on this.

3 bibl

linktypes
XHTML 2.0 Link Types (See http://www.w3.org/MarkUp/Group/2003/WD-xhtml2-20031029/abstraction.html#dt_LinkTypes.)
RDF-SYNTAX
RDF/XML Syntax and Grammar (See http://www.w3.org/TR/rdf-syntax-grammar/.)