iRail / The-DataTank

DEPRECATED - new repo at http://github.com/tdt/core
http://thedatatank.com
26 stars 9 forks source link

clean html format and microformats #80

Open marc-portier opened 12 years ago

marc-portier commented 12 years ago

The current table-oriented format is often sparse, confusing, less then helpful.

I suppose the goal is to find a clear and direct mapping between some data-structure in php and an html dump, dunno if such exists in the open, but I really think we can do better then the current awkward table.

I propose to:

Additonally I would like us to consider adding semantics through selected class files.

So when this.json returns { test: [1,2,3], when: "2012-03-14T12:34:56Z", loc: {lat: 51.26, long: 2.15} }

I would find it logic if this.html gives something along the lines of

<dl class="this">
  <dd>test</dd>
  <dt class="test">
    <ol>
      <li><span class="value type_int">1</span></li>
      <li><span class="value type_int">2</span></li>
      <li><span class="value type_int">3</span></li>
    </ol>
  </dt>

  <dd>when</dd>
  <dt class="when"><abbr class="value type_date" title="2012-03-14T12:34:56Z">March 14 2012 at 12:34 GMT</abbr></dt>  

  <dd>loc</dd>
  <dt class="loc geo">
     <abbr class="latitude" title="51.26">N 51° 43.333</abbr> 
     <abbr class="longitude" title=" 2.15">W 2° 25</abbr>
  </dt>
</dl>
coreation commented 12 years ago

Hm the logic to parse pieces and identify them as a time, geo and so forth are idd something that a semantifier needs to do. I think the HTML formatter should remain agnostic, and just "html-ize" the php object ? Perhaps in future versions of TDT ( there are plans for a full semantified core TDT ) these kinds of "smart" formatters could be enabled.

marc-portier commented 12 years ago

We can't have an agnostic formatter if we want the described kind of output.

But we can have an optianal 'semantic' or 'schema' information object available for the formatter.

Even without that one being present (and the 'class; anotations added to the output) we should already consider the better HTML formatting.

mielvds commented 12 years ago

In case of a semantic HTML output, I would prefer RDFa instead of microformats. It's a w3c standard primer and is more easily integrated with current implementation. However, since The DataTank does not really supply a human readable interface (e.g., actual HTML pages with full text), I don't see the point of semantically annotating an HTML dump of raw data. I would suggest creating an HTML view on top of the RDF output instead.

marc-portier commented 12 years ago

I love the adagium of the compulsive neurotic: When in doubth: choose both!

Now we also have a .kml AND a .map output. I see how both are useful. Equally I would like us to be pragmatic about how useful microformats are.

Anyway, this is issue is more about my dislike for the current HTML output :) In the end we might need to look at semantics-based templating and multiple variants for one content-type?