Personal tools
You are here: Home Tech Tidbits Microdata: The Human Readable Data

Microdata: The Human Readable Data

HTML5 has advanced the ability to encode metadata into HTML so that data can be both machine processable and actual human language.

A rose is not always a rose. 

In reading text, HTML is the lingua franca of the Internet. Whether web pages or email, mainly we now read HTML coded pages. 

<p>A rose is not always a rose.</p>

can now be:

<p> A <span itemscope 
itemprop="name">rose</span> is not always a rose.</p>

A Rose May be Sniffed or Processed

But a human reader might just see: 

A rose is not always a rose.

Software would not be set to recognize that the subject, "rose" of the first example, was the noun or verb or perhaps more than a string of characters. In the second example, software or scripts would process "rose" as an object to be referenced, acted upon, queried, etc.


The Attributes of Microdata: itemscope

It objectifies HTML elements. Any element in the body of an HTML document can become a Microdata object by adding the itemscope attribute.

<HTMLelement itemscope itemt.... >text 
and/or nested elements</HTMLelement>

The Attributes of Microdata: itemtype

The object created can refer to one URI/URL in the itemtype attribute to tell what type of object something is. The web site is an effort to create some standard itemtypes that people can look at. Currently, there is no XML schema that can be referenced to allow for data/schema validation of the object.

<HTMLelement itemscope 
... >text and/or nested elements</HTMLelement>

The Attributes of Microdata: itemsprop

And the object can have unlimited properties, essentially a key pair, where the property name is indicated in the itemprop attribute and the value within the element or within a specific attribute.

<HTMLelement itemscope itemtype="URI">text 
and/or nested elements</HTMLelement>
<div itemprop="name">snowball</div>
<p itemprop="temp" value="0">32 degrees/freezing</p>

The Attributes of Microdata: itemid

itemid - URI/URL to an unique identifier for that object and perhaps the original object

If the itemtype was a book, the itemid might the ISBN URN like urn:isbn:1234567890123 or to the actual webpage for the book, like

The Attributes of Microdata: itemref

itemref - like itemprop, but refers an itemprop(s) elsewhere on the page that has the specific id attribute.

This would be great for Microdata objects in a table, where the column headings could have the itemprop that applies to all the column's cells. Essentially, this is a way to allow itemprops that are not nested, but was done mainly for the table usecase.

The ReST of Microdata

A powerful aspect of Microdata that is not part of Microdata is the use of an id attribute. This can turn a Microdata object into an object that can be referenced by a URL. 

<div itemscope itemtype=".....">....</div>
 <div id="newobject1" itemscope itemtype=".....">

And then that object could be reference as a URL, like 

Microdata Objects as Web Databases

  • Unique identifiers
  • Converts into non-human readable formats with XSLT, javascripts, etc. (or into HTML from XML)
  • Objects can be one to a page, one line each, cells of a table, list items, floating in a sea of text, randomly spread in a web page
  • Just like web pages, can be served based on ReSTful API

Microdata Objects as Web Databases: continued

  • Human readable and easily documented with annotations
  • Referenceable, citeable, linkable, copyable (with a link/reference to original data.
  • Potentially allows for data validation
  • Draggable in HTML5

Microdata Objects as Web Databases: continued

  • Blob friendly
  • Potentially friendly with Linked Data
  • SEO friendly
Document Actions
What's News