[ckan-dev] How to access an array in extra-fields ?

Pascal Christoph christoph at hbz-nrw.de
Fri Apr 29 07:57:18 UTC 2011


Hello,

Am 28.04.2011 18:14 schrieb Pascal Christoph:
> Am 28.04.2011 16:41 schrieb David Read:
>> On 28 April 2011 15:55, Pascal Christoph <christoph at hbz-nrw.de> wrote:
>>> but if I try to query this:
>>>
>>> wget
>>> 'http://ckan.net/api/search/package?q=lobid&publishingInstitution="http://lobid.org/organisation/DE-605"'
>>>
>>> I get only two packages, among the package "hbz_unioncatalog" is
>>> missing. (These two packages have only one value for
>>> "publishingInstitution").
>> 
>> It looks like a quoting problem in your command. This gives a result
>> of 15 packages including the hbz_unioncatalog:
> 
> ya, thats the right result!

I have to correct me - thats not the proper result-size. That would be 3
of course, as I stated in my first post.

>> wget http://ckan.net/api/search/package?q=lobid&publishingInstitution="http://lobid.org/organisation/DE-605"
> 
> ok, here I am in trouble. Being on *nix the '&' will be interpreted as
> "putting process into background", so the wget command you give is not
> working for me.

... and thats the answer why you got 15 results - the "wget" just
shortens because of the '&' to:

wget http://ckan.net/api/search/package?q=lobid

... which gives the proper result size of 15.

I permutated my queries:

# with wildcard, givin 2 results:
wget
'http://ckan.net/api/search/package?q=lobid&publishingInstitution=http*//lobid.org/organisation/DE-605'


# with a non-existent value, giving 0 results:
http://ckan.net/api/search/package?q=lobid&publishingInstitution=DE-6005

So, the problem is not the escaping, but the somewhat flawed way of
storing arrays in the extra-field, as mentioned in my first post.

-o




More information about the ckan-dev mailing list