vote up 1 vote down
star
1

I think one of the sweet points of RDFa should be in marking up tabular data and then enabling sorting, grouping and simple numeric analysis such as summation over the table using Javascript.

Does anyone have any pointers or examples of this being done?

As an example, how could you mark up the table from Wikipedia's List of tallest structures? (here are the first few rows slightly edited for clarity)

<table class="wikitable">
  <tr>
    <th>Name</th>
    <th colspan="2">Pinnacle height</th>
    <th>Year</th>
    <th>Structural type</th>
    <th>Main use</th>
    <th>Country</th>
    <th>Town</th>
    <th>Remarks</th>
    <th>Coordinates</th>
  </tr>
  <tr>
    <td><a href="/wiki/Burj_Dubai" title="Burj Dubai">Burj Dubai</a></td>
    <td>2,684 feet</td>
    <td>818 m</td>
    <td>2009</td>
    <td>Skyscraper</td>
    <td>Office, hotel, residential</td>
    <td><a href="/wiki/United_Arab_Emirates" title="United Arab Emirates">United Arab Emirates</a></td>
    <td><a href="/wiki/Dubai" title="Dubai">Dubai</a></td>
    <td>Topped-out on 17 January 2009</td>
    <td><span class="latitude">25°11′50.0″N</span> <span class="longitude">55°16′26.6″E</span></td>
  </tr>
  <tr>
    <td><i><a href="/wiki/Warsaw_Radio_Mast" title="Warsaw Radio Mast" class="mw-redirect">Warsaw Radio Mast</a></i></td>
    <td>2,121 feet</td>
    <td>646.4 m</td>
    <td>1974</td>
    <td>Guyed mast</td>
    <td>LF-transmission</td>
    <td><a href="/wiki/Poland" title="Poland">Poland</a></td>
    <td><a href="/wiki/G%C4%85bin" title="Gąbin">Gąbin</a>-<a href="/wiki/Konstantyn%C3%B3w_(P%C5%82ock_County)" title="Konstantynów (Płock County)" class="mw-redirect">Konstantynów</a>, <a href="/wiki/Masovian_Voivodeship" title="Masovian Voivodeship">Masovian Voivodeship</a></td>
    <td>insulated; collapsed on August 8</td>
    <td><span class="latitude">52°22′3.44″N</span> <span class="longitude">19°48′8.51″E</span></td>
  </tr>
</table>
flag
I'm not sure I see how leveraging RDFa to annotate a table enables better or more robust JavaScript interaction. I see how it makes the table more understandable by machines parsing the document content. Can you explain what type of value you think that javascript will be able to leverage beyond what can already be done with the myriad of sortable/orderable javascript table solutions (jQuery, prototype, mootools, etc...) – spoon16 Nov 7 at 8:26

4 Answers

vote up 1 vote down

Hi Ian

I wrote a blog post on this topic a couple of months back http://www.webofdatablog.com/articles/2009/08/25/publishing-table-based-data-as-rdfa I was focusing on how to do the markup - I hadn't thought of your suggestion of using Javascript to allow operations on the data.

From comments on that post and some further reading, I reckon that my N-ary relations approach is essentially the best bet, but using SCOVO would be an improvement over my initial experiment.

My example was looking at time-varying data - as other responses to this question have shown, it probably doesn't need to be that complicated in the OP's example, as properties like the height and location of each tower could reasonably be taken to be constant in time.

link|flag
Very nice post (how did I miss it?) – Ian Davis Nov 6 at 11:52
vote up 0 vote down

I would probably do something along those lines (of course you should use another vocabulary than ex):

<tr about="http://dbpedia.org/resource/Burj_Dubai">
  <td rel="ex:seeAlso" resource="/wiki/Burj_Dubai" ><a href="/wiki/Burj_Dubai" title="Burj Dubai">Burj Dubai</a></td>
  <td property="ex:heightFeet">2,684 feet</td>
  <td property="ex:heightMeter">818 m</td>
  <td property="ex:yearBuilt">2009</td>
  ...
</tr>
link|flag
vote up 0 vote down

You can use genoname ontology(www.geonames.org/ontology/#) to describe latitudes, longitudes and altitudes etc. using ''wgs84_pos:lat'', ''wgs84_pos:long'' and ''wgs84_pos:alt'' etc. Then RDFQuery(code.google.com/p/rdfquery/) can be employed to glean RDFa from your tables and this will be compatible with your later data processing using Javascript.

link|flag
vote up 0 vote down

Starting point below. It's marked community wiki, so please contribute.

In XHTML+RDFa:

  • add the @about attribute to indicate the topic, which is for each row, so on <tr>
  • namespace prefix dc -> Dublin Core
  • does anyone know a common ontology for dimensions? height below?
  • using @content to give machine readable version of the value
  • using the geonames.org ontology (wgs84_pos prefix) as suggested in another comment
<tr about="http://en.wikipedia.org/wiki/Burj_Dubai">
  <td><a href="/wiki/Burj_Dubai" rel="dc:title"
         title="Burj Dubai">Burj Dubai</a></td>
  <td><span property="ex:height" content="2684" 
            datatype="xsd:integer">2,684 feet</span></td>
  <td>
    <span property="wgs84_pos:lat" content="25.19722"
             class="latitude">25°11′50.0″N</span>
    <span property="wgs84_pos:long" content="55.27406"
             class="longitude">55°16′26.6″E</span>
  </td>
</tr>
link|flag

Your Answer

Get an OpenID
or

Not the answer you're looking for? Browse other questions tagged or ask your own question.