[ckan-dev] Package modification date

Adrià Mercader amercadero at gmail.com
Tue May 17 10:40:46 UTC 2011


Thanks for your answers,

2011/5/17 David Raznick <kindly at gmail.com>:
>>
>> The thing is that it is not always present, like in this case:
>> http://hu.ckan.net/api/2/rest/package/5f343aba-bef5-4f3f-abfd-672f2de1dbe0
>
> This must be an old/buggy version.   It would be sorted if we upgraded it,
> as the data is still there.
Sure, but I still would like to support these old versions


> Sadly the easiest way is to get changes since a certain date from the atom
> feed.  However that needs to be parsed.  This feed gives changes to extras,
> resources and tags.
Can't we use the revision search API for this? (see below)

2011/5/17 David Read <david.read at okfn.org>:
> They are related, but not the same. The metadata_modified is the last
> modification date of any of the 'greater package' (includes tags,
> extras, groups and resources), whereas the revision field has the most
> recent revision of just the package (excluding tags etc).
>
> This is a subtle point, and highlights a difficulty with our present
> model/terminology.
I agree this might lead to confusion if you don't know the model.


>> * If I wanted to query only the packages modified from a certain date,
>> I guess I should use the revision search api:
>> http://it.ckan.net/api/search/revision?since_time=2011-04-17
>
> Yes this works. When you query each revision, it will tell you which
> packages are related, including a package that you just edit an extra
> field or resource of.
>
>> My question is, are the revisions returned only referring to changes
>> in packages, or there could be also changes in groups, users, etc on
>> this list?
>
> Yes that is correct. In this case, when you GET these revisions they
> will have the "packages" field blank, so you can ignore these for your
> purpose.
>
My only question is, with this API call and for a certain package,
will I get ALL its revisions from the time specified or only the
latest one?

If the answer is all, maybe it will be more useful to have a
package-level API call that would return the modified packages
directly: (/api/search/package?since_time=2011-04-17)
Right now,you have to query the revisions, check which ones are
package related, and (if the answer to my question is all) look for
distinct packages.
Not that is difficult to implement, but maybe is not very intuitive


Thanks,

Adrià




More information about the ckan-dev mailing list