Re: embed RDFa --> embed coolness into Yahoo search results

Ian Hickson wrote:

> More worryingly, though, I have to say that in trying to write  
> these tests
> I had an extremely confusing experience reading the RDFa  
> specification.
> When can one use href="" and when can one use resource=""?

In terms of semantics, the two are essentially the same. You would  
choose one over the other depending on whether you intended the link  
to be clickable (@href) or not (@resource).

@resource has a slightly higher priority, so when both are given on  
the same element, the @resource attribute "wins" - this is useful if  
you want to supply both a clickable link to a human-readable  
resource, and a non-clickable link to a machine-readable resource,  
which is a reasonably common pattern.

e.g.

I like <a about="#me"
    xmlns:foaf="http://xmlns.com/foaf/0.1/"
    rel="foaf:topic_interest"
    href="http://en.wikipedia.org/wiki/Cheese"
    resource="http://dbpedia.org/resource/Cheese">cheese</a>

@resource is also allowed to contain safe CURIEs, which can be useful  
for abbreviating references sometimes, but is not an especially  
important aspect of the attribute.

> Does using content="" with an absolute URL work also?

No. That would represent the literal string of the URI rather than  
the resource identified by the string. Consider the previous example:  
I am interested in the concept Cheese, I am not especially interested  
in a string which begins "aitch tee tee pee colon..."

> What are the implications of using property="" instead of rel=""?

@property contains the predicate for a literal; @rel for a resource.  
Why two different attributes? Well, firstly it enables a fairly  
common pattern:

<a xmlns:foaf="http://xmlns.com/foaf/0.1/"
    typeof="foaf:Person"
    rel="foaf:homepage"
    property="foaf:name"
    href="http://www.hixie.ch/">Ian Hickson</a>

Which would produce three RDF triples:

     [] a <http://xmlns.com/foaf/0.1/Person> ;
        <http://xmlns.com/foaf/0.1/name> "Ian Hickson" ;
        <http://xmlns.com/foaf/0.1/homepage> <http://www.hixie.ch/> .

Which in turn could be fed into a database or converted into a vCard  
to be added to an address book, etc.

> When does nesting matter and when does it not matter?

Nesting always matters in RDFa, though @about can be used to "reset"  
any nesting higher up the DOM tree.

> Does it matter whan URL the assertions are made about, or will the  
> SearchMonkey tool simply grab all the assertions from the document  
> regardless of what URL they are about? What parts are necessary and  
> what parts are optional?

Probably better answered by someone from Yahoo.

-- 
Toby A Inkster
<mailto:mail@tobyinkster.co.uk>
<http://tobyinkster.co.uk>

Received on Tuesday, 17 March 2009 19:29:14 UTC