Re: [RDFa] ISSUE-42: the @src attribute

Mark,

the problem is that you (and Ben:-) go back a long way and when you
refer to earlier discussions then, well, I am lost because I did not
follow the RDF/A work that closely, say, 2 years ago:-( So I am not
ashamed to confess: I am a bit lost.

I tried to write down what I think I understand in what you say, and
where we are today. Bear with me if I write down the obvious, too. Let
me know if this is in line with what you guys are thinking.

- We have three attributes that create triples via, essentially,
predicates: @rel, @property, and @instanceof. (I forget about @rev for a
moment, that can be defined by inverting the roles of subject and
object.) The question is what is the object and the subject for the
triples. I see the following rules

- @about sets the _subject_ for @rel/@property/@instanceof for all
triples down the XML tree from the element where it appears until
something overrides this; this begins with these attributes appearing on
the same element as @about

- @property generates objects as literals

- @rel + @href generates a triple with @href as object, without
influencing any other triples down the XML tree

- @rel + @resource generates a triple with @resource as an object, but
the value of @resource also sets the _subject_ for triples down the XML
tree. This includes possible @instanceof and @property attributes
appearing in the same element

- @resource without a @rel behaves the same way, but no triple is
generated with @resource as an object (Mark's example of adding
information on a book falls under this, for example)

- @rel without @href and @resource is the same as @rel + resource="_:",
if we consider what I described in [1] (I still believe that is good to
have for, say, lists)

- @src (in an <img> element) or @data (in an <object>) behaves _exactly_
as @resource if triples are to be generated (ie, if there is no @rel,
@property, or @instanceof on the <img> then no triples are generated, of
course)

So is this a good overview of where we are + your proposal? I have a gut
feeling that this algorithm is (1) relatively clear to describe and
implement and (2) covers our usual cases, but both statements should be
checked. If not we should really _write down_ where we are with all
these because, frankly, I begin to loose track otherwise...

There are some corner cases to specify, mainly what happens if several
of these attributes are on the same element. For example, what is the
meaning of:

<span about="#a" href="http://p.q.r"
 resource="#eee"
 rel="a:b"
 property="c:d"
 instanceof="t:u"
 >bla</bla>

It could be:

<#a> a:b <http://p.q.r.>, <#eee>.
<#eee> a t:u; c:d "bla".

or

<#a> a:b <http://p.q.r.>, <#eee>.
<#a> a t:u; c:d "bla".

I have a slight preference for the former, but I am not 100% sure. It
has to be defined (essentially, deciding whether the rule on @about or
@resource is "stronger").

Is this somewhat clearer? Like mud?:-)

Ivan

[1]
http://lists.w3.org/Archives/Public/public-rdf-in-xhtml-tf/2007Jul/0144.html

Mark Birbeck wrote:
> Hi Ivan,
> 
>> Indeed, how do I then set the rdf:type for the _subject_?
> 
> Yes...I apologise for jumping the gun and making it sound easier than
> it is. I realised the same thing as you a few hours after I sent my
> post. In my case I was looking at a use-case that I'm really keen on,
> which goes like this:
> 
> A normal link in your blog might look like this:
> 
>  I found a good recipe in
>  <a href="http://www.amazon.com/gp/product/0091808189">
>    Canteen Cuisine
>  </a>.
> 
> This is fine as a link to a book, but from the point of view of
> improving the web :) it's not great. Ideally we want to just put an
> 'identifier' in there for the book, and then let people do whatever
> they want to with it--buy it from a bookshop, add it to their
> wish-list, search for other books by the same author, and so on.
> 
> This was quite straightforward with our old syntax, and a few months
> ago I blogged about how great it was that we could use this syntax:
> 
>  <span xmlns:bib="http://somebig.org/" about="urn:ISBN:0091808189"
> class="bib:book">
>    Canteen Cuisine
>  </span>
> 
> Which gives me this triple:
> 
>  <urn:ISBN:0091808189> rdf:type <http://somebig.org/book> .
> 
> Now, as you rightly say Ivan, the problem is that we've recently
> started to define our rdf:type shorthand as being applied to the
> _object_ of a statement. And what's more, we've even started to say
> that if there is no object one should be created. In other words, if
> we have this:
> 
>  <span instanceof="bib:book">
>    Canteen Cuisine
>  </span>
> 
> we get:
> 
>  _:span0 rdf:type <http://somebig.org/book> .
> 
> And again, as you point out, even if we add an @about:
> 
>  <span about="urn:ISBN:0091808189" instanceof="bib:book">
>    Canteen Cuisine
>  </span>
> 
> we don't get the triples I had earlier, unless we were to add some
> convoluted rules to say when @instanceof applies to the bnode and when
> to the @about.
> 
> However, if we go back for a moment the original mark-up, i.e., the
> normal way to do a link:
> 
>  <a href="http://www.amazon.com/gp/product/0091808189">
>    Canteen Cuisine
>  </a>
> 
> We see it's usual to have a resource with no @rel value--i.e. nothing
> going 'upwards' to connect this to the containing document. Also, if
> we look at the triples I want:
> 
>  <urn:ISBN:0091808189> rdf:type <http://somebig.org/book> .
> 
> you can see that they have no relationship to the containing document;
> I'm saying saying that 'x' is a book, which then allows the software
> to do all sorts of clever things with the identifier.
> 
> Given these two things, why don't we just make this the best practice:
> 
>  <span resource="urn:ISBN:0091808189" instanceof="bib:book">
>    Canteen Cuisine
>  </span>
> 
> It follows the same pattern as @href, I think.
> 
> Now, you could say that this will cause confusion over when to use
> @resource and when to use @about, but if (and it's a big 'if'...but
> not an impossible 'if') we go with the idea that Ben is suggesting, of
> resurrecting the idea that the object (if it's a resource) sets the
> subject for the context, then we would have a situation where the
> following would be perfectly legitimate:
> 
>  <span resource="urn:ISBN:0091808189" instanceof="bib:book">
>    Canteen Cuisine was written by
>    <span property="dc:creator">Marco Pierre White</span>
>  </span>
> 
> In other words, in a world where 'the object sets the subject',
> @resource would be more commonly used than @about, and I think
> probably the only reason you'd need to use @about would be if you
> wanted to put a subject and resource object on the same element.
> 
> Of course, it depends on how we go with resurrecting the 'chaining'
> approach from the original drafts, but if we do go that way, it saves
> having to have two attributes.
> 
> One last thing that people might like to ponder; we discussed on last
> week's telecon how we'd all like to see browsers that are able to make
> use of metadata to create 'smart links' to other resources. (The
> discussion was in the context of whether we needed @resource, or if
> @href was sufficient.) It strikes me that changing the above mark-up
> one more step, so that the <span> is replaced with <a>:
> 
>  <a resource="urn:ISBN:0091808189" instanceof="bib:book">
>    Canteen Cuisine
>  </a>
> 
> might be one way to do it.
> 
> In this mark-up, the author is effectively saying that they want some
> kind of interactive location to be created (denoted by the <a> tag).
> But what 'interactivity' is placed there will depend on an array of
> factors, such as the browser's capabilities, the user's preferences,
> and so on. We might end up with a personalised menu of links and
> actions such as 'add this book to my wish-list', but the main thing is
> that the author is indicating that the information the browser should
> use to create this 'menu of links' is the identifier
> 'urn:ISBN:0091808189'.
> 
> This would mean that there is also a difference between this:
> 
>  <a href="http://www.amazon.com/gp/product/0091808189">
>    Canteen Cuisine
>  </a>
> 
> which creates a direct link to a web-page, and this:
> 
>  <a resource="http://www.amazon.com/gp/product/0091808189">
>    Canteen Cuisine
>  </a>
> 
> which creates a cluster of actions and links that are relevant to that
> web-page.
> 
> That's in the 'interesting...but for the future' category, but I
> mention it because it makes me feel that we're heading in the right
> direction with some of the newer things we've decided.
> 
> Regards,
> 
> Mark
> 

-- 

Ivan Herman, W3C Semantic Web Activity Lead
URL: http://www.w3.org/People/Ivan/
PGP Key: http://www.cwi.nl/%7Eivan/AboutMe/pgpkey.html
FOAF: http://www.ivan-herman.net/foaf.rdf

Received on Wednesday, 18 July 2007 14:35:27 UTC