Semantic brevity

When I write here at adactio.com, I often sprinkle in some microformats. As I wrote in Natural Language hCard, I’ve developed a sense of smell for microformats:

Once I started looking for it, I started seeing identity and event information in lots of places… even when it doesn’t explicitly look like cards or calendars.

If I’m linking to somebody using their full formated name, then it’s a no-brainer that I’ll turn that into an hCard:

<span class="vcard">
<a class="fn url" href="http://example.com/">
Joe Bloggs
</a>
</span>

But what if I don’t want want to use the full name? It would sound somewhat stilted if I wrote:

I was chatting with Richard Rutter the other day…

When you work alongside someone every day, it sounds downright weird to always refer to them by their full name. It’s much more natural for me to write:

I was chatting with Richard the other day…

I would still make his name a hyperlink but what can I do about making this text into an hCard? Should I change my writing style and refer to everyone by their full formated name even if the context and writing style would favour just using their first name?

Enter the abbr element:

ABBR: Indicates an abbreviated form

I can write “Richard” in my body text and use the semantics of (X)HTML to indicate that this is the abbreviated form of “Richard Rutter”:

<abbr title="Richard Rutter">
Richard
</abbr>

From there, it’s a simple step to providing an hCard containing the formated name without compromising the flow of my text:

<span class="vcard">
<a class="url" href="http://clagnut.com/">
<abbr class="fn" title="Richard Rutter">
Richard
</abbr>
</a>
</span>

Now a parser will have to do some extra legwork to find the formated name within the title attribute of the abbr element rather than in the text between the opening and closing tags of whatever element has a class of “fn”. But that’s okay. That’s all part of the microformats philosophy:

Designed for humans first and machines second

Specifically, humans who publish first, machines that parse second.

If I were to link off to Richard’s site from here, I’d also combine my microformats: hCard + XFN:

<span class="vcard">
<a class="url" rel="friend met co-worker" href="http://clagnut.com/">
<abbr class="fn" title="Richard Rutter">
Richard
</abbr>
</a>
</span>

Now I’ve got a bounty of semantic richness:

All of that in one word of one clause of one sentence:

I was chatting with Richard the other day…

Sunday, October 14th, 2007 5:58pm

Tagged with

Illustrations

Thanks to the magic of machine tags, you can illustrate this post by tagging a picture on Flickr with:

Related

Magnolia

Find links that I've have tagged with microformats, hcard, writing, language, english, semantics, etc. on Magnolia.

Technorati

Is anybody linking to this?

Find out what other people are saying about microformats, hcard, writing, language, english, semantics, etc. according to Technorati.

Flickr

Find photos I've tagged with microformats, hcard, writing, language, english, semantics, etc. on Flickr.

Find photos that I took on October 14th, 2007.

More information

About this site

Adactio is the online home of , a web developer living and working in Brighton, England.

Customise

If your browser was up to it, you'd be able to
?

This is the plain vanilla look.

Search


Subscribe

RSS is an XML-based format for syndicating website content. I have some feeds that you can subscribe to:

Elsewhere

Adactio Elsewhere has small pieces of me, loosely joined:

You can also find me scattered across these sites:

Bedroll

I had the pleasure of welcoming these people into my home:

Buy my book

Bulletproof Ajax