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

Re: [sindice-dev] how to annotate relations in tables RDFa

From: Stéphane Corlosquet <scorlosquet@gmail.com>
Date: Fri, 9 Nov 2012 17:33:34 -0500
Message-ID: <CAGR+nnHV2yr0gm=VL2-mQtca02oXsZcifAffjzqV09ML1uxCNA@mail.gmail.com>
To: ziqi zhang <ziqizhang.email@googlemail.com>
Cc: Public RDFa <public-rdfa@w3.org>
Ziqi,

You can send your RDFa questions to public-rdfa@w3.org.

On Tue, Nov 6, 2012 at 3:59 AM, ziqi zhang
<ziqizhang.email@googlemail.com>wrote:

> Hi
> perhaps a bit off-topic, but I was not able to find other dedicated
> discussion resources on RDFa or micro-formats, so I'd like to try our
> experts here :)
>
> I am learning RDFa and other relevant annotation formats, and a problem
> i've found is that it seems not possible to annotate a relation between
> table columns. For example:
>
> ------------------------
> <table border="1">
> <tr>
>   <th colspan="1">Person</th>
>   <th>Friend</th>
>   <th>Location</th>
> </tr>
> <tr>
>   <span resource="http://www.myhomepage.com/bob" typeof="foaf:Person">
>   <td>Bob</td>
>   </span>
>   <span resource="http://www.myhomepage.com/chris" typeof="foaf:Person">
>   <td>Chris</td>
>   </span>
>   <span resource="http://dbpedia.org/page/Sheffield,_Alabama">
>   <td>Sheffield</td>
>   </span>
> </span>
> </tr>
> </table>
> ------------------------
>

I'd recommend to put the span elements inside the td elements like this
  <td>
  <span resource="http://www.myhomepage.com/bob" typeof="foaf:Person">
  Bob</span>
  </td>

or even better, put the RDFa attributes in the td element (in RDFa it
doesn't matter which element you put the attributes in, as long as it makes
sense in the hierarchy of the DOM).
  <td resource="http://www.myhomepage.com/bob" typeof="foaf:Person">
  Bob
  </td>




> I have annotated each cell in the 2nd row. but how do I annotate relations
> between the cells, i.e., "bob knows chris" and "near sheffield"?
>

RDFa works best if your HTML structure is aligned with your data model. In
your case, it would work best if the HTML elements for Chris and Sheffield
were contained in the element describing Bob.

If you can't do that, you can always re-use the same identifiers that you
used in @resource and repeat some of the data:
  <td resource="http://www.myhomepage.com/bob" typeof="foaf:Person">
    Bob knows <a property="foaf:knows"
href="http://www.myhomepage.com/chris">Chris</a>
and lives in <a property="foaf:based_near" href="
http://dbpedia.org/page/Sheffield,_Alabama">Sheffield</a>
  </td>

or you can use hidden meta/link elements if you don't want to display chris
and sheffield in Bob's cell:
  <td resource="http://www.myhomepage.com/bob" typeof="foaf:Person">
    Bob
    <link property="foaf:knows" href="http://www.myhomepage.com/chris" />
    <link property="foaf:based_near" href="
http://dbpedia.org/page/Sheffield,_Alabama"/>
  </td>

You can test your markup at http://rdfa.info/play/ (make sure to wrap the
markup above in the right table and td elements for it to work in Play).

Steph.


>
> Many thanks!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Sindice Developers" group.
> To post to this group, send email to sindice-dev@googlegroups.com
> To unsubscribe from this group, send email to
> sindice-dev+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sindice-dev?hl=en
>
> http://sindice.com http://sig.ma http://www.deri.ie
>



-- 
Steph.
Received on Friday, 9 November 2012 22:34:02 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:15:09 UTC