Microformats and the Semantic Web

A microformat is a web-based method for implementing page semantics through the use of common HTML or XHTML tags and the attributes within those tags (e.g., a <span> tag with an appropriate class). These tags convey metadata about the page or a particular object on the page.

For instance, with the defined geo microformat specification, we can use <span> tags with an appropriate class, geo, to denote that we are specifying a geographical location:

<span class="geo">
   <span class="latitude">45.512280</span>,
   <span class="longitude">-73.554390</span>
</span>

Semantic markup is a core concept of technologies such as those we explored in the Open Graph protocol in Chapter 10. Microformats are simply a way of contributing to the semantic web.

This type of semantic markup helps when you are attempting to programmatically parse a site to extract as much usable information about its content as possible. If that page has all of its relevant information tagged through microformat specifications, then extracting its relevant data should be a simple task.

In addition to providing a way to extract data easily, tagging through microformat specifications allows the site developer to denote the relevant content of the page rather than having a site parser attempt to infer that information itself. This will ensure a consistent experience when the content is integrated at another location.

There are a number of microformat specifications available to help you implement microformat tagging on your sites:

hAtom

To mark up Atom feeds within standard HTML.

hCalendar

To tag event-based information.

hCard

For contact information. This includes:

adr

For address-based information.

geo

For geographical coordinates such as latitude and longitude.

hMedia

To mark up audio and video content.

hNews

To denote news-based content on a page.

hProduct

For products.

hRecipe

For recipes and information relating to foodstuffs.

hResume

For resumes or CVs.

hReview

For any type of review content.

rel-directory

For distributed directory creation and inclusion.

rel-enclosure

For multimedia attachments to web pages.

rel-license

For the specification of a copyright license.

rel-nofollow

An attempt to discourage third-party content spam.

rel-tag

For decentralized tagging.

xFolk

For tagged links.

XHTML Friends Network (XFN)

For social-based relationship data.

XOXO

For lists and outlines.

Following these specifications will help you build semantically relevant pages and sites. For more information on microformat specifications, see http://microformats.org/.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.37.38