From 2946840581e3f7cd4a7d1383c5406090b13d2897 Mon Sep 17 00:00:00 2001 From: Janette Day Date: Tue, 16 Apr 2024 19:15:20 -0500 Subject: [PATCH 1/2] Update the dataset.ui.json schema file mentioned in #4067 --- schema/collections/dataset.ui.json | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/schema/collections/dataset.ui.json b/schema/collections/dataset.ui.json index 2ac8c05196..c637369ff5 100644 --- a/schema/collections/dataset.ui.json +++ b/schema/collections/dataset.ui.json @@ -179,8 +179,15 @@ }, "describedBy": { "ui:options": { - "description": "URL to the data dictionary for the file found at the Download URL." - } + "description": "URL to the data dictionary for the file found at the Download URL.", + "widget": "list", + "type": "select", + "titleProperty": "title", + "source": { + "metastoreSchema": "data-dictionary", + "returnValue": "url" + } + } }, "describedByType": { "ui:options": { From 5000ad136d4226ad32ad675f4a3fc7500c3d15db Mon Sep 17 00:00:00 2001 From: Janette Day Date: Wed, 24 Apr 2024 14:25:57 -0500 Subject: [PATCH 2/2] Update docs to explain show how to modify the dataset form --- .../user-guide/guide_data_dictionaries.rst | 31 ++++++++++++++++--- schema/collections/dataset.ui.json | 11 ++----- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/docs/source/user-guide/guide_data_dictionaries.rst b/docs/source/user-guide/guide_data_dictionaries.rst index 169c8bf3eb..fc4af490d3 100644 --- a/docs/source/user-guide/guide_data_dictionaries.rst +++ b/docs/source/user-guide/guide_data_dictionaries.rst @@ -272,7 +272,7 @@ Look closely at the distribution property in the example below. "mediaType": "text\/csv", "format": "csv", "title": "Projects", - "describedBy": "dkan://metastore/schemas/data-dictionary/items/7fd6bb1f-2752-54de-9a33-81ce2ea0feb2", + "describedBy": "http://mydomain.com/api/1/metastore/schemas/data-dictionary/items/7fd6bb1f-2752-54de-9a33-81ce2ea0feb2", "describedByType": "application/vnd.tableschema+json" } ], @@ -286,9 +286,32 @@ Look closely at the distribution property in the example below. "keyword":["tag1"] } -Note the special URL used to point to the data dictionary. The full URL, e.g. -http://mydomain.com/api/1/metastore/schemas/data-dictionary/items/7fd6bb1f-2752-54de-9a33-81ce2ea0feb2, -could also be used, and would be converted to an internal `dkan://` URL on save. +The API endpoint for the data dictionary can be found at the top of the data dictionary edit form. This data dictionary will now be used to modify the datastore table after import. If we were to request the dataset back from the API, it would show us the absolute URL as well. + + +**How to modidfy the dataset form to change the distribution describedBy property to a select field.** + +If you are using the distribution reference setting, and you have created many data dictionaries, +you could customize the dataset.ui.json file (Remember you must copy ALL schema files from DKAN into your +root directory to customize any of them). Edit the dataset.ui.json to look like this: + + .. sourcecode:: json + + "describedBy": { + "ui:options": { + "description": "URL to the data dictionary for the file found at the Download URL.", + "widget": "list", + "type": "select", + "titleProperty": "title", + "source": { + "metastoreSchema": "data-dictionary", + "returnValue": "url" + } + } + } + +This will allow data publishers to select from a list of existing data dictionaries rather than entering the API endpoint. + diff --git a/schema/collections/dataset.ui.json b/schema/collections/dataset.ui.json index c637369ff5..2ac8c05196 100644 --- a/schema/collections/dataset.ui.json +++ b/schema/collections/dataset.ui.json @@ -179,15 +179,8 @@ }, "describedBy": { "ui:options": { - "description": "URL to the data dictionary for the file found at the Download URL.", - "widget": "list", - "type": "select", - "titleProperty": "title", - "source": { - "metastoreSchema": "data-dictionary", - "returnValue": "url" - } - } + "description": "URL to the data dictionary for the file found at the Download URL." + } }, "describedByType": { "ui:options": {