Brand new microformats 2 parser
Demo API /> http://microformat2-node.jit.su/
New life in the semantic web
A lot has changed in the last couple of years; the search engines have started to use semantic mark-up to improve their listings. Google’s rich snippets feature has created a secret army of SEO people who are quietly marking up big parts of the web with semantic data. Not that there are not already billions of microformats on the web.
HTML5 created a third standard of semantic web mark-up to add to the mix of RDFa and microformats. Then the search engines clubbed together and brought us schema.org. After a few catfights between the standards supporter clubs, these events have brought us a small rebirth of the semantic web.
The microformats community has revisited it’s standard and come up with “microformats version 2”. At first, I thought why! I don’t like change unless it gives me something worthwhile. After reviewing the work, I think the wholesale change to a new version of microformats is worthwhile because:
- The authoring patterns have been simplified even more and they are based on real life use cases e.g.:
Glenn Jonesis a valid microformat
- microformats 2 addresses one of the biggest problems in maintaining microformats in real sites. The class names are now prefixed i.e. class=”fn” is now class=”p-name”. The prefixes like “h-*” and “p-*” tells you a class is a microformat property and helps make sure classes are not moved or deleted by mistake
- Like microdata, microformats 2 now has a full specification for a JSON API. This is important as it means the parsers should now have the same output and also browsers could implement this API.
New parser and test suite
I have just open sourced a new version of microformat-node using this parsing engine. Soon I will create a browser compatible version of the engine and update the microformat-shiv library which powers browser plug-ins etc.
The test suite took a long time to develop, but should provide an excellent starting point for anyone else who wants to develop a new microformats 2 parser. I know Barnaby Walters has already started working with it for his php-mf2 parser.
I hope this work will help microformats and the concept of the semantic web move forward another little step. Enjoy