ISSUE-131 (@href overrides @content): Specification bug where @href accidentally overrides @content [3rd LC Comments - RDFa 1.1 Core]

ISSUE-131 (@href overrides @content): Specification bug where @href accidentally overrides @content [3rd LC Comments - RDFa 1.1 Core]

http://www.w3.org/2010/02/rdfa/track/issues/131

Raised by: Niklas Lindström
On product: 3rd LC Comments - RDFa 1.1 Core

I've come across something surprising when helping some people apply
RDFa 1.1 recently. At first I thought it was a bug in a distiller, but
this behaviour is actually defined in "7.5 Sequence", step 5.

Given this markup:

    <div vocab="http://schema.org/" about="#me">
        <a property="email" href="mailto:peter@peterkrantz.se"
           content="peter@peterkrantz.se">Send me an e-mail</a>
    </div>

I was expecting:

    <#me> schema:email "peter@peterkrantz@se" .

But the actual result is:

    <mailto:peter@peterkrantz.se> schema:email "peter@peterkrantz.se" .

Meaning not only that @href has precedence over @content, but, more
importantly, that @href suddenly behaves like @about within the same
element! While resource attributes of course set the subject for
*nested* RDFa, I thought that we didn't want them to swap roles like
this?

(Notice that my point here is this swapping behaviour. (And that I
expected @content to overrule @href, given that they both represent
object values.) To get the expected results I can of course e.g. add
an empty @rel, or wrap the link in a span and put the @property there
instead. Or override @href with either @resource="#me" *or*
@about="#me".)

In fact, I notice also that this:

    <a property="email" href="mailto:peter@peterkrantz.se"
       datatype="">peter@peterkrantz.se</a>

Produces this:

    <mailto:peter@peterkrantz.se> schema:email <mailto:peter@peterkrantz.se> .

That is, merely adding @datatype="" makes @href supply both subject and object!

For context, compare the above to:

    <span property="email" content="peter@peterkrantz.se"></span>

And:

    <a property="email"
        href="mailto:peter@peterkrantz.se">Send me an e-mail</a>

Where @content and @href clearly are objects. I wonder if this is a
bug in the spec, or intended behaviour?

As I recall, we *did* discuss behaviour like this when we changed @src
into a resource attribute. That is, while @src behaves like a resource
attribute (supplying the object) here:

    <img property="image" src="images/peter_krantz.jpg" />

It could behave like @about (i.e. supply the subject) here:

    <img property="rdfs:label" src="images/apple.jpg" content="An apple" />

And it actually does! But I thought that we decided against it, given
that it would be confusing in general (as illustrated above).

Received on Monday, 20 February 2012 04:07:18 UTC