[ckan-dev] Relationship between resource and datastore

Nick Jackson nijackson at lincoln.ac.uk
Thu Dec 27 19:09:38 UTC 2012


We've run into this same issue, and have 'solved' it by not bothering with the CSV file at all and instead designating the DataStore as a JSON API resource, and using an intermediate bit of code to turn it back to a CSV on demand if needed.

Nick Jackson
Lead Web Developer
CERD
University of Lincoln
nijackson at lincoln.ac.uk
(+44) 01522 88 6570

On 27 Dec 2012, at 12:40, "Lasse Vestergaard" <ibbernik at gmail.com> wrote:

> Hi all.
> 
> I have been trying to learn CKAN for a couple of weeks, and I have now come to a point where I don't get the conceptual idea behind the relationship between resource and the datastore.
> 
> As I understand it, you have attach a datastore to an existing resource in CKAN, but there doesn't have to be any resemblance between the datastore and the resource. This means that I can have an image as a resource, and then have a completely arbitrary datastore related to it. Someone could argue that this makes sense because the datastore is collecting data that relates to the image - the datastore could have data about how much people like the image. That might be a valid argument, but it seems odd, to me, that I can upload ex. a CSV file as a resource, and then put it into the datastore through datastorer (I haven't been able to get the datastorer up and running yet, but I assume that the datastorer creates a datastore that relates to the CSV resource?). This means that I have the CSV file as the resource and users can download this file. At the same time I can access the CSV file data through the datastore. Furthermore this means that I can add, update and delete data in the datastore. Lets say I have regularly been inserting new rows into the datastore, and after a while I want to get a dump of what is going on. If I am a normal user, I would just go and download the CSV file, but that would be wrong, because the CSV file doesn't hold any of the updates that have been made through the datastore.
> 
> All in all this means that the users would be disappointed when they find out that nothing has happened in relation to the resource. That is just one dimension of the issue. As I perceive it the CSV file is useless from the very beginning. The only reason why I would have the CSV file in the ressource is because I wanted to make the template for the datastore tabel. After that the CSV file would be deprecated because it doesn't get updated with the datastore. If that is the case, why couldn't I just have the datastore as a resource by it self in the first place? I could just setup the tabel template through the datastore API.
> 
> It might easily by me that is missing some point about CKAN.
> 
> Regards
> 
> Lasse Vestregaard (Denmark)
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev

The University of Lincoln - a top performer in student satisfaction, enjoying an unrivalled ascent through the University league tables, set in a dynamic, research rich and vibrant campus in the heart of a great historic student-friendly city.

The information in this e-mail and any attachments may be confidential. If you have received this email in error please notify the sender immediately and remove it from your system. Do not disclose the contents to another person or take copies.
 
Email is not secure and may contain viruses. The University of Lincoln makes every effort to ensure email is sent without viruses, but cannot guarantee this and recommends recipients take appropriate precautions.
 
The University may monitor email traffic data and content in accordance with its policies and English law. Further information can be found at: http://www.lincoln.ac.uk/legal.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20121227/094cf5a3/attachment-0001.html>


More information about the ckan-dev mailing list