Matt Cutts says, Expect Caffeine after the holidays
I asked the following question:
Everyone that I talk to is getting tired of SEOs illegitimate ways; SEO websites, SEO links, dodgy footers and all that spam spam spam.
embedded by Embedded Video
YouTube DirektSemantic Web to Kill Spammers
Every developer wants to feel like they are doing something worthwhile, so there must be a way to have a balance of SEO and making good products. The answer is a better semantic web experience, but how will legitimate context be derived?
My thoughts…
In 2010, we will actually retrieve relevant search results based on social-contextual mapping in place of incoming links. There are plenty of trusted sites that most of us use that can paint a contextual picture. Why would Bing, Wolfram|Alpha, Twitter, Facebook team up and Google follow suit? If these companies knows what you feel at any given moment from your tweets, and can marry that up with your location and recent web activity among your friends, they can deliver the exact ads you want!
Google Labs are rolling out Google Social Search, a new tool designed to help users find more relevant public content from their broader online social circle. The tool was announced at the Web 2.0 Summit in San Francisco. Google will suggest connections to those listed as friends on users’ publicly available social network profile information and by crawling a user’s Gmail email contacts.
How Google Social Search works
embedded by Embedded Video
YouTube Direkt
If Google can build a picture socially for the public web, how does that apply to indexing websites?
If search engines were to combine natural language processing, site-specific ontology and semantic lexicons to guide the suggestions and application of indexes, it would be easy – over time – to collect enough stats to completely remove any reliance on in bound links. It also makes indexes more consistent with the terminology, semantics and usage within a site, removing spam completely from the web’s popular search engines. The required attribute files are already found in many popular websites.
The three candidates were microformats, microdata and RDFa. We began with plain HTML:
<p> I'm Emanuel Krässenstein at <a href="http://ypex.com/">ypex.com</a>. </p>
The simple task at hand is to make my name and homepage machine-readable using each of these formats. What follows is a more elaborate version of the reasoning we went through while evaluating the strengths and weaknesses of each alternative.
Microformats
<p class="vcard">
I'm <span>Emanuel Krässenstein</span> at
<a class="url" href="http://ypex.com/">ypex.com</a>.
</p>
Microformats are “a set of simple, open data formats”, i.e. predefined vocabularies under centralized control. In this example I’ve used the hCard microformat. One “feature” of microformats is that it is valid HTML 4.01/XHTML 1.0, which is why the class attribute is used in novel ways. Although HTML 4.01 mentions that class may be used “for general purpose processing by user agents” it’s normally only used “as a style sheet selector”, i.e. for CSS. What this means is that we are working in a single global namespace which is already polluted with all the CSS class names ever used.
The only thing that distinguishes microformats from random CSS classes is the tree structure. This structure is quite a limitation though, because it means that you have to find or make a common ancestor element to all of the data in a single hCard. For a data interchange format, it all seems insane and simply too brittle. Emil put it rather bluntly when he tweeted:
Microformats. Pile of shite that just increases our systematic technical debt.
Still, I have great respect for some of the people behind microformats and the down-to-earth philosophy. They openly state that microformats aren’t “infinitely extensible and open-ended” or “a panacea for all taxonomies, ontologies, and other such abstractions”. As microformats was never intended to solve our use case it is no surprise that it really doesn’t.
Certainly anyone can use class="foo" to mean anything they like without going through the microformats process – such data formats are cleverly called poshformats (Plain Old Semantic HTML). All things considered though, the whole approach seems outdated and I hope it won’t still be around 5 years from now. Microformats has shown the need for HTML-embedded machine-readable data, now let’s find a better solution.
RDFa
To understand RDFa you first need some understanding of RDF. The RDF model is basically a somewhat roundabout way of describing graphs using subject-predicate-object triples. An example is the best way to illustrate:
This graph represents me, my name, my homepage and the relationships between them. I’m using the FOAF vocabulary because it already has the concepts of “name” and “homepage”. In N3 syntax this corresponds to these two triples:
@prefix foaf: <http://xmlns.com/foaf/0.1/> . <#me> <foaf:name> "Emanuel Krässenstein" . <#me> <foaf:homepage> http://ypex.com .
Everything in <brackets> is a URI and because URIs tend be long prefixes are used: <foaf:name> actually means <http://xmlns.com/foaf/0.1/name>. I’ve used #me to represent myself, but this should really be resolved to a full URI.
As you can see, the subject is #me in both statements. The relationships in the graph are the predicates, i.e. foaf:name and foaf:homepage. The object is either another URI or a string literal. Adding RDF triples equates to adding more nodes and relationships to the graph. This is general enough that you can model almost anything you want with it.
Back to RDFa. The “a” refers to how attributes in XHTML are used to serialize RDF:
<p xmlns:foaf="http://xmlns.com/foaf/0.1/" about="#me">
I'm <span property="foaf:name">Emanuel Krässenstein</span> at
<a rel="foaf:homepage" href="http://ypex.com/">ypex.com</a>.
</p>
The use of XML namespaces here is a bit odd. Prefixes in XML are used on element and attribute names, but here it’s only used in the attribute value. These are actually CURIEs, another URL shortening scheme. Jeni Tennison recently wrote an excellent post about the use of prefixes in RDFa which I encourage everyone to read. I also chatted briefly with Henri Sivonen about the problems with xmlns and would recommend reading his mails on those issues.
If we return to RDFa syntax for a bit, notice how property, rel and rev are used for the exact same purpose (setting the predicate) in different contexts. The intention was probably to mimic existing practices such as rel=”next”, but the net result is just more room for confusion. While I won’t claim that it’s just too hard I certainly think it could have been simpler without loosing much expressive power.
RDFa began in the now discontinued XHTML2 WG and seems strongly rooted in the Semantic Web (now Linked Data) community and that stack of technologies and tools. It was later made into a module for XHTML 1.1, but there is no W3C-sanctioned way of embedding RDFa in plain HTML. Getting into HTML5 would guarantee RDFa’s survival in the web ecosystem, so its proponents approached the WHATWG/HTML WG suggesting that RDFa be included. There was much heated discussion, the drama of which was my sole source of entertainment for weeks at a time. I’ll again refer to Jeni’s summary of the clash of priorities and “fruitless discussion”. I particularly want to emphasize this conclusion:
It’s just not going to happen for HTML5
I don’t hate RDF(a). I can certainly see the appeal of the RDF model after taking the time to understand it. It may just be a very verbose way of describing graphs, but as a data interchange format it seems to do a good job. However, being able to express arbitrary RDF in HTML in a compact way is not an actual use case for most web developers. If it’s possible without added complexity that’s fine, but HTML is not a triplestore.
Microdata
As a result of gathering use cases and other input from the big RDFa discussion, suddenly one day HTML5 microdata section sprung into existence along with a very long announcement to the WHATWG list from Ian Hickson (our editor). Within 3 hours there was a demo and not long after another. This is it:
<p item="vcard">
I'm <span itemprop="fn">Emanuel Krässenstein</span> at
<a itemprop="url" href="http://ypex.com/">ypex.com</a>.
</p>
This looks very similar to the microformats example, but the new item and itemprop attributes are used instead of class. The model used is nested groups of name-value pairs, where the name-value pairs are given by the elements with itemprop attributes. In other words, it is quite similar to a DOM tree or a JavaScript object.
There are some predefined item types (used above), but it’s possible to use either URLs (http://foolip.org/footype) or reversed DNS identifiers (org.foolip.footype) to define your own types without any risk of namespace pollution. Note however that there are no prefixes or other URL shortening schemes. I don’t think I’m crazy to suggest that services like bit.ly and tr.im have shown a way out of the “long URL” problem. If microdata gains any traction, I think communities will create vocabularies with clever shorthands like http://link.to/the/past, mr.burns or ht.ml5.
Finally, the subject attribute can be used to avoid the “common ancestor” problem we had with microformats by simply referring to the item element by id:
<p item="vcard" id="me">
I'm <span itemprop="fn">Emanuel Krässenstein</span>.
</p>
<!-- stuff -->
<a itemprop="url" subject="me"
href="http://ypex.com/">ypex.com</a>.
Microdata is quite straightforward and feels much more native to HTML than RDFa. As Jeni explains, microdata can’t express RDF triples using datatypes or XML literals. I’ll also add that using a blank node as object isn’t possible. Other than that, RDF triples can be expressed by using the about type to give the subject of the name-value (predicate-object) pair. Here’s my FOAF example from earlier:
<p item>
<a itemprop="about" href="#me"></a>
I'm <span itemprop="http://xmlns.com/foaf/0.1/name">
Emanuel Krässenstein</span> at
<a itemprop="http://xmlns.com/foaf/0.1/homepage"
href="http://ypex.com/">ypex.com</a>.
</p>
It is quite ugly, so if there’s any way to make it simpler I’m sure such suggestions are welcome. In general though, it seems like a better idea to use simple microdata structures and map that against a RDF vocabulary if possible. In fact, the spec already defines how to extract some RDF (and JSON) from microdata so I’m sure it’s not difficult to do.
Returning to the “browsable web” (the one I normally work with), microdata has a DOM API that browsers can implement. The prospect of JavaScript having access to the microdata on a page is so exciting that I didn’t want to wait, so I hacked up MicrodataJS to try it out. You can access my name and email in the vcard example as such:
var props = document.getItems("vcard")[0].properties;
var fn = props.namedItem("fn")[0].content;
var url = props.namedItem("url")[0].content;
alert("Name: " + fn + "; URL: " + url);
Unsurprisingly there are some issues with the API which I’ve sent feedback on and expect to be fixed to my satisfaction eventually, but the basic functionality is sound. I imagine scripts making dynamic pie charts from tables, providing page-specific autocomplete suggestions and making shiny animated SVG visualizations of the RDF graphs hidden in the tag soup…
Google is now offering to do usability testing of the microdata syntax to see if it can be improved, so if you have any suggestions be sure to bring those to the WHATWG now.
Summary
The examples I’ve used are overly simplistic and may utterly fail to show the strengths and weaknesses of each syntax. Still, this is my best effort to make sense of the issues at hand and I haven’t intentionally misrepresented any technology or community. I assume that there is much more debate to come before the dust settles on this issue and perhaps I’ll even change my mind after experimenting more with real-world implementation. I leave you with this unambiguous summary of my views:
- Microformats, you’re a
classattribute kludge - RDFa, HTML is not your triplestore
- Microdata, I like you but you need more review
Updates
- Shelley Powers wrote about RDFa and HTML5’s microdata from the perspective of the RDFa/Semantic Web community. It’s quite a different view from mine, so read that before believing my propaganda.
- Following James Graham’s suggestion, I have registered mantic.se for fun reverse DNS identifiers like
se.mantic.banana. Mostly for fun, don’t take it too seriously… - I misunderstood Jeni’s post about expressing RDF in microdata and have fixed that section to be more accurate.
http://www.rdfabout.com/intro/?section=contents
Tags: Caffeine, future of search engines, Google Social Search, Matt Cutts, microdata, microformats, RDF, RDFa


