Re: Confused by combining @href and @content

On Feb 17, 2012, at 7:54 AM, Niklas Lindström wrote:

> Hi all,
> 
> 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?

It seems reasonable that one takes precedence over the other, but not necessarily that @href becomes a subject in this context.

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

IMO, this is a bug in the spec. It would be useful to create a few test cases that specify the expected behavior. Hopefully, this can be considered an editorial fix, since I don't think that either of those behaviors is intended.

> 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).

I think the @src, @href and the other object-valued properties should only become subjects in sub-elements, not for other properties within the same element.

Gregg

> Thoughts?
> 
> Best regards,
> Niklas
> 

Received on Friday, 17 February 2012 18:50:04 UTC