W3C home > Mailing lists > Public > public-rdf-in-xhtml-tf@w3.org > May 2007

Re: comment on using RDFa

From: Peter Mika <pmika@yahoo-inc.com>
Date: Tue, 29 May 2007 11:29:45 +0200
Message-ID: <465BF289.8040109@yahoo-inc.com>
To: mark.birbeck@x-port.net
CC: public-rdf-in-xhtml-tf@w3.org

Hi Mark,

Thanks for the detailed response! I now feel I know a lot more about 
RDFa.... the reason I missed @rev is that it is not in the Primer yet.

Some further responses:
>
> Unfortunately, with microformats you have to define the rules of
> mixing for each additional vocabulary, so it quickly gets out of hand.
>
What I meant is that I can use hCard and hCalendar in a single page and 
the XSLT for the two should still extract the proper information. In 
this sense, they don't interfere with each other. (MFs can interfere 
when there are name clashes, and of course  I realize that RDFa is a 
significant step forward in this sense. Also, no more writing XSLT  
stylesheets per microformat... yuhuu!)
>
>> Note that from this code the bookmarklet still produces a number of
>> nonsensical triples involving the non-RDFa classnames.
>
> As I say, I'm almost certain that behaviour is incorrect, but we'll 
> check.

Great!

>
>> Comment #2
>> ~~~~~~~~~
>>
>
> <html ...>
>  <head>
>    <link about="#s" rel="rdf:type" href="foaf:Person" />
>  </head>
>  <body>
>    <span about="#s">
>      <span property="foaf:name">Peter Mika</span>
>    </span>
>  </body>
> </html>
>
> The triples for this should be (namespaces and datatypes omitted for 
> brevity):
>
>  <#s> rdf:type foaf:Person .
>  <#s> foaf:name "Peter Mika" .
>
> As you can see, it generates the same triples that you want, but at
> the point of parsing foaf:name there is nothing to indicate 'we are
> now in foaf:Person parsing mode' (and it's a key design goal of RDFa
> that there doesn't need to be).
I do think there should be a locality principle... It seems logical to 
me that related information (attributes of the same object) will need to 
appear close to each other on an HTML page and I think this locality 
should dictate the placement of the markup (content first, markup 
second).  In this view, the above is not a logical markup.

>
>      <span
>       about="...#peter_mika"
>        property="foaf:name"
>        rev="swrc:author" href="...#mika06jws"
>        class="foaf:Person"
>      >Peter Mika</span>
>    </span>
>
This should work, I'll check. In this case, how would you add a second 
attribute of the same person?

> I'm not sure if this is what you are trying to achieve, but since I'd
> like to try to show the whole mark-up--including the
> microformats--I've made the following assumptions:
>
>  * that you have a list of publications;
>
>  * that each publication could have multiple authors;
>
>  * that you want to indicate the rdf:type of both the publications and
>    the authors;
>
>  * that you want to include the microformats for both;
>
>  * that non-prefixed class names should be ignored by RDFa parsers;
>
This is exactly the case.

>
>
>  <!-- Publications first -->
>  <ul>
>    <li
>     xml:base="http://www.cs.vu.nl/~pmika/publications.bib"
>
>     about="#mika06jws"
>       class="swrc:Article hbib article"
>    >
>      <ul>
>        <li>
>          <a rel="swrc:author" href="#peter_mika" class="author">
>            Peter Mika
>          </a>
>        </li>
>      </ul><!-- authors list -->
>    </li>
>
>    <li
>     about="#mikadoe01xyz"
>       class="swrc:Article hbib article"
>    >
>      <ul>
>        <li>
>          <a rel="swrc:author" href="#peter_mika" class="author">
>            Peter Mika
>          </a>
>        </li>
>        <li>
>          <a rel="swrc:author" href="#john_doe" class="author">
>            John Doe
>          </a>
>        </li>
>      </ul><!-- authors list -->
>    </li>
>    <!-- Next publication would come here -->
>  </ul><!-- publications list -->
>
>  <!-- Authors next -->
>  <span id="peter_mika" about="#peter_mika" class="foaf:Person vcard">
>    <span property="foaf:name" class="fn">Peter Mika</span>
>  </span>
>  <span id="john_doe" about="#john_doe" class="foaf:Person vcard">
>    <span property="foaf:name" class="fn">John Doe</span>
>  </span>
>  <!-- Next author would come here -->
>
Again, I don't like this solution as much. It looses locality, e.g. if 
someone copy-pastes only the bit about the publication, he/she looses 
metadata about the author... further, I I would now have to hide somehow 
the author's list at the end (to prevent it from being displayed).


> Looking at your original mark-up, I think that the only thing you were
> missing was the use of @rev. And given that you were hampered by the
> 'non-prefixed class name' problem, that's pretty good going!
Thanks for all the help! Actually, development felt a bit like 
experimentation, running the bookmarklet and tweaking the code (an XSLT 
stylesheet) until I got the triples I wanted :) It's not too bad, but if 
I can give one more advice: try to think of various ways people will 
abuse RDFa markup... and test the tools against these test cases. I'm 
saying this because I've recently looked at some microformat data 
(vCard) and my quick statistics show that even after tidying only about 
29% of manually authored hCard markup in HTML pages results in a correct 
vCard. And hCard is still easy compared to RDFa...

All the best with finishing up the work,

Peter
Received on Tuesday, 29 May 2007 09:30:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:15:05 GMT