W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > November 2011

Non-serious comparison of RDFa 1.1 and 1.0...

From: Ivan Herman <ivan@w3.org>
Date: Sat, 5 Nov 2011 12:51:38 +0100
Cc: Gregg Kellogg <gregg@kellogg-assoc.com>
To: W3C RDFWA WG <public-rdfa-wg@w3.org>
Message-Id: <D19E42B3-1A70-4849-945F-EA2F0CE13013@w3.org>
I spent some time today to look at my foaf file (copy of in [1]), which made a heavy use of all kinds of features, and convert it into RDFa 1.1. Well: RDFa 1.1+, ie, I rely on the features that are described in [3]. This also means that my 1.1 version may actually be wrong, because I do not have a reliable implementation of the whole thing to test it with.

I give some of my experiences below, the good, the bad, and the ugly, so to say. _All in all_ I think RDFa 1.1 _is_ simpler although at the level of my foaf file (which is complex) the difference is difficult to judge; the question is how much work it would have taken to write the whole thing in 1.1 in the first place. Ie, we should not draw any major conclusion here, but it may be interesting nevertheless...

My conclusions for the current discussion vs. schema.org:

- @rel is rarely needed, but it is essential in some cases
- I wonder whether @resource should not be allowed in RDFa 1.1. It is like @rel: rarely needed, but is essential in some cases


Simpler in RDFa 1.1+
--------------------

- The foaf terms dominate, of course, ie, using a vocab to foaf is natural and helpful in the file. Not hugely (writing foaf: is not such a big deal), but good nevertheless.

- Although it may not be 100% good practice, the fact that the initial namespace declarations are smaller (ie, making use of the initial context) _is_ a plus for me

- The change of the @src usage was a real plus. In RDFa 1.0 I had

<div about="http://www.ivan-herman.net/foaf#me" ...>
   ...
   <img rev="foaf:img google:photo" 
        resource="http://www.ivan-herman.net/foaf#me" 
        src="http://www.ivan-herman.net/Images/me2003-small.png" />
   ...
</div>

Note the duplication of the URI, and the usage of @rev (the only place of using @rev in the file!). (Putting a rel into the div would not have worked, that div has lots more...) This, in RDFa 1.1 has become:

<div about="http://www.ivan-herman.net/foaf#me" ...>
   ...
   <img property="img v:photo" 
        src="http://www.ivan-herman.net/Images/me2003-small.png" />
   ...
</div>

which is much more natural.

- The proposed rules on @typeof and related chaining in [3] make some extra nesting unnecessary. For example:

<span rel="sioc:administrator_of">
   <span typeof="sioc:Space sioc:WebLog">
      <span property="rdfs:label">Semantic Web Activity Blog at W3C</span> which can ....
   </span>
</span>

now becomes 

<span property="sioc:administrator_of" typeof="sioc:Space sioc:WebLog">
   <span property="rdfs:label">Semantic Web Activity Blog at W3C</span> which can ....</span>
</span>

@rel vs. @property (eg, which patterns still require @rel?)
-----------------------------------------------------------

For the _vast_ majority of the cases @property simply works. Which is a plus in my view; usage of @rel is restricted to cases when some extra feature is really needed. Some patterns:

- usage of hanging rels, which is essentially a way of avoiding repeating an attribute:

<div about="http://www.ivan-herman.net/foaf#me" ...>
  ...
  <ul rel="foaf:holdsAccount">
    <li>
      <a href="http://www.dopplr.com/traveller/IvanHerman" typeof="foaf:OnlineAccount">
        <span rel="foaf:accountServiceHomepage" href="http://www.dopplr.com">dopplr</span>
        <span class="forRDFOnly" property="foaf:accountName">IvanHerman</span>
      </a>
    </li>
    ...
</div>

This has virtually not changed in the RDFa 1.1 version:

<div about="http://www.ivan-herman.net/foaf#me" ...>
  ...
  <ul rel="holdsAccount">
    <li>
       <a href="http://www.dopplr.com/traveller/IvanHerman" typeof="OnlineAccount">
          <span property="accountServiceHomepage" href="http://www.dopplr.com">dopplr</span>
          <span class="forRDFOnly" property="foaf:accountName">IvanHerman</span>
       </a>
   </li>
   ...
</div>

- Forcing a chaining explicitly, eg, 

<a rel="foaf:schoolHomepage" href="http://www.elte.hu/"><span property="dc:title">Eötvös Loránd University of Budapest</span></a>

It is important that the internal property is bound to http://www.elte.hu. Ie, @property cannot replace @rel in this case.

Of course, an explicit @about is possible in the internal span, repeating the URI. But that is still ugly. 

- In some cases, a slight reorganization was necessary to 'get rid' of @rel. Eg, I had 

<span rel="foaf:holdsAccount">
  <span id="SWActivityBlogAccount" about="#SWActivityBlogAccount" typeof="sioc:User" property="foaf:accountName" content="ivan">
	  I am the administrator of the
	   <span rel="sioc:administrator_of" ...>....</span> 		  			  
  </span>
</span>

this may become:

<span property="holdsAccount" resource="#SWActivityBlogAccount" typeof="sioc:User">
  <span id="SWActivityBlogAccount" property="accountName" content="ivan">
	  I am the administrator of the
	   <span property="sioc:administrator_of" ...>.....</span> 		  			  
  </span>
</span>


Backward incompatibilities, and extra complication with RDFa 1.1
----------------------------------------------------------------

When conflating @property and other features problems may occur. That was to be expected. For example:

<span rel="foaf:interest">
   <span resource="http://dbpedia.org/resource/Literature" property="dc:title">literature</span>
   ...
</span>

in RDFa 1.0, gives me the 

  <> foaf:interest <http://dbpedia.org/resource/Literature> .
  <http://dbpedia.org/resource/Literature> dc:title "literature" .
  
in RDFa 1.1+ this gives me, hm..., I am not even sure. I think this is something like

  <> foaf:interest [
    dc:title <http://dbpedia.org/resource/Literature> .
  ]

To get the same triplets, what I have to do is:

<span rel="foaf:interest">
  <span about="http://dbpedia.org/about/Literature" property="dc:title">literature</span>
</span>

Note, however, that my RDFa 1.0 encoding, though correct is not very 'nice', the RDFa 1.1 is much more natural....

In the same area, actually, there is an extra complication. In RDFa 1.0 I had

<span rel="foaf:interest">
   <a resource="http://dbpedia.org/resource/Semantic_Web" 
      href="http://en.wikipedia.org/wiki/Semantic_Web" property="dc:title">Semantic Web</a>
   ...
</span>

The change, in this case is not only a change to @about, but, also, an extra escape from @href is necessary:

<span rel="foaf:interest">
   <a about="http://dbpedia.org/resource/Semantic_Web" 
      href="http://en.wikipedia.org/wiki/Semantic_Web" property="dc:title" datatype="">Semantic Web</a>
   ...
</span>

That is it for now...

Cheers

Ivan

[1] http://www.w3.org/2011/11/foaf-ivan-rdfa10.html
[2] http://www.w3.org/2011/11/foaf-ivan-rdfa11.html
[3] http://www.w3.org/2010/02/rdfa/wiki/PropertyAndTypeof

----
Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
PGP Key: http://www.ivan-herman.net/pgpkey.html
FOAF: http://www.ivan-herman.net/foaf.rdf







Received on Saturday, 5 November 2011 11:49:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 04:55:18 GMT