4
3

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>

asked 06 Nov '09, 11:29

Ian%20Davis's gravatar image

Ian Davis
2.3k1414
accept rate: 13%

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...)

(07 Nov '09, 08:26) spoon16 spoon16's gravatar image

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

answered 06 Nov '09, 11:48

billroberts's gravatar image

billroberts
81639
accept rate: 47%

edited 06 Nov '09, 12:13

Very nice post (how did I miss it?)

(06 Nov '09, 11:52) Ian Davis Ian%20Davis's gravatar image

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

answered 06 Nov '09, 12:01

user-142%20%28google%29's gravatar image

user-142 (go...
211
accept rate: 0%

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>
  • does anyone know a common ontology for dimensions? height below?
  • using @content to give machine readable version of the value
<table xmlns:ex="http://example.com/"
       xmlns:foaf="http://xmlns.com/foaf/0.1/"
       xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema#">

<tr about="http://dbpedia.org/resource/Burj_Dubai">
  <td><a rel="foaf:page" href="http://en.wikipedia.org/wiki/Burj_Dubai" 
         property="foaf:name">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
This answer is marked "community wiki".

answered 06 Nov '09, 12:03

Egon%20Willighagen's gravatar image

Egon Willigh...
1.5k513
accept rate: 12%

edited 11 Oct '10, 15:31

tobyink's gravatar image

tobyink ♦
5.2k312

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

answered 06 Nov '09, 13:55

Xi%20Bai's gravatar image

Xi Bai
1
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×96
×35
×23
×9
×2

Asked: 06 Nov '09, 11:29

Seen: 17,557 times

Last updated: 11 Oct '10, 15:31