RDFa Email signatures

Hot from reading about RDFa Lite this morning (notwithstanding the vile respelling of ‘light’), I started thinking about ways to employ the ideas of publicly available vocabularies to make information  machine reusable. One obvious usage was the ubiquitous email signature. These days, a lot of them are html anyway; what if we just added some tags?

Take for example the famous Sherlock Holmes. Imagine him emailing from his sitting room with the following signature:

Sherlock Holmes
Consulting Detective
221b Baker Street
London
mobile: +44 800 221221
email: sholmes@plotsfoiled.com

Anyone getting this, say Professor Moriarty, would probably actually see the following due to their email client pattern matching for email address and phone numbers:

Sherlock Holmes
Consulting Detective
221b Baker Street
London
mobile: +44 800 221221
email: sholmes@plotsfoiled.com

It’s a bit sad really. Despite all the recent strides forward in social media and ‘linked-data’ that’s as far as email engines have got. It’s no idea about the brave detective’s name, job or where he lives, they’re invisible.

Now imagine for a moment a rather smarter mailer, sending and receiving these messages. Both the sender and receiver might benefit from the invisible tagging that allows the rest of the signature to be brought into play. RDFa Lite is a subset of the full spec and goes out of it’s way to make it easy to add hints as to what things are and how they relate to one another. Let’s start with the simple signature in html:

<span>
<p>Rgds,</p>
<p >
<span>Sherlock Holmes</span><br/>
<span>Consulting Detective</span><br/>
<span>221B BakerStreet</span>
<span>London</span>
mobile: <span>+44 800 221221</span><br/>
email: <span>sholmes@plotsfoiled.com</span>
</p>
<span>

First off, we need to add the vocabulary header to the second paragraph:

<p  vocab="http://schema.org/" typeof="Person">

I’ve use “typeof” to set the vocabulary we’re talking about, i.e. a Person. You can see all the vocabularies at https://schema.org/docs/schemas.html. – there are all sorts. Next off, simply add a property for each line in the signature that describes the item, like so.

<p vocab="http://schema.org/" typeof="Person">
<span property="name">Sherlock Holmes</span><br/>
<span property="jobTitle">Consulting Detective</span><br/>
<span property="address" typeof="PostalAddress">
    <span property="streetAddress">221B BakerStreet</span>
    <span property="addressLocality">London</span>
</span>
mobile: <span property="telephone">+44 800 221221</span><br/>
email: <span property="email">sholmes@plotsfoiled.com</span>
</p>

Note the address needs an enclosing span as addresses have properties of their own. The wrapper declares the parent type and then the address components nest inside

Now, our smart email program will know that London is a locality; what will it do with it? I’ve no idea: perhaps show it to you on a map, tell you how far they were away, but something! The important things are smart email programs will recognise what it is and be able to link it to something else: that’s the semantic web in action.

Sadly, as far as I know there isn’t an emailer that does this and it’s really difficult to get an emailer to even send html marked up like this as most thouroughly mangle the html you give them, Outlook certainly did, as did Gmail. In fact the only program that sent the signature as it looked above was Mac Mail. If however, you want to get a glimpse into the semantic future, then you have to look no further than the Google Structured Data Testing Tool. Simply copy the marked up signature above into the window and voilà!

Untitled

 

 

 

Perhaps if this became common practice, as html signatures before it. Mainstream programs would include this sort of linkage. I’ll live in hope.