[ckan-discuss] New feature: data previews

Rufus Pollock rufus.pollock at okfn.org
Wed Jan 19 21:24:28 GMT 2011


Hi All,

Using the new CKAN extension/plugin system we've implemented a new
feature we're calling "data previews" that allow you to preview a
dataset ('package resource') in browser on a CKAN package page.

An example:

1. Visit: <http://ckan.net/package/afghanistan-election-data>
2. Go to the resources section and click on preview and you should get
a pop-up window with a sample of the data.

At the moment, we're limited to previewing csv and xls files with a
size limit (on xls files) of 1Mb because those are the only converters
we've implemented in the data proxy (chosen because they are common,
quite standard and relatively easy to convert to json).

We'd love to expand that list of formats -- e.g. can somebody write
something to give a simple data sample from a sparql endpoint -- so if
you're interested or have ideas how we can handle a particular format
please let say.

More info and explanation of the data proxy setup below.

Regards,

Rufus

To do data previews we need two things:

1. Something to convert data to a standard form we can preview
(preferably json so we can work in javascript) ('hard')
2. Do the preview in CKAN ('easy')

Former is done in a data proxy:

<http://jsonpdataproxy.appspot.com/>
<http://blog.ckan.org/2011/01/11/raw-data-in-ckan-resources-and-data-proxy/>

Code: <https://bitbucket.org/okfn/dataproxy>

Second part is the data preview part of the data api extension
(extension also gives us a data API in CKAN at /api/data!):

<https://bitbucket.org/okfn/ckanext-dataapi>



More information about the ckan-discuss mailing list