Microformat
Microformats are mark-up that allow expression of semantics in an HTML (or XHTML) web page. Programs can extract meaning from a web page that is marked up with microformats.
Existing (X)HTML standards allow for semantics to be embedded and encoded within them. This is done using specific HTML attributes:
- class
- rel
- rev
Adding microformats to a regular HTML web page allows machines to process HTML text and to possibly load data into remote databases. This would allow programs such as web crawlers to find items such as contact information, events, and reviews on web pages.
Example
For example, consider the hCard contact information microformat:
<div class="vcard"> <div class="fn">Joe Doe</div> <div class="org">The Example Company</div> <div class="tel">604-555-1234</div> <a class="url" href="http://example.com/">http://example.com/</a> </div>
Here the formal name (fn), organisation (org), telephone number (tel) and url have been identified using specific class names; and the whole thing is wrapped in class="vcard"
, (see vCard) which indicate that the other classes form an hcard, and are not just coincidentally named. Other, optional, hCard classes also exist.
It is now possible for software, for example browser plug-ins, to extract the information, and transfer it to other applications, such as an address book.
Specific microformats
Several microformats have been developed to enable semantic markup of particular types of information.
- hAtom (hAtom spec) - for marking up Atom feeds from within standard HTML
- hCalendar (hCalendar spec) - for events
- hCard (hCard spec) - for contact information
- hReview (hReview spec) - for reviews
- hResume (hResume spec) - for resumes or CVs
- rel-directory (rel-directory spec) - for distributed directory creation and inclusion
- rel-nofollow, an attempt to discourage 3rd party content spam (e.g. Spam in blogs).
- rel-tag (rel-tag spec) - for decentralized tagging (Folksonomy)
- xFolk (xFolk spec) - for tagged links
- XFN - for social relationships
- XOXO - for lists and outlines
Proposed microformats
Among the many proposed microformats, the following are nearing completion:
- currency - for amounts of money
- geo extension - for places on Mars, The Moon, and other such bodies
- species - For the names of living things.
Uses of microformats
Using microformats within HTML code provides additional formatting and semantic data that can be used by applications. These could be applications that collect data about on-line resources, such as web crawlers, or desktop applications such as e-mail clients or scheduling software.
Several browser extensions, such as Tails Export and Operator, provide the ability to detect microformats within an HTML document and export them into formats compatible with contact management and calendar utilities, such as Microsoft Outlook.
Microsoft[1] and other software companies have expressed a desire to incorporate Microformats into upcoming projects.
Creation of microformats
Most of the existing microformats were created at the microformat wiki and associated mailing list, by a process of gathering examples of web publishing behaviour, then codifying it. Some other microformats (such as rel=nofollow, unAPI and rel=pavatar) have been proposed, or developed, elsewhere.
See also
- COinS
- GRDDL
- HTML
- Intelligent agents
- RDFa RDF with attributes
- rel=pavatar
- S5 file format
- Semantic Web
- Simple HTML Ontology Extensions (early semantic extensions to HTML done by University of Maryland, College Park)
- Web crawlers
- XHTML
- XML
- unAPI
- Microformats in Wikipedia
External links
- microformats.org
- Microformats Primer
- The Big Picture on Microformats
- Add microformats magic to your site
- xFolk: An xhtml microformat for folksonomy
- Microformats explained and their effect on Search Engine Optimization
- Embeddable RDF
- micromodels
- Microformatique
- Why Microformats
- Microformats hCard which can add geographic information to web pages
Books
This page lists books which provide description and documentation of microformats.
- Hacking RSS and Atom by Leslie M. Orchard
- Wiley, ISBN 0-76459-758-2, 2005
- The last chapter has a nice section on both publishing and consuming hCalendar events in either a feed or as part of a page. Les has implemented various microformats (hCalendar entry form as a greasemonkey script, XOXO dynamic editing).
- You can find source code for the hCalendar scripts from my book at his site. Look for the files starting with ch18.
- Web Design In A Nutshell, Third Edition by Jennifer Niederst Robbins. IMPORTANT: This applies to the THIRD EDITION only!
- O'Reilly Media, ISBN 0-59600-987-9, 2006
- Provides an excellent modern standards based foundation for web design that is ideal for understanding microformats, and a whole introductory chapter on microformats as well.
- See also Web Design in a Nutshell, Third Edition (on oreilly.com).
- Using Microformats by Brian Suda
- ISBN 0-596-52817-5, 2006
- This is a PDF book, part of the O'Reilly Short Cuts series. It is a solid introduction to all the established microformats, the history, philosophy and a look at where microformats are headed.
- HTML Mastery by Paul Haine
- Friends of Ed, ISBN 1-59059-765-6, 2006
- Chapter 5, pp. 117-154: Purpose Built Semantics: Microformats and Other Stories.