[ckan-dev] Fwd: Harvesting Group data
Stefan Oderbolz
stefan.oderbolz at liip.ch
Fri Dec 6 09:07:45 UTC 2013
Hi Philip,
I'm not entirely sure, but in our harvesters we used to specify groups as a
list of group names and not as a list of dictionaries, so the data should
look like this:
{'authors': [],
'extras': {'alternative_title': u'Proteomics informed by
transcriptomics raw dataset ',
'author_string': '',
'contributor_string': '',
'doi': u'10.5523/bris.12mjtnrtsdjfs17sl4pq2ucqrk',
'language': u'eng',
'publication_date': '29 Nov 2012',
'publisher': u'University of Bristol'},
*'groups': ['medical-and-veterinary-**sciences'],*
'id': '12mjtnrtsdjfs17sl4pq2ucqrk',
'license_id': 'uk-ncgl',
'name': '12mjtnrtsdjfs17sl4pq2ucqrk',
I think it even doesn't matter if it's the group's name or id, both should
work.
Regards Stefan
On Thu, Dec 5, 2013 at 4:41 PM, Philip Cross <cmpac at bristol.ac.uk> wrote:
> I'm having a problem adding group information to harvested datasets.
> We have an extension based on ckan-harvest that harvests RDF files of
> package metadata for inclusion in the data.bris repository. The
> harvester is working fine except that I cannot get it to recognise
> groups.
>
> We have a number of groups set up that relate to University of Bristol
> faculties. Our harvester sets the group name into a dictionary which
> is placed into the package['groups'] array. This appears to be
> successfully imported according to the relevant log entry:
>
>
> 2013-12-05 12:49:23,793 DEBUG [ckanext.databris.harvesters.databris]
> {'authors': [],
> 'extras': {'alternative_title': u'Proteomics informed by
> transcriptomics raw dataset ',
> 'author_string': '',
> 'contributor_string': '',
> 'doi': u'10.5523/bris.12mjtnrtsdjfs17sl4pq2ucqrk',
> 'language': u'eng',
> 'publication_date': '29 Nov 2012',
> 'publisher': u'University of Bristol'},
> 'groups': [{'name': 'medical-and-veterinary-sciences'}],
> 'id': '12mjtnrtsdjfs17sl4pq2ucqrk',
> 'license_id': 'uk-ncgl',
> 'name': '12mjtnrtsdjfs17sl4pq2ucqrk',
>
>
> where the group 'name' is 'medical-and-veterinary-sciences'
>
> However, this info does not end up in the database, where a call to
> package_show, gives an empty array for 'groups'.
>
> I can see that our ckan installation knows about this group via the
> group_list action:
>
> "result": ["arts", "engineering", "medical-and-veterinary-sciences",
> "medicine-and-dentistry", "science", "social-sciences-and-law"]}
>
> I've tried giving the group id instead of the name and also tried
> giving both values in the group dictionary but I was assuming a
> reference to either would be sufficient as specified under the
> package_create() section of the API (we're using version 2.2)
>
> Best wishes,
> --
> ---------------------------------
> Phil Cross
> Senior Technical Researcher
> IT Services R&D/ILRT
> University of Bristol
> 8 - 10 Berkeley Square
> Bristol, BS8 1HH
> Tel: +44 (0)117 331 4391
> Fax: +44 (0)117 331 4396
> E-mail: phil.cross at bristol.ac.uk
> URL: http://www.bris.ac.uk/ilrt/people/person/philip-a-cross
> Skype: philip_cross
> -----------------------------------
> _______________________________________________
> 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
>
--
Liip AG // Feldstrasse 133 // CH-8004 Zurich
Tel +41 43 500 39 80 // GnuPG 0x7B588C67 // www.liip.ch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20131206/1b8a37fb/attachment-0003.html>
More information about the ckan-dev
mailing list