[ckan-dev] Harvesting tag vocabularies

Rachel Knowler rachel.knowler at liip.ch
Thu Jul 10 08:08:56 UTC 2014


Hi dev list,

I'm writing again because I'm still having trouble with this issue and I 
really hope someone can help me! If not, I'll be bringing it along to 
CKAN Conf on the 15th. :)

My specific problem is as follows. My CKAN instance has some extra 
metadata fields, some of which are text fields added to extras, and the 
rest of which are tag vocabularies. The harvester currently adds 
everything to extras. The normal extra fields are then accessible to the 
templates in two ways, either with pkg_dict.new_metadata_field or as a 
key-value pair in pkg_dict.extras, while the tag vocab fields are only 
accessible in pkg_dict.extras. Still, I can display all of this on the 
dataset page OK.

My users need to be able to manually edit datasets, so I've added all 
these new metadata fields to the package_metadata_fields.html template 
too, and that's where the problem begins. When the edit page for the 
dataset is opened, the tag vocabulary fields are deleted from 
pkg_dict.extras. I guess this is because the schema expects them to be 
tags and not strings. The upshot is that when you edit a dataset for the 
first time after it's harvested, you have to set these fields to the 
correct values, otherwise they'll be reset to whatever is at the top of 
the drop-down list in the edit form.

I want to be able to set these fields directly from the harvester, as 
tags in the proper tag vocabularies, to avoid this problem. Is there a 
way to do this?

Thanks,
Rachel


On 04.07.2014 13:16, Rachel Knowler wrote:
> Hi dev list,
>
> Is there a good way to set extra metadata fields that take a tag 
> vocabulary, using a harvester? I saw a prior question from last year 
> (https://lists.okfn.org/pipermail/ckan-dev/2013-March/004225.html) but 
> it didn't appear to have any answers.
>
> Thanks,
> Rachel
>
>
>

-- 
Liip AG // Limmatstrasse 183 // CH-8005 Zürich
Tel +41 43 500 39 80 // Mob +41 78 658 26 12 // www.liip.ch




More information about the ckan-dev mailing list