Every user has a profile page and a list of friends. Following some of the guides I've seen, I've added hCard information for the user's profile, plus hCard+XFN for the friends list. Since it was so easy, I went hog-wild and started adding hCards everywhere a user's avatar was displayed. So, every comment, every recent-update, you-name-it.
(Note: It's not there as of 2008-04-18 because I haven't deployed the code to the live server yet. Still some bugs...)
Now the problem I'm dealing with is that I have possibly dozens of hCards on the profile page (user + friends + recent updates + comments). If a spider finds the page and looks for hCards, there is no (easy) way to tell that the profile belongs to user A and not A's friends. To combat that, I've added a self-referential link with a rel="me" on it. It looks like this:
(Note: view e-mail source if the previous text doesn't display an entire a-tag.)
Still, this uses XFN which is outside the realm of hCard and that seems a little iffy to me.
Am I missing something? Has anyone else dealt with this problem? I noticed that LiveJournal only has an hCard for the actual user on their profile page, and uses XFN without hCard for the friends. Is this a better idea?
> Now the problem I'm dealing with is that I have possibly dozens of > hCards on the profile page (user + friends + recent updates + comments). > If a spider finds the page and looks for hCards, there is no (easy) way > to tell that the profile belongs to user A and not A's friends.
--- there is a wiki page somewhere (which i can't find at the moment), but there are a few options. HTML has the <address> element to describe the contact info of the page owner. There are issues with <address> due to it being an inline element, and not accepting block-level inside it.
Also, the hResume microformat makes use of class="contact" to help describe which hcard to use. I would recommend using one of those options and seeing if that works in your markup.
If i or someone finds that wiki page, please add your thoughts and experiences to it as well.
Brian Suda wrote: > there is a wiki page somewhere (which i can't find at the moment), > but there are a few options. HTML has the <address> element to > describe the contact info of the page owner.
No - <address> provides contact information for the page. The owner of the page and the correct person to contact regarding the page may well differ. The page that you're thinking of is the representative- hcard page, which addresses (no pun intended) this very issue amongst others.
Also perhaps relevant is the page I threw together over the weekend on mapping XFN to FOAF, which covers more than just FOAF really: it's a general purpose guide on how to interpret the interactions between different hCards and XFN on the same page. Not so much from an page authoring perspective, but rather from a parser development point of view, to make sure that people writing parsers don't misinterpret pages like the ones described in this thread.
On Mon, Apr 14, 2008 at 3:04 PM, Micah Wedemeyer <mi...@aisleten.com> wrote: > Am I missing something? Has anyone else dealt with this problem? I > noticed that LiveJournal only has an hCard for the actual user on their > profile page, and uses XFN without hCard for the friends. Is this a > better idea?
On Mon, 2008-04-14 at 17:22 +0100, Toby A Inkster wrote: > Also perhaps relevant is the page I threw together over the weekend > on mapping XFN to FOAF, which covers more than just FOAF really: > it's > a general purpose guide on how to interpret the interactions between > different hCards and XFN on the same page. [...] > http://microformats.org/wiki/xfn-to-foaf
[...]
Nicely timed Toby :)
I have a new test going on my Dev site that does just about what you suggest and converts XFN+hCard via XSLT to produce a FoaF file called for want of a word xFoaF. it Is very much inspired by Dan Connolly's grokXFN.xsl
The entire source code PHP and XSLT is also available for download on the dev site.
to answer the question "multiple hCards on a user's profile page - how can I mark one as the actual user?" I would mark up just one hcard containing rel="me" which would represent the actual user and the rest with rel="contact" or whatever XFN value is suitable.
Martin McEvoy wrote: > I have a new test going on my Dev site that does just about what you > suggest and converts XFN+hCard via XSLT to produce a FoaF file called > for want of a word xFoaF. > example output using http://www.tantek.com/#hcard as the > transformation
Mostly looks good, but I'd suggest that you seem to have some of the relationships backwards. For example, Tantek has the following on his page:
I would suggest that the FOAF should be the other way around: Tantek apprenticeTo Julie; not Tantek mentorOf Julie. (Yes, the terms "mentor" and "apprentice" seem a bit odd, but they're about the closest terms that the FOAF relationships extension has to "muse".)
Also, you needlessly output multiple foaf:knows for each person.
On Tue, 2008-04-15 at 08:31 +0100, Toby A Inkster wrote: > Martin McEvoy wrote:
> > I have a new test going on my Dev site that does just about what you > > suggest and converts XFN+hCard via XSLT to produce a FoaF file called > > for want of a word xFoaF.
> I would suggest that the FOAF should be the other way around: Tantek > apprenticeTo Julie; not Tantek mentorOf Julie. (Yes, the terms > "mentor" and "apprentice" seem a bit odd, but they're about the > closest terms that the FOAF relationships extension has to "muse".)
Thanks a lot for checking the output over for me, I have removed the relationship vocab completely as it wasnt converting very well in favour of using the XFN vocab itself.
> Also, you needlessly output multiple foaf:knows for each person.
Thanks didn't catch that Fixed now though I have also fixed parsing multiple instances of the same person a much better output altogether.