The Semantic Browser: Improving the User Experience

Mark Birbeck, x-port.net, and Steven Pemberton, CWI/W3C, Amsterdam

These slides are in XHTML. They use the CSS media 'projection' to allow them to be displayed full-screen.

Abstract

Using a clever mutation of the <link> and <meta> elements, and the addition of a 'role' attribute, XHTML2 allows authors to layer real semantics on top of documents, semantics with a clear relationship to RDF, so that XHTML2 can be properly integrated into the semantic web.

But what does it mean when the browser all of sudden really knows what the content is about? If it really knows that something is an address, it can offer to add it to your address book, or find it for you on a map; if it really knows that something is an announcement for an event like a conference, and can identify the sub-parts, it can offer to add it to your agenda, find it on a map, locate hotels, look up flights...

This talk will discuss some of the possibilities.

XHTML2

XHTML2 is the next iteration in the HTML family.

XHTML1 addressed the problems of turning HTML into an XML application.

XHTML2 addresses the remaining identified problems in HTML4/XHTML1

Some remaining problems

HTML: a great success, but has become a sort of Garden of Eden, with lots of Thou Shalt Nots in the form of guidelines:

etc, etc, etc

And these communities have all come to the HTML working group to ask for new facilities.

XHTML2 Design Aims

In designing XHTML2, a number of design aims were kept in mind to help direct the design. These included:

As generic XML as possible: if a facility exists in XML, try to use that rather than duplicating it. This means that it already works to a large extent in existing browsers (main missing functionality XForms and XML Events).

Less presentation, more structure: use stylesheets for defining presentation.

More usability: within the constraints of XML, try to make the language easy to write, and make the resulting documents easy to use.

More accessibility: 'designing for our future selves' – the design should be as inclusive as possible.

XHTML2 (more)

Better internationalization.

More device independence: new devices coming online, such as telephones, PDAs, tablets, televisions and so on mean that it is imperative to have a design that allows you to author once and render in different ways on different devices, rather than authoring new versions of the document for each type of device.

Better forms: after a decade of experience, we now know how to make forms a better experience.

Less scripting: achieving functionality through scripting is difficult for the author and restricts the type of user agent you can use to view the document. We have tried to identify current typical usage, and include those usages in markup.

Better semantics: integrate XHTML into the Semantic Web.

Try to make the world a Better Place

Keep old communities happy

Keep new communities happy

Backwards compatibility

Earlier versions of HTML claimed to be backwards compatible with previous versions.

For instance, in HTML4

<meta name="author" content="Steven Pemberton"> 

puts the content in an attribute and not in the content of the element for this reason.

In fact, the only version of HTML that is in any sense backwards compatible is XHTML1 (others all added new functionality like forms and tables).

XHTML2 takes advantage of CSS not to be element-wise backwards compatible, but 'architecturally' backwards compatible.

For instance, as mentioned already, much of XHTML2 works already in existing browsers.

A Simple Example

XHTML2 is recognisably a family member:

<html xmlns="http://www.w3.org/2002/06/xhtml2/" xml:lang="en">
  <head>
    <title>Virtual Library</title>
  </head>
  <body>
    <p><img src="vlib.png">[The Virtual Library]</img>
       Moved to <a href="http://example.org/">example.org</a>.</p>
  </body>
</html>

Semantics

X/HTML has structure creating elements, like <p>, <h> and <div>, and textual elements, like <strong>, and <span>, and it has a smattering of elements and attributes that essentially add semantics or metadata:

etc. (as well as <meta> and <link> of course).

The HTML WG is constantly being asked to add new semantic elements, such as

and it often very hard to decide where to draw the line in adding new elements.

The relationship to the Semantic Web

And furthermore, how do the existing semantics relate to the semantic web (i.e. to RDF), and how can you integrate XHTML into the semantic web (or RDF into XHTML) without sending the existing HTML community screaming in the other direction?

RDF/A

What we have done is craftily mutated <meta> and <link> so that they look more or less the same to the HTML author, but now have a clear relationship to RDF, and then generalised.

This was originally proposed in a white paper RDF/A (warning: details have changed since this was published), and after much work in a joint semantic web/HTML WG task force, was adopted into XHTML2 (that work is still not quite finished, since bnodes still have to be finalised).

Example: meta

<meta name="dc.creator"
      content="Steven Pemberton"/>

now becomes:

<meta property="dc:creator">
    Steven Pemberton
</meta>

The use of @content still permitted if you want:

<meta property="dc:creator" content="Steven Pemberton" />

@name becomes @property because

  1. its datatype is different (it is now a Qname)
  2. it is the name used by RDF.
  3. @name was used with different meanings in too many places in HTML

Example: link

<link rel="index" href="index.html"/>

now becomes

<link rel="index" href="index.html"/>

See the difference? No? There isn't one.

The relationship to RDF

Both <link> and <meta> now also have an 'about' attribute, so that the metadata doesn't have to be about the current document:

<meta about="http://www.cwi.nl/~steven/" property="dc:creator">
    Steven Pemberton
</meta>

The default for 'about' is the current document.

We can now say that <meta> and <rel> define RDF triples:

Generalising meta

The attributes on <meta> and <link> can be used on any element. For instance:

<body>
      <h property="title">My Life and Times</h>
      ...

is a way of saying that "My Life and Times" is both the <title> of this document, as the top-level heading.

Similarly this records in an RDF-friendly way the license of the current document:

This work is licensed under the <a rel="dc:rights"
    href="http://creativecommons.org/licenses/by/2.0/">
    Creative Commons Attribution License</a>.

(You'll note that this is nearly identical to the HTML idiom, but we can now relate it to RDF).

There is a standard filter called GRDDL for extracting the RDF from an XHTML2 document.

Why this solution is nice

You can explain it using HTML concepts.

If you don't care, you can just ignore it.

It doesn't require you to learn how to use RDF to be able to benefit from it.

You can build up layers of semantics, and slowly add them to existing content.

The RDF community get their triples without the HTML community having to learn RDF.

Problems solved

This approach solves a lot of outstanding problems.

For instance, the Internationalisation community needed a way of adding markup to a title attribute.

Now we can just say that

<p id="p123" title="whatever">

is equivalent to:

<p id="p123">
   <meta about="#p123" property="title">whatever</meta>

... and it solves the problem of everyone asking for new elements in XHTML. But first a diversion...

role

The accessibility community needed a way to specify what a particular element was for, for instance, that a certain <div> was just a navbar, that another <div> was the main content, etc. So we introduced the 'role' attribute for this. You can now say:

<div role="navigation">...</div>
...
<div role="main">...</div>

but once we had that mechanism, it allowed us to add any semantics we wanted, layering it on top of the structure. For example:

<p role="note">...

but also

<span role="note">...
<table role="note">...

role values

In fact, anyone can add their own role values, so that whole communities can agree on new semantics to overlay on to the content.

Apparently the mobile and device-independent communities are very excited about the possibilities of using role.

In fact, you don't really need RSS anymore:

<h role="rss:title">...
<p role="rss:description">...

role is like class+profile

HTML lets you say

<html>
   <head profile="...url...">
   ...  
<body>
   ...
   <h3>News</h3>
   <ul class="news">
   ...

Now you say

<html xmlns:hp="...url...">
  ...  
<body>
   ...
   <h3>News</h3>
   <ul role="hp:news">
   ...

The Functional Benefits

Once a search engine can derive from the document that the text "the prime minister" means "Tony Blair", then a search for "Tony Blair" can find that page as well, even if it doesn't mention him by name.

If the browser really knows that something is an address, it can offer to add it to your address book, or find it for you on a map.

If the browser really knows that something is an announcement for an event like a conference, and can identify the sub-parts, it can offer to add it to your agenda, find it on a map, locate hotels, look up flights, ...