[Proposal] ISSUE-42: How does RDFa deal with @src

The first point is that I think we should change the title of this
issue to be more specific:

  "How does RDFa deal with img/@src"

This is because @src is not allowed 'everywhere' in HTML and XHTML 1.x
in the same way that it is in XHTML 2, so we don't need to look at it
generically. (I.e., there's probably not a lot that we're going to
find in common between <script> and <img>.)

However, if people think changing an issue title mid-stream is wrong,
then the other alternative is to mark issue 42 as one for the
future--when we get to XHTML 2--and open a new issue for img/@src.


INTERPRETATION OF HTML/XHTML

In keeping with the idea that the host language for RDFa may provide
semantics independent of RDFa, then the first step in trying to
resolve ISSUE 42 would be to ask what metadata we could derive form a
'vanilla' HTML document.

Given this mark-up:

  <img src="s" alt="alt" longdesc="desc">

we could say that we have an image, a label for the image, and a description:

  <>
    xh:img <s> .

  <s>
      rdfs:label "alt";
      dc:description <desc> .

NOTE: @longdesc holds a URI, not text.

NOTE: In all of the following examples I include a value for @alt
since that is best practice in HTML/XHTML mark-up for accessibility
purposes. @longdesc however, is not regarded in the same way. So even
though it's irrelevant from an RDFa point of view, I think we should
keep that in any resulting documentation and samples.

A possible additional triple would be to add a 'type' of
dcmitype:Image. I'm quite in favour of this, but some may think it
best left to an inference layer. Comments please.


ADDING RDFA

Once we've agreed on the semantic interpretations of existing mark-up
patterns, we then need to look at how RDFa can be used to enhance
them.

SPECIFYING A PREDICATE

The first use-case would be to use the image as the value of a
predicate, for example in a FOAF description. The most obvious way to
do this would be with @rel:

  <div about="#me" class="foaf:Person">
    <span property="foaf:name">Mark Birbeck</span>
    <img rel="foaf:img" src="mark-birbeck.jpg" alt="Mugshot of Mark Birbeck" />
  </div>

which would yield:

  <>
    xh:img  <mark-birbeck.jpg> .

  <#me>
    a foaf:Person;
    foaf:name "Mark Birbeck";
    foaf:img <mark-birbeck.jpg> .

  <mark-birbeck.jpg>
      rdfs:label "Mugshot of Mark Birbeck" .

NOTE: You could argue that the subject of the first triple is <#me>,
rather than <>. In this context we can decide however we want it to
be. Since the triple is mainly of use to systems that are trying to
understand the structure of the document, as opposed to understanding
the embedded semantics I prefer the approach I've put here, but it's
not a big deal to change it.


There are also situations where @rev would be useful. For example,
some search results on Shuttr ;) coiuld look like this:

  <div about="#me" class="foaf:Person">
    Some pictures in which <span property="foaf:name">Mark
Birbeck</span> appears:
    <img rev="foaf:depicts" src="xtech-2007-lunch.jpg" alt="People
having lunch at XTech 2007" />
    <img rev="foaf:depicts" src="www-2007-lunch.jpg" alt="People
having lunch at WWW 2007" />
    <img rev="foaf:depicts" src="tripping-over.jpg" alt="Some idiot
falling over" />
  </div>

SPECIFYING TYPE

Generally it is better to establish a relationship between an image
and something else, by using a predicate like foaf:depiction,
foaf:img, foaf:depicts, etc.. Then the fact that we are dealing with a
foaf:Image falls out easily by inreference. However, there may be
situations where all that is required is to indicate the _type_ of the
resource, without the resource being in a relationship with anything
else. If there are such use cases, then this could be done with
@class, but there is a problem, as outlined below.

NOTE: This mark-up assumes that @class gives us rdf:type. Since this
is not a resolved issue then the exact mechanism used to achieve the
following might need to change to be drawn into line with the other
resolution.

At first sight the following seems legitimate:

  <img src="a-spider.jpg" alt="A picture of a spider" class="foaf:Image" />

However, what if we extend it by placing @about on the element. Using
indentation to show ownership, we could interpret the addition of
@about as either this:

  <img
    about="#me"
    src="a-spider.jpg"
      alt="A picture of a spider"
      class="foaf:Image"
  />

or this:

  <img
    about="#me"
      class="foaf:Image"
    src="a-spider.jpg"
      alt="A picture of a spider"
  />

The second example seems wrong, but only because we know the meaning
of "foaf:Image"; what if we had the following mark-up instead:

  <img
    about="#me"
      class="foaf:Person"
    rel="foaf:depiction"
      src="a-spider.jpg"
        alt="A picture of a spider"
  />

It now seems perfectly natural to attach @class to the @about.

So we have an issue, and that is, what does @class mean on an HTML image?

My feeling is that we should 'hard-code' the rule that @class applies
to @src, even in the presence of an @about.

Regards,

Mark

-- 
  Mark Birbeck, formsPlayer

  mark.birbeck@x-port.net | +44 (0) 20 7689 9232
  http://www.formsPlayer.com | http://internet-apps.blogspot.com

  standards. innovation.

Received on Thursday, 21 June 2007 11:53:21 UTC