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

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

From: Niklas Lindström <lindstream@gmail.com>
Date: Sat, 10 Nov 2012 14:27:07 +0100
Message-ID: <CADjV5jezTYA6E=+qGOk7Y7eM1nxAAVLZ0Qi4kh78jgCtOHT4ZA@mail.gmail.com>
To: Stéphane Corlosquet <scorlosquet@gmail.com>
Cc: ziqi zhang <ziqizhang.email@googlemail.com>, Public RDFa <public-rdfa@w3.org>
Hi Ziqi,

On Fri, Nov 9, 2012 at 11:33 PM, Stéphane Corlosquet
<scorlosquet@gmail.com> wrote:
> 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 also treat the entire row as about the person, with each cell
providing properties thereof. For that, I suggest this markup:

    <table border="1">
      <tr>
        <th colspan="1">Person</th>
        <th>Friend</th>
        <th>Location</th>
      </tr>
      <tr resource="http://www.myhomepage.com/bob"
          typeof="foaf:Person">
        <td property="foaf:name">Bob</td>
        <td property="foaf:knows"
            resource="http://www.myhomepage.com/chris"
            typeof="foaf:Person">
          <span property="foaf:name">Chris</span></td>
        <td property="foaf:based_near"
            resource="http://dbpedia.org/resource/Sheffield,_Alabama">
          Sheffield</td>
      </span>
      </tr>
    </table>

(Notice that I also corrected the dbpedia resource reference. The
person IRIs may also be better off as hash identifiers (to not
conflate them with their homepages), but since they're just examples I
leave them be.)

Best regards,
Niklas


> 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 Saturday, 10 November 2012 13:28:05 UTC

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