[uf-discuss] Re: XFN is getting smoked by FOAF

Tom Morris bbtommorris at gmail.com
Tue Mar 11 15:22:21 PST 2008


On Tue, Mar 11, 2008 at 10:53 PM, Premasagar Rose <p at premasagar.com> wrote:
> Toby A Inkster wrote:
>  > Going the other way around:
>  >
>  >     <p about="#alice">Alice <a rel="foaf:knows friend"
>  > href="#bob">Bob</a>.</p>
>  >     <p about="#bob">Bob <a rel="foaf:knows friend"
>  > href="#alice">Alice</a>.</p>
>
>  Now that's something I'd never thought of...
>

This is using the RDFa syntax. Some people like RDFa syntax, but I
think that it can often lead to repetition. In this scenario, you are
using XFN rel values to map to foaf:knows. It's probably a better idea
to simply use the XFN syntax, and then use a GRDDL profile to map that
to the underlying RDF semantics.

<p class="person" id="alice">Alice knows <a href="#bob" rel="friend">Bob</a></p>
<p class="person" id="bob">Bob knows <a href="#alice" rel="friend">Alice</a></p>

is a more natural HTML syntax* (you could go further and replace the
'person' class with an hCard (although you would then have to add
extra child elements to these elements to make them into valid
hCards). You then put together a GRDDL document which translates the
HTML above into the relevant RDF/XML syntax.

* It is also representable in HTML 4 and XHTML 1.0. Only a limited
subset of RDFa can be represented in HTML 4 or XHTML 1.0 - while the
more expressive parts require you use the W3C's RDFa+XHTML 1.1 DTD if
you want it to validate.

Anyway, that's just my opinion and not strictly on-topic for
microformats-discuss. Read the GRDDL Primer at:
http://www.w3.org/TR/grddl-primer/
Ask in #swig on irc.freenode.net or e-mail me off-list if you want to know more.

-- 
Tom Morris
http://tommorris.org/


More information about the microformats-discuss mailing list