Rdfa-as-ui-extension-mechanism

From RDFaWiki

Jump to: navigation, search

Contents

Introduction

HTML and XHTML standards tend to be increasingly large undertakings whose time frames from beginning to end approach multiple years. Some standards processes are approaching a decade to complete and the future only holds longer release cycles unless the standards bodies can find a way to modularize the work. XHTML Modularization was a step in the right direction. The HTML 5 route, while a noble undertaking, could be improved via the use of RDFa semantics to provide functionality. This article outlines a potential method for improving the standardization processes for XHTML and HTML family languages by using vocabularies to define functionality instead of the traditional ELEMENT/ATTRIBUTE route.

Proposal

The proposal is quite simple, use basic XHTML and HTML 5 tags to provide the markup framework and provide RDF vocabularies to refine the user interface experience along side CSS.

Video Example

A demonstration of this approach uses the VIDEO element in the HTML 5 specification as an example. To be more specific, all media objects in HTML 5 contain the following attributes: src, duration, autoplay, start, loopstart, loopend, end, playcount, and controls. Each of those can be expressed as an RDF attribute on the video object itself.

Here is a video object marked up via HTML 5:

<video src="sample.mov" duration="120" autoplay></video>

and here is a potential video object marked up via XHTML+RDFa 1.0:

<object about="#sample" typeof="video:Recording" href="sample.mov">
   <param property="video:duration" content="PT120S" />
   <param property="autoplay" content="true" datatype="xsd:boolean" />
</object>

While the HTML 5 example is more terse and easier to author, the XHTML+RDFa approach should result in faster standardization, implementation and adoption. The benefits of the latter approach is that the video vocabulary, and the way that browsers interpret it, can evolve independently of the underlying XHTML language. One of the reasons that it has taken so long for audio and video to be treated as first-class citizens on the web is because standards authors aren't just attempting to solve the audio/video problem, but ALL HTML problems at once.

By using the approach of "(X)HTML for scaffolding and CSS/RDFa for UI specification", the industry as a whole can:

  1. Move more quickly because it is faster to refine a video vocabulary and release revisions of the vocabulary than an entire HTML specification.
  2. Invite experts to specify the correct vocabulary and browser functionality instead of depending on the experts to take part in the entire W3C (X)HTML process.

Comments

TobyInk: The presence of the about attribute is subtly important. Without it, if the same video is used more than once, autoplaying only some of the time, you end up generating triples like this:

<http://example.org/sample.mov> a video:Recording ;
          video:duration "PT120S" ;
          ex1:autoplay "true"^^xsd:boolean , "false"^^xsd:boolean .

which makes little sense.