[ckan-dev] Datasource and resource id - how do I create the initial resource in the datastore?

Lime, Steve D (MNIT) Steve.Lime at state.mn.us
Tue May 14 20:24:24 UTC 2013


I just went though this using git master so I'm guessing it's the same in 2.0. Key was creating a resource via the GUI first and then referencing its id via the API. It's definitely not intuitive but it's the way it works. For example, I created a data resource by uploading a CSV file then created a datastore associated with that CSV file. In my case I have the CSV file for download and then the datastore for visualization and API access (it's the same data). You could use a bogus URL or maybe reference a PDF file containing a data dictionary for the data resource as well.

You can get the data resource ID from either the PostgreSQL tables or from the GUI (you'll see the resource key in various URLs).

Steve

________________________________
From: ckan-dev-bounces at lists.okfn.org [ckan-dev-bounces at lists.okfn.org] on behalf of Henrik Korsgaard [henrikkorsgaard at gmail.com]
Sent: Tuesday, May 14, 2013 2:47 PM
To: ckan-dev at lists.okfn.org
Subject: [ckan-dev] Datasource and resource id - how do I create the initial resource in the datastore?

Hi all,

This is a very basic question and properly belong elsewhere, but here goes...

I have installed CKAN 2.0 from package install on Ubuntu 12.04, postgres 9.1.

In the final setup of the datastore, the guide provides a GET and a POST example via curl. I can do the GET, but I have a very basic question regarding the POST example. It says I have to provide a resource id of an existing CKAN datasource (in datastore?).

The examples in the final part of the datastore setup guide are a bit ambiguous, e.g. create a new resource  in datastore, up against an existing resource id, on a fresh (empty) install.

Now, I have created a resource through the CKAN site and with the action API (package_create), but the POST example does not recognise (Not Found Error) any IDs.

I have checked the apache log, the nginx log and the postgres log, no errors. Postgres write permissions are checked and double checked.

[Question] So, can anyone provide a short description of how to create a resource, obtain resource id and add create a resource in the datastore?

...disclaimer: I might have overlooked something trivial in the various documentation, if so I am sorry :)

--
Med venlig hilsen - Best regards,

Henrik Korsgaard
Phone: +45 22377114

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130514/99bdeb52/attachment-0001.html>


More information about the ckan-dev mailing list