[ckan-dev] Fwd: Harvesting Group data

Philip Cross cmpac at bristol.ac.uk
Thu Dec 5 15:41:09 UTC 2013


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
-----------------------------------



More information about the ckan-dev mailing list