4
votes

We are in the process of upgrading from CKAN 2.6.3 to 2.7.2. We have a test installation of 2.7.2 and I notice a new feature is the data dictionary, which looks very useful!

Is there any documentation around use of the data dictionary feature? I can see how it detects the field names and types automatically, but requires a manual edit to enter the label and description.

Up until this new feature we have been recording the metadata in an accompanying file e.g. https://datastore.landcareresearch.co.nz/dataset/skink-capture-data/resource/aff3205a-aacc-4e96-ad9c-91a72708ce45 (more detailed) or https://datastore.landcareresearch.co.nz/dataset/short-term-possum-foraging-movements/resource/a69d3628-a63a-45a0-af34-f25acb8d5a99 (simple).

We also use the API to upload some data. Can the data dictionary values be set using the API. Could we import data dictionary values from the metadata files we have been using (if we agreed a standard format)?

1

1 Answers

0
votes

Docs for this feature have been added now: https://docs.ckan.org/en/latest/maintaining/datastore.html#data-dictionary

Can the data dictionary values be set using the API?

Yes, you can use datastore_create() to change the data dictionary, specifying it in the fields parameter.

For example:

'fields': [
    {
        "id": "code_number",
        "type": "numeric"
    },
    {
        "id": "description"
        "type": "text",
        "info": {
            "label": "Description",
            "notes": "A brief usage description for this code",
            "example": "Used for temporary service interruptions"
        }
    }
]

Could we import data dictionary values from the metadata files we have been using

Yes, if you can translate it to CKAN's data dictionary format.