W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > February 2012

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

From: RDF Web Applications Working Group Issue Tracker <sysbot+tracker@w3.org>
Date: Mon, 20 Feb 2012 04:07:16 +0000
Message-Id: <E1RzKWy-0004aB-T2@tibor.w3.org>
To: public-rdfa-wg@w3.org
ISSUE-131 (@href overrides @content): Specification bug where @href accidentally overrides @content [3rd LC Comments - RDFa 1.1 Core]


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>

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

(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*

In fact, I notice also that this:

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

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>


    <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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:19:55 UTC