[foaf-dev] Drupal user profiles in RDFa

Toby Inkster tai at g5n.co.uk
Mon Oct 12 13:42:50 CEST 2009

On 11 Oct 2009, at 16:09, Stephane Corlosquet wrote:

> We have 2 options to add RDFa to this link which both return the  
> same RDF data:
> <a href="/user/1" rel="sioc:has_creator foaf:maker" title="View  
> user profile." class="username"><span resource="/user/1"  
> typeof="sioc:User" property="foaf:name">Henry</span></a>
> or
> <span rel="sioc:has_creator foaf:maker"><a href="/d7sprint/user/1"  
> typeof="sioc:User" property="foaf:name" title="View user profile."  
> class="username">Henry</a></span></span>

foaf:maker is probably not what you want. foaf:maker's range is  
foaf:Agent, whereas a sioc:User is not a foaf:Agent, it's an account  
that a foaf:Agent holds.

> Question for the RDFa ninjas reading this: is there a way to embed  
> all this information without adding a span tag either inside or  
> outside the a existing a tag.

<a href="/user/1" title="View user profile."
    about="/user/1" typeof="sioc:User"
    rev="sioc:has_creator" resource=""

>   2.1 Use a markup similar to the one above, but the cons is that  
> the user profile URI will not be dereferencable (and hereby  
> breaking one of the Linked Data principles). It will return a 403  
> Access denied.
> <span rel="sioc:has_creator foaf:maker" class="username"><span  
> resource="/user/1" typeof="sioc:User" property="foaf:name">Henry</ 
> span></span>

I think this is the right thing to do.

> 3. In the case of a non registered user leaving a comment, Drupal  
> offers to leave her name, homepage and email address (though the  
> email address is not displayed for privacy reasons). The default  
> markup is:
> <a href="http://openspring.net/" rel="nofollow"  
> class="username">Stephane Corlosquet (not verified)</a>
> We don't have a user profile URI here, but a homepage which is  
> usually linked to a foaf:Person. Here we have multiple options  
> again to describe the author of a comment. I'm not sure we should  
> directly link a page to a foaf:Person, should we?. Do we have to  
> generate a foaf:OnlineAccount /sioc:User URI here based on the  
> homepage by adding #user to it? use a bnode? opinions?

Assuming that you're still wanting to avoid that <span> element, the  
following would be reasonably consistent with the markup for people  
who have accounts:

<a href="http://openspring.net/"
    about="_:bnode_001" typeof="sioc:User"
    rev="sioc:has_creator" resource=""
    property="foaf:name" content="Stephane Corlosquet"
    >Stephane Corlosquet (not verified)</a>

This does *not* use the address <http://openspring.net/> in any  
triples though. It's ignored. If we include that <span>, then we can  
use the openspring.net address:

<span rel="sioc:has_creator">
   <a typeof="sioc:User"
      rel="foaf:page" href="http://openspring.net/"
      property="foaf:name" content="Stephane Corlosquet"
      >Stephane Corlosquet (not verified)</a>

(Note that I've used foaf:page instead of foaf:homepage because the  
latter is a very strong assertion, being an IFP. Stick with foaf:page  
for user-submitted content, otherwise OWL inference on your data will  
start to throw up some very strange conclusions.)

Toby A Inkster
<mailto:mail at tobyinkster.co.uk>

More information about the foaf-dev mailing list