demosthenes.info

A blog by Dudley Storey on , , , , , , and anything else that strikes his fancy.

featured articles

popular favourites

Microdata: Metadata For Content

Under XHTML, many tags, such as <address>, are semantic: that is, they carry meaning. (In the case of <address>, the meaning is “the content of the <address> tag is a real-world address”). This structure of semantic tags is embraced and extended in HTML5 through elements like <time>.

Even with the dozens of new tags in HTML5, there is no way to provide meaning for every piece of content. This impoverishes the web: machine-readable tags that provide context make for a richer, more semantic internet, better and more accurate searches, and more powerful data aggregators. But short of an XML utopia, covering every possibility of meaning is a near-infinite task.

Instead, there are several measures that add to, or extend, the semantics of web pages:

  • Dublin Core meta tags, and their progenitors, attempt to summarize the context of the entire page, adding information such as authorship and revision date. However, they can only describe the page as a whole: as meta tags are written in the <head> section, it is impossible for them to drill down and specify the individual content of the page.

  • Microformats extend tags via special values for class and del attributes. Microformats have strong support by Google, Facebook and YouTube through schemas like hcard (to represent people, companies, organizations, and places), calendar (for events), recipe, and XFN (to diagram relationships between people).

  • RDFa is another means of providing context to tags via values added to del and class attributes, currently used to indicate Creative Commons licenses, amongst other purposes.

  • To this, HTML5 adds microdata, a way of extending the meaning of tags through a shared vocabulary. Unlike meta tags, microdata is written in the body of an HTML document; unlike micro formats and RDFa, it does not abuse class or del, instead using new attributes that are built into HTML5 such as itemscope and item type, with established, central schemas such as www.schema.org and www.data-vocabulary.org. Google and Microsoft are both supporters of microdata, with more supporters being added daily.

“Which system should I use?”

That depends on what you are trying to do:

  • If you are making an XHTML page, use Dublin Core and micro formats
  • If you are adding a Creative Commons license to a page, you can use both RDFa and micro data.
  • If you are making an HTML5 page, use micro data, adding meta tags and RDFa as they are supported with namespaces.

Over the next few weeks I will be providing examples of each in articles on this blog; you'll also see microdata used in the code of the next revision of this site.

web developer guide

featured comment

by JoelB in Goodbye, JQuery Validation: HTML5 Form Errors With CSS3

what i'm reading

A Storm of Swords: A Song of Ice and Fire: Book Three
A Storm of Swords: A Song of Ice and Fire: Book Three

what i'm watching

Californication: The Third Season
Californication: The Third Season

what i'm playing

Mass Effect 3 Collector's Edition
Mass Effect 3 Collector's Edition

what i'm hearing

Dub FX
Dub FX

blogs

podcasts

no ads ever

This blog is free of advertising, and always will be.

creative commons licensed

The content of this blog is free to use in whatever way you wish under the Creative Commons license.