0

Is there anyway to download revisions of data from a CKAN database?

I have been able to retrieve a revision list, but it seems as though there is no way to download individual revisions.

Here is the revision list - https://hub.mph.in.gov/api/3/action/package_revision_list?id=62ddcb15-bbe8-477b-bb2e-175ee5af8629

Here is the package information - https://hub.mph.in.gov/api/3/action/package_show?id=62ddcb15-bbe8-477b-bb2e-175ee5af8629

I can even pull individual revisions - https://hub.mph.in.gov/api/3/action/revision_show?id=00a701e0-ab10-40b0-9630-82fb06c641d1

This is a link to the current version - https://hub.mph.in.gov/dataset/62ddcb15-bbe8-477b-bb2e-175ee5af8629/resource/2538d7f1-391b-4733-90b3-9e95cd5f3ea6/download/covid_report_demographics.xlsx

The ID 2538d7f1-391b-4733-90b3-9e95cd5f3ea6 is not a valid revision ID, and I am unsure where that ID comes from. Anyone happen to know how to through the CKAN API?

Thanks for any help!

2

In this case, 2538d7f1-391b-4733-90b3-9e95cd5f3ea6 is a resource ID, not a revision ID. In CKAN, package(dataset) contains multiple resources and each of resources contain either actual data(file) or link to the data.

Revisions reflect metadata change over time. I.e, it tracks changes in dataset fields and resource fields, but do not track changes of the uploaded file. So, you cannot download previous versions of data(file).

What you can do with revision is viewing the previous title, description, etc. of the dataset. For example CKAN <= 2.8 allows to append revision to dataset id/name and view the previous version in UI: https://hub.mph.in.gov/dataset/covid-19-case-demographics@ca33a830-f8da-4728-a238-7daa01b5bed8

But, generally, revisions have pretty restricted capabilities and they will be replaced with improved activity stream in CKAN v2.9

| improve this answer | |
  • Thank you Tony! So, it looks like there is no way to actually down the older datasets. That is too bad. I appreciate the response. – Ratty Jun 15 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.