From 4c3a040634d50e64a17c5a707c17ebde1957203c Mon Sep 17 00:00:00 2001 From: Laura Ghiorghisor Date: Thu, 12 Dec 2024 16:44:03 +0000 Subject: [PATCH] Add data ethics guidance finder config --- config/govuk_index/mapped_document_types.yaml | 1 + config/govuk_index/migrated_formats.yaml | 1 + .../data_ethics_guidance_document.json | 108 ++++++++++++++++++ config/schema/field_definitions.json | 20 ++++ config/schema/indexes/govuk.json | 1 + .../presenters/elasticsearch_presenter.rb | 6 + .../presenters/specialist_presenter.rb | 6 + 7 files changed, 143 insertions(+) create mode 100644 config/schema/elasticsearch_types/data_ethics_guidance_document.json diff --git a/config/govuk_index/mapped_document_types.yaml b/config/govuk_index/mapped_document_types.yaml index c86ed02d1..5cbe4c64b 100644 --- a/config/govuk_index/mapped_document_types.yaml +++ b/config/govuk_index/mapped_document_types.yaml @@ -13,6 +13,7 @@ cma_case: cma_case # Specialist Publisher contact: contact coronavirus_landing_page: edition countryside_stewardship_grant: countryside_stewardship_grant # Specialist Publisher +data_ethics_guidance_document: data_ethics_guidance_document # Specialist Publisher drcf_digital_markets_research: drcf_digital_markets_research # Specialist Publisher drug_safety_update: drug_safety_update # Specialist Publisher employment_appeal_tribunal_decision: employment_appeal_tribunal_decision # Specialist Publisher diff --git a/config/govuk_index/migrated_formats.yaml b/config/govuk_index/migrated_formats.yaml index dbc264146..2d31e833d 100644 --- a/config/govuk_index/migrated_formats.yaml +++ b/config/govuk_index/migrated_formats.yaml @@ -33,6 +33,7 @@ migrated: - business_finance_support_scheme - cma_case - countryside_stewardship_grant +- data_ethics_guidance_document - drcf_digital_markets_research - drug_safety_update - employment_appeal_tribunal_decision diff --git a/config/schema/elasticsearch_types/data_ethics_guidance_document.json b/config/schema/elasticsearch_types/data_ethics_guidance_document.json new file mode 100644 index 000000000..2fe9f3b36 --- /dev/null +++ b/config/schema/elasticsearch_types/data_ethics_guidance_document.json @@ -0,0 +1,108 @@ +{ + "fields": [ + "data_ethics_guidance_document_key_reference", + "data_ethics_guidance_document_ethical_theme", + "data_ethics_guidance_document_organisation", + "data_ethics_guidance_document_function", + "data_ethics_guidance_document_project_phase", + "data_ethics_guidance_document_technology_area" + ], + "expanded_search_result_fields": { + "data_ethics_guidance_document_key_reference": [ + { + "label": "Yes", + "value": "yes" + }, + { + "label": "No", + "value": "no" + } + ], + "data_ethics_guidance_document_ethical_theme": [ + { + "label": "Safety, Security and Robustness", + "value": "safety-security-and-robustness" + }, + { + "label": "Appropriate Transparency and Explainability", + "value": "appropriate-transparency-and-explainability" + }, + { + "label": "Fairness", + "value": "fairness" + }, + { + "label": "Accountability and Governance", + "value": "accountability-and-governance" + }, + { + "label": "Contestability and Redress", + "value": "contestability-and-redress" + }, + { + "label": "Privacy", + "value": "privacy" + }, + { + "label": "Societal Wellbeing", + "value": "societal-wellbeing" + } + ], + "data_ethics_guidance_document_project_phase": [ + { + "label": "Across Lifecycle", + "value": "across-lifecycle" + }, + { + "label": "Planning", + "value": "planning" + }, + { + "label": "Initiation", + "value": "initiation" + }, + { + "label": "Procurement", + "value": "procurement" + }, + { + "label": "Implementation", + "value": "implementation" + }, + { + "label": "Monitoring/Review", + "value": "monitoring-review" + } + ], + "data_ethics_guidance_document_technology_area": [ + { + "label": "AI", + "value": "ai" + }, + { + "label": "Generative AI", + "value": "generative-ai" + }, + { + "label": "Analytical Models", + "value": "analytical-models" + }, + { + "label": "Research and Statistics", + "value": "research-and-statistics" + }, + { + "label": "Data", + "value": "data" + }, + { + "label": "Responsible Innovation", + "value": "responsible-innovation" + }, + { + "label": "Automated Decision Making", + "value": "automated-decision-making" + } + ] + } +} diff --git a/config/schema/field_definitions.json b/config/schema/field_definitions.json index 7575508bd..46f0e7ac8 100644 --- a/config/schema/field_definitions.json +++ b/config/schema/field_definitions.json @@ -1108,5 +1108,25 @@ "sfo_case_date_announced": { "description": "Date announced of a SFO case", "type": "date" + }, + + + "data_ethics_guidance_document_key_reference": { + "type": "identifiers" + }, + "data_ethics_guidance_document_ethical_theme": { + "type": "identifiers" + }, + "data_ethics_guidance_document_organisation": { + "type": "searchable_text" + }, + "data_ethics_guidance_document_function": { + "type": "identifiers" + }, + "data_ethics_guidance_document_project_phase": { + "type": "identifiers" + }, + "data_ethics_guidance_document_technology_area": { + "type": "identifiers" } } \ No newline at end of file diff --git a/config/schema/indexes/govuk.json b/config/schema/indexes/govuk.json index 598ad7d16..d3f4186f5 100644 --- a/config/schema/indexes/govuk.json +++ b/config/schema/indexes/govuk.json @@ -9,6 +9,7 @@ "cma_case", "contact", "countryside_stewardship_grant", + "data_ethics_guidance_document", "drcf_digital_markets_research", "drug_safety_update", "edition", diff --git a/lib/govuk_index/presenters/elasticsearch_presenter.rb b/lib/govuk_index/presenters/elasticsearch_presenter.rb index 0c8f8a642..52730c567 100644 --- a/lib/govuk_index/presenters/elasticsearch_presenter.rb +++ b/lib/govuk_index/presenters/elasticsearch_presenter.rb @@ -50,6 +50,12 @@ def document continuation_link: specialist.continuation_link, country: specialist.country, country_of_origin: specialist.country_of_origin, + data_ethics_guidance_document_key_reference: specialist.data_ethics_guidance_document_key_reference, + data_ethics_guidance_document_ethical_theme: specialist.data_ethics_guidance_document_ethical_theme, + data_ethics_guidance_document_organisation: specialist.data_ethics_guidance_document_organisation, + data_ethics_guidance_document_function: specialist.data_ethics_guidance_document_function, + data_ethics_guidance_document_project_phase: specialist.data_ethics_guidance_document_project_phase, + data_ethics_guidance_document_technology_area: specialist.data_ethics_guidance_document_technology_area, date_application: specialist.date_application, date_of_completion: specialist.date_of_completion, date_of_occurrence: specialist.date_of_occurrence, diff --git a/lib/govuk_index/presenters/specialist_presenter.rb b/lib/govuk_index/presenters/specialist_presenter.rb index fcee52895..c271a84f3 100644 --- a/lib/govuk_index/presenters/specialist_presenter.rb +++ b/lib/govuk_index/presenters/specialist_presenter.rb @@ -35,6 +35,12 @@ class SpecialistPresenter delegate_to_payload :continuation_link delegate_to_payload :country delegate_to_payload :country_of_origin + delegate_to_payload :data_ethics_guidance_document_key_reference + delegate_to_payload :data_ethics_guidance_document_ethical_theme + delegate_to_payload :data_ethics_guidance_document_organisation + delegate_to_payload :data_ethics_guidance_document_function + delegate_to_payload :data_ethics_guidance_document_project_phase + delegate_to_payload :data_ethics_guidance_document_technology_area delegate_to_payload :date_application delegate_to_payload :date_of_completion delegate_to_payload :date_of_occurrence