我们正在从 CKAN 2.6.3 升级到 2.7.2。我们有一个 2.7.2 的测试安装,我注意到一个新功能是数据字典,它看起来非常有用!
是否有关于使用数据字典功能的任何文档?我可以看到它如何自动检测字段名称和类型,但需要手动编辑才能输入标签和描述。
在此新功能之前,我们一直在随附文件中记录元数据,例如https://datastore.landcareresearch.co.nz/dataset/skink-capture-data/resource/aff3205a-aacc-4e96-ad9c-91a72708ce45 (更详细)或 https://datastore.landcareresearch.co.nz/dataset/short-term-possum-foraging-movements/resource/a69d3628-a63a-45a0-af34-f25acb8d5a99 (简单的)。
我们还使用 API 上传一些数据。是否可以使用 API 设置数据字典值。我们能否从我们一直使用的元数据文件中导入数据字典值(如果我们同意标准格式)?
最佳答案
现在已添加此功能的文档:https://docs.ckan.org/en/latest/maintaining/datastore.html#data-dictionary
Can the data dictionary values be set using the API?
是的,您可以使用
datastore_create()
更改数据字典,在 fields
中指定它范围。例如:
'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
是的,如果你能把它翻译成CKAN的数据字典格式。
关于ckan - CKAN 2.7.x 的数据字典功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47783069/