From ae16f8dcc36c0e1141875e47f628221f8f88e5cc Mon Sep 17 00:00:00 2001 From: Chas Nelson Date: Wed, 1 Feb 2023 14:53:58 +0000 Subject: [PATCH 1/8] feat: update table_schemas to match frictionless v5 --- .../csavr/2_csavr_frictionlessv5.json | 87 +++++++++++++++++++ ...2_geographic_crosswalk_frictionlessv5.json | 32 +++++++ ..._geographic_facilities_frictionlessv5.json | 60 +++++++++++++ ...hic_location_hierarchy_frictionlessv5.json | 50 +++++++++++ .../2_geographic_metadata_frictionlessv5.json | 76 ++++++++++++++++ .../geojson/4_geojson_frictionlessv5.json | 45 ++++++++++ 6 files changed, 350 insertions(+) create mode 100644 table_schemas/csavr/2_csavr_frictionlessv5.json create mode 100644 table_schemas/geographic_crosswalk/2_geographic_crosswalk_frictionlessv5.json create mode 100644 table_schemas/geographic_facilities/2_geographic_facilities_frictionlessv5.json create mode 100644 table_schemas/geographic_location_hierarchy/2_geographic_location_hierarchy_frictionlessv5.json create mode 100644 table_schemas/geographic_metadata/2_geographic_metadata_frictionlessv5.json create mode 100644 table_schemas/geojson/4_geojson_frictionlessv5.json diff --git a/table_schemas/csavr/2_csavr_frictionlessv5.json b/table_schemas/csavr/2_csavr_frictionlessv5.json new file mode 100644 index 0000000..76d0940 --- /dev/null +++ b/table_schemas/csavr/2_csavr_frictionlessv5.json @@ -0,0 +1,87 @@ +{ + "fields": [ + { + "name": "area_id", + "title": "Area ID", + "description": "An area_id from the specified area hierarchy.", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "area_name", + "title": "Area Name", + "description": "Area name corresponding to area_id (optional).", + "type": "string" + }, + { + "name": "indicator_id", + "title": "Indicator ID", + "description": "The indicator that the value represents.", + "type": "string", + "constraints": { + "required": true, + "enum": ["new_hiv_diagnoses", "aids_deaths"] + } + }, + { + "name": "year", + "title": "Year", + "description": "The calendar year.", + "type": "integer", + "constraints": { + "required": true, + "minimum": 1970, + "maximum": 2021 + } + }, + { + "name": "sex", + "title": "Sex", + "description": "Biological sex. Must be \"male\", \"female\", or \"both\" where sex stratification is not available.", + "type": "string", + "constraints": { + "required": true, + "enum": ["male", "female", "both"] + } + }, + { + "name": "age_group", + "title": "Age Group", + "description": "The age group", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "sub_population", + "title": "Sub Population", + "description": "The sub population the value corresponds to e.g. all, fsw, msm, idu", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "value", + "title": "Value", + "description": "The value", + "type": "number", + "constraints": { + "required": true, + "minimum": 0 + } + } + ], + "require_field_order": false, + "primaryKey": [ + "area_id", + "indicator_id", + "year", + "age_group", + "sex", + "sub_population" + ] +} diff --git a/table_schemas/geographic_crosswalk/2_geographic_crosswalk_frictionlessv5.json b/table_schemas/geographic_crosswalk/2_geographic_crosswalk_frictionlessv5.json new file mode 100644 index 0000000..f76fd1b --- /dev/null +++ b/table_schemas/geographic_crosswalk/2_geographic_crosswalk_frictionlessv5.json @@ -0,0 +1,32 @@ +{ + "fields": [ + { + "name": "area_id", + "title": "Area ID", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "dhis2_id", + "title": "DHIS ID", + "type": "string" + }, + { + "name": "pepfar_id", + "title": "PEPFAR ID", + "type": "string" + } + ], + "primaryKey": "area_id", + "foreignKeys": [ + { + "fields": "area_id", + "reference": { + "resource": "geographic_location_hierarchy", + "fields": "area_id" + } + } + ] +} diff --git a/table_schemas/geographic_facilities/2_geographic_facilities_frictionlessv5.json b/table_schemas/geographic_facilities/2_geographic_facilities_frictionlessv5.json new file mode 100644 index 0000000..bbafb0f --- /dev/null +++ b/table_schemas/geographic_facilities/2_geographic_facilities_frictionlessv5.json @@ -0,0 +1,60 @@ +{ + "fields": [ + { + "name": "facility_id", + "title": "Facility ID", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "facility_name", + "title": "Facility Name", + "type": "string" + }, + { + "name": "parent_area_id", + "title": "Area ID", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "lat", + "title": "Latitude", + "type": "number", + "decimalChar": ".", + "constraints": { + "minimum": -90, + "maximum": 90 + } + }, + { + "name": "long", + "title": "Longitude", + "type": "number", + "decimalChar": ".", + "constraints": { + "minimum": -180, + "maximum": 180 + } + }, + { + "name": "type", + "title": "Facility Type", + "type": "string" + } + ], + "primaryKey": "facility_id", + "foreignKeys": [ + { + "fields": "parent_area_id", + "reference": { + "resource": "geographic_location_hierachy", + "fields": "area_id" + } + } + ] +} diff --git a/table_schemas/geographic_location_hierarchy/2_geographic_location_hierarchy_frictionlessv5.json b/table_schemas/geographic_location_hierarchy/2_geographic_location_hierarchy_frictionlessv5.json new file mode 100644 index 0000000..ae23bad --- /dev/null +++ b/table_schemas/geographic_location_hierarchy/2_geographic_location_hierarchy_frictionlessv5.json @@ -0,0 +1,50 @@ +{ + "fields": [ + { + "name": "area_id", + "title": "Area ID", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "area_name", + "title": "Name", + "type": "string" + }, + { + "name": "area_level", + "title": "Admin Level", + "type": "integer", + "constraints": { + "required": true, + "minimum": 0, + "maximum": 8 + } + }, + { + "name": "parent_area_id", + "title": "Parent Area ID", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "area_sort_order", + "title": "Area Sort Order", + "type": "number" + } + ], + "primaryKey": "area_id", + "foreignKeys": [ + { + "fields": "parent_area_id", + "reference": { + "resource": "", + "fields": "area_id" + } + } + ] +} diff --git a/table_schemas/geographic_metadata/2_geographic_metadata_frictionlessv5.json b/table_schemas/geographic_metadata/2_geographic_metadata_frictionlessv5.json new file mode 100644 index 0000000..da925df --- /dev/null +++ b/table_schemas/geographic_metadata/2_geographic_metadata_frictionlessv5.json @@ -0,0 +1,76 @@ +{ + "fields": [ + { + "name": "iso3", + "title": "Country ISO3 Code", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "area_level", + "title": "Area Admin Level", + "type": "integer", + "constraints": { + "required": true, + "minimum": 0, + "maximum": 8 + } + }, + { + "name": "n_areas", + "title": "Number of Areas", + "type": "integer", + "constraints": { + "minimum": 0 + } + }, + { + "name": "area_level_label", + "title": "Area Level Label", + "type": "string" + }, + { + "name": "display", + "title": "Display Level?", + "type": "boolean", + "constraints": { + "required": true + } + }, + { + "name": "spectrum_level", + "title": "Spectrum Level?", + "type": "boolean", + "constraints": { + "required": true + } + }, + { + "name": "epp_level", + "title": "EPP Level?", + "type": "boolean", + "constraints": { + "required": true + } + }, + { + "name": "naomi_level", + "title": "Naomi Level?", + "type": "boolean", + "constraints": { + "required": true + } + }, + { + "name": "pepfar_psnu_level", + "title": "PEPFAR PSNU Level?", + "type": "boolean", + "constraints": { + "required": true + } + } + ], + "primaryKey": "area_level" +} diff --git a/table_schemas/geojson/4_geojson_frictionlessv5.json b/table_schemas/geojson/4_geojson_frictionlessv5.json new file mode 100644 index 0000000..a2342da --- /dev/null +++ b/table_schemas/geojson/4_geojson_frictionlessv5.json @@ -0,0 +1,45 @@ +{ + "fields": [ + { + "name": "area_id", + "title": "Area ID", + "type": "string", + "constraints": { + "required": true + }, + "description": "An area_id from the specified area hierarchy" + }, + { + "name": "area_name", + "title": "Name", + "type": "string", + "description": "Area name corresponding to area_id (optional)" + }, + { + "name": "area_level", + "title": "Admin Level", + "type": "integer", + "constraints": { + "required": true, + "minimum": 0, + "maximum": 8 + }, + "description": "An integer indicating the area admin level, where 0 represents the national level" + }, + { + "name": "parent_area_id", + "title": "Parent Area ID", + "type": "string", + "description": "Area ID for the parent area in the hierarchy" + }, + { + "name": "area_sort_order", + "title": "Area Sort Order", + "type": "number", + "description": "Integer indicating the order that the areas should be sorted by in display tools" + } + ], + "require_field_order": false, + "primaryKey": "area_id", + "title": "Geographic Data" +} From 364c5db52dd20f4e1fd0512dceb6ee51dee6f200 Mon Sep 17 00:00:00 2001 From: Michal Ful Date: Mon, 6 Feb 2023 17:11:13 +0100 Subject: [PATCH 2/8] Remove foreign_keys reference --- .../3_programmatic_data.json | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 package_schemas/programmatic_data/3_programmatic_data.json diff --git a/package_schemas/programmatic_data/3_programmatic_data.json b/package_schemas/programmatic_data/3_programmatic_data.json new file mode 100644 index 0000000..20413b1 --- /dev/null +++ b/package_schemas/programmatic_data/3_programmatic_data.json @@ -0,0 +1,172 @@ +{ + "scheming_version": 1, + "dataset_type": "programmatic-data-package-2", + "name": "Programmatic Data", + "about": "", + "about_url": "http://github.com/ckan/ckanext-scheming", + "add_data_on_create": false, + "dataset_fields": [{ + "field_name": "title", + "label": "Title (autogenerated):", + "preset": "text_template", + "template": "{geo-location} Programmatic Data {year} {version}", + "form_placeholder": "Programmatic Data", + "classes": ["control-large"], + "form_attrs": { + "data-module": "slug-preview-target" + } + }, + { + "field_name": "name", + "label": "URL", + "preset": "dataset_slug", + "form_placeholder": "eg. my-dataset" + }, + { + "field_name": "geo-location", + "label": "Geographical Location", + "form_placeholder": "Country or province", + "preset": "country_list", + "display_property": "dc:contributor", + "validators": "not_empty" + }, + { + "field_name": "year", + "label": "Year", + "preset": "year", + "validators": "not_empty" + }, + { + "field_name": "version", + "label": "Version", + "validators": "unicode package_version_validator", + "form_placeholder": "e.g. FINAL / DRAFT / v1" + }, + { + "field_name": "tag_string", + "label": "Tags", + "preset": "tag_string_autocomplete", + "form_placeholder": "Programmatic, Naomi, ANC, ART", + "default": "Programmatic, Naomi, ANC, ART", + "classes": ["hidden"] + }, + { + "field_name": "maintainer", + "label": "Maintainer", + "preset": "user", + "user_field": "fullname", + "form_placeholder": "e.g. Joe Bloggs", + "display_property": "dc:contributor", + "validators": "not_empty" + }, + { + "field_name": "maintainer_email", + "label": "Maintainer Email", + "form_placeholder": "joe@example.com", + "preset": "user", + "user_field": "email", + "display_snippet": "email.html", + "display_email_name_field": "maintainer", + "validators": "not_empty" + }, + { + "field_name": "notes", + "label": "Description/Source", + "form_snippet": "markdown.html", + "form_placeholder": "eg. Some useful notes about the data. Please write a little about where this data came from and give any relevant references" + }, + { + "field_name": "license_id", + "label": "License", + "form_snippet": "license.html", + "default": "cc-by-igo", + "classes": ["hidden"], + "help_text": "License definitions and additional information can be found at http://opendefinition.org/" + }, + { + "field_name": "owner_org", + "label": "Organization", + "preset": "dataset_organization" + }, + { + "label": "Data Type", + "field_name": "type_name", + "preset": "hidden_value", + "field_value": "Programmatic Data" + }, + { + "field_name": "org_to_allow_transfer_to", + "preset": "org_to_allow_transfer_to" + } + ], + "resources": [{ + "name": "ANC Data", + "about": "A validated ANC dataset.", + "resource_type": "programmatic-anc", + "display_group_order": ["General", "Access Restriction"], + "resource_fields": [{ + "field_name": "name", + "preset": "hidden_value", + "field_value": "ANC Data" + }, { + "field_name": "schema", + "preset": "hidden_value", + "field_value": "1_anc_programmatic" + }, { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "programmatic-anc" + } + ] + }, + { + "name": "ART Data", + "about": "A validated ART dataset.", + "resource_type": "programmatic-art", + "display_group_order": ["General", "Access Restriction"], + "resource_fields": [{ + "field_name": "name", + "preset": "hidden_value", + "field_value": "ART Data" + }, { + "field_name": "schema", + "preset": "hidden_value", + "field_value": "1_art_programmatic" + }, { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "programmatic-art" + } + ] + } + ], + "resource_fields": [{ + "field_name": "url", + "label": "URL", + "preset": "resource_url_upload" + }, + { + "field_name": "name", + "label": "Name", + "form_placeholder": "eg. 2019 ART Numbers" + }, + { + "field_name": "source", + "label": "Source/Notes", + "form_snippet": "markdown.html", + "form_placeholder": "Please share some information about the source of this data." + }, + { + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete", + "required": true + }, + { + "field_name": "restricted", + "label": "Access Restriction", + "preset": "restricted_fields", + "display_group": "Access Restriction" + } + ] +} From 84854dfb6d0f769bce931316b70452eccffa161d Mon Sep 17 00:00:00 2001 From: Michal Ful Date: Mon, 6 Mar 2023 14:32:15 +0100 Subject: [PATCH 3/8] Remove foreign_keys --- package_schemas/programmatic_data/1_programmatic_data.json | 6 ------ package_schemas/programmatic_data/2_programmatic_data.json | 6 ------ 2 files changed, 12 deletions(-) diff --git a/package_schemas/programmatic_data/1_programmatic_data.json b/package_schemas/programmatic_data/1_programmatic_data.json index 0910de5..1221dcc 100644 --- a/package_schemas/programmatic_data/1_programmatic_data.json +++ b/package_schemas/programmatic_data/1_programmatic_data.json @@ -108,9 +108,6 @@ "field_name": "resource_type", "preset": "hidden_value", "field_value": "programmatic-anc" - }, { - "field_name": "foreign_keys", - "preset": "foreign_keys" }] }, { @@ -130,9 +127,6 @@ "field_name": "resource_type", "preset": "hidden_value", "field_value": "programmatic-art" - }, { - "field_name": "foreign_keys", - "preset": "foreign_keys" }] } ], diff --git a/package_schemas/programmatic_data/2_programmatic_data.json b/package_schemas/programmatic_data/2_programmatic_data.json index 89e889a..f86151d 100644 --- a/package_schemas/programmatic_data/2_programmatic_data.json +++ b/package_schemas/programmatic_data/2_programmatic_data.json @@ -116,9 +116,6 @@ "field_name": "resource_type", "preset": "hidden_value", "field_value": "programmatic-anc" - }, { - "field_name": "foreign_keys", - "preset": "foreign_keys" }] }, { @@ -138,9 +135,6 @@ "field_name": "resource_type", "preset": "hidden_value", "field_value": "programmatic-art" - }, { - "field_name": "foreign_keys", - "preset": "foreign_keys" }] } ], From d081768c512d72e4871f5a8c09939ede84f8b7a4 Mon Sep 17 00:00:00 2001 From: Chas Nelson Date: Fri, 12 May 2023 15:01:21 +0100 Subject: [PATCH 4/8] feat: move country estimates to frictionlessv5 --- .../4_country_estimates_frictionlessv5.json | 449 ++++++++++++++++++ table_schemas/anc/5_anc_frictionlessv5.json | 135 ++++++ table_schemas/art/5_art_frictionlessv5.json | 102 ++++ .../4_population_frictionlessv5.json | 84 ++++ .../survey_indicators/3_survey_inputs.json | 295 ++++++------ .../4_survey_frictionlessv5.json | 147 ++++++ 6 files changed, 1063 insertions(+), 149 deletions(-) create mode 100644 package_schemas/country_estimates/4_country_estimates_frictionlessv5.json create mode 100644 table_schemas/anc/5_anc_frictionlessv5.json create mode 100644 table_schemas/art/5_art_frictionlessv5.json create mode 100644 table_schemas/population/4_population_frictionlessv5.json create mode 100644 table_schemas/survey_indicators/4_survey_frictionlessv5.json diff --git a/package_schemas/country_estimates/4_country_estimates_frictionlessv5.json b/package_schemas/country_estimates/4_country_estimates_frictionlessv5.json new file mode 100644 index 0000000..5a9472a --- /dev/null +++ b/package_schemas/country_estimates/4_country_estimates_frictionlessv5.json @@ -0,0 +1,449 @@ +{ + "scheming_version": 1, + "dataset_type": "country-estimates-23", + "name": "Country HIV Estimates 2023", + "link_name": "Country HIV Estimates 2023", + "about": "", + "about_url": "http://github.com/ckan/ckanext-scheming", + "add_data_on_create": false, + "dataset_fields": [ + { + "field_name": "title", + "label": "Title (autogenerated):", + "form_snippet": "text.html", + "validators": "autogenerate", + "classes": ["hidden"], + "template": "{} HIV Estimates 2023", + "template_args": ["geo-location"], + "template_formatters": ["comma_swap"], + "display_group": "HIV Estimates 2023" + }, + { + "field_name": "name", + "label": "URL", + "form_snippet": "text.html", + "validators": "autogenerate auto_create_valid_name not_empty unicode name_validator package_name_validator", + "classes": ["hidden"], + "template": "{}-country-estimates-2023", + "template_args": ["geo-location"], + "template_formatters": ["slugify"], + "display_group": "HIV Estimates 2023" + }, + { + "field_name": "geo-location", + "label": "Location", + "form_placeholder": "Country", + "preset": "country_list", + "display_property": "dc:contributor", + "validators": "not_empty unique_combination", + "display_group": "HIV Estimates 2023" + }, + { + "field_name": "tag_string", + "label": "Tags", + "preset": "tag_string_autocomplete", + "default": "ANC, ART, SVY, Country Estimates", + "classes": ["hidden"], + "display_group": "HIV Estimates 2023" + }, + { + "field_name": "maintainer", + "label": "Contact Name", + "preset": "user", + "user_field": "fullname", + "form_placeholder": "e.g. Joe Bloggs", + "display_property": "dc:contributor", + "validators": "not_empty", + "display_group": "HIV Estimates 2023" + }, + { + "field_name": "maintainer_email", + "label": "Contact Email", + "form_placeholder": "joe@example.com", + "display_snippet": "email.html", + "display_email_name_field": "maintainer", + "validators": "email_validator", + "display_group": "HIV Estimates 2023" + }, + { + "field_name": "notes", + "label": "Description/Source", + "form_snippet": "markdown.html", + "default": "A record of the input data and final HIV estimates.", + "display_group": "HIV Estimates 2023" + }, + { + "field_name": "license_id", + "label": "License", + "form_snippet": "license.html", + "default": "cc-by-igo", + "classes": ["hidden"], + "help_text": "License definitions and additional information can be found at http://opendefinition.org/", + "display_group": "HIV Estimates 2023" + }, + { + "field_name": "owner_org", + "label": "Organization", + "preset": "dataset_organization", + "private": false, + "visibility_classes": ["hidden"], + "display_group": "HIV Estimates 2023" + }, + { + "label": "Year", + "field_name": "year", + "preset": "hidden_value", + "field_value": "2023", + "validators": "unique_combination", + "display_group": "HIV Estimates 2023" + }, + { + "label": "Data Type", + "field_name": "type_name", + "preset": "hidden_value", + "field_value": "Country Estimates", + "validators": "unique_combination", + "display_group": "HIV Estimates 2023" + }, + { + "field_name": "org_to_allow_transfer_to", + "preset": "org_to_allow_transfer_to", + "display_group": "HIV Estimates 2023" + } + ], + "resources": [ + { + "name": "Geographic Data", + "about": "A validated geographic dataset", + "resource_type": "inputs-unaids-geographic", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Geographic Data" + }, + { + "field_name": "schema", + "preset": "hidden_value", + "field_value": "4_geojson_frictionlessv5" + }, + { + "field_name": "validate_package", + "preset": "hidden_value", + "field_value": "true" + }, + { + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete", + "default": "GeoJSON" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-geographic" + } + ] + }, + { + "name": "ANC Data", + "about": "A validated ANC dataset.", + "resource_type": "inputs-unaids-anc", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "ANC Data" + }, + { + "field_name": "schema", + "preset": "hidden_value", + "field_value": "5_anc_frictionlessv5" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-anc" + } + ] + }, + { + "name": "ART Data", + "about": "A validated ART dataset", + "resource_type": "inputs-unaids-art", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "ART Data" + }, + { + "field_name": "schema", + "preset": "hidden_value", + "field_value": "5_art_frictionlessv5" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-art" + } + ] + }, + { + "name": "Survey Data", + "about": "A validated survey dataset", + "resource_type": "inputs-unaids-survey", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Survey Data" + }, + { + "field_name": "schema", + "preset": "hidden_value", + "field_value": "4_survey_frictionlessv5" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-survey" + } + ] + }, + { + "name": "Population Data", + "about": "A validated population dataset", + "resource_type": "inputs-unaids-population", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Population Data" + }, + { + "field_name": "schema", + "preset": "hidden_value", + "field_value": "4_population_frictionlessv5" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-population" + } + ] + }, + { + "name": "Shiny90 HIV Testing Data", + "about": "A validated Shiny90 HIV testing input", + "resource_type": "inputs-unaids-hiv-testing", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Shiny90 HIV Testing Data" + }, + { + "field_name": "schema", + "preset": "hidden_value", + "field_value": "1_hiv_testing_inputs" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-hiv-testing" + } + ] + }, + { + "name": "Spectrum File", + "about": "A spectrum file used to run the Naomi model", + "resource_type": "inputs-unaids-spectrum-file", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Spectrum File" + }, + { + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete", + "validators": "autofill if_empty_guess_format ignore_missing clean_format unicode", + "default": "pjnz" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-spectrum-file" + } + ] + }, + { + "name": "Shiny90 Survey Data", + "about": "Shiny90 survey data input", + "resource_type": "inputs-unaids-shiny90-survey", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Shiny 90 Survey Data" + }, + { + "field_name": "schema", + "preset": "hidden_value", + "field_value": "1_shiny90_survey_estimates" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-shiny90-survey" + } + ] + }, + { + "name": "Shiny90 Output ZIP", + "about": "The Shiny90 output zip file", + "resource_type": "inputs-unaids-shiny90-output-zip", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Shiny 90 Output ZIP" + }, + { + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete", + "default": "ZIP" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-shiny90-output-zip" + } + ] + }, + { + "name": "Naomi Output ZIP", + "about": "The Naomi output zip file", + "resource_type": "inputs-unaids-naomi-output-zip", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Naomi Output ZIP" + }, + { + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete", + "default": "ZIP" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-naomi-output-zip" + } + ] + }, + { + "name": "Naomi Results and Summary Report", + "about": "The Naomi HTML report file", + "resource_type": "inputs-unaids-naomi-report", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Naomi Results and Summary Report" + }, + { + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete", + "default": "URL" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-naomi-report" + } + ] + }, + { + "name": "Naomi Comparison Report", + "about": "The Naomi Comparison report file", + "resource_type": "inputs-unaids-naomi-comparison-report", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Naomi Comparison Report" + }, + { + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete", + "default": "URL" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-naomi-comparison-report" + } + ] + }, + { + "name": "Key Populations Excel Workbook", + "about": "The Key Populations Excel Workbook", + "resource_type": "inputs-unaids-key-populations-workbook", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Key Populations Excel Workbook" + }, + { + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete", + "default": "XLSX" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-key-populations-workbook" + } + ] + } + ], + "resource_fields": [ + { + "field_name": "url", + "label": "URL", + "preset": "resource_url_upload" + }, + { + "field_name": "name", + "label": "Name", + "form_placeholder": "eg. January 2011 Gold Prices" + }, + { + "field_name": "description", + "label": "Description", + "form_snippet": "markdown.html", + "form_placeholder": "Some useful notes about the data" + }, + { + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete" + }, + { + "field_name": "restricted", + "label": "Access Restriction", + "preset": "restricted_fields", + "display_group": "Access Restriction" + } + ] +} diff --git a/table_schemas/anc/5_anc_frictionlessv5.json b/table_schemas/anc/5_anc_frictionlessv5.json new file mode 100644 index 0000000..b17f5a8 --- /dev/null +++ b/table_schemas/anc/5_anc_frictionlessv5.json @@ -0,0 +1,135 @@ +{ + "fields": [ + { + "name": "area_id", + "title": "Area ID", + "description": "An area_id from the specified area hierarchy.", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "area_name", + "title": "Area Name", + "description": "Area name corresponding to area_id (optional)", + "type": "string" + }, + { + "name": "age_group", + "title": "Age Group", + "description": "The age group ID, of the form YXXX_ZZZ where XXX is the integer lower limit and ZZZ is the integer upper limit (for ANC we are only using 1 age group Y015_049)\n", + "type": "string", + "constraints": { + "required": true, + "enum": ["Y015_049"] + } + }, + { + "name": "year", + "title": "Year", + "description": "The calendar year e.g. 2023", + "type": "integer", + "constraints": { + "required": true, + "minimum": 2010, + "maximum": 2023 + } + }, + { + "name": "anc_clients", + "title": "Number ANC Clients", + "description": "Number of unique clients attending ANC for the first visit during a pregnancy in the calendar year", + "type": "integer", + "constraints": { + "minimum": 0 + } + }, + { + "name": "anc_known_pos", + "title": "Number Known Positive", + "description": "Number of ANC clients who self-report known HIV positive prior to first ANC visit and are not tested for HIV", + "type": "integer", + "constraints": { + "minimum": 0 + } + }, + { + "name": "anc_already_art", + "title": "Number Already on ART", + "description": "Number of ANC clients already on ART prior to first ANC visit during a pregnancy", + "type": "integer", + "constraints": { + "minimum": 0 + } + }, + { + "name": "anc_tested", + "title": "Number HIV Tested", + "description": "Number of unique ANC clients who are tested for HIV during their pregnancy. N.B. If you collect information on ANC known negatives at first ANC visit who were not tested for HIV please add these into anc_tested", + "type": "integer", + "constraints": { + "minimum": 0 + } + }, + { + "name": "anc_tested_pos", + "title": "Number Tested Positive", + "description": "Number of ANC clients who test HIV positive at the first HIV test during a given pregnancy", + "type": "integer", + "constraints": { + "minimum": 0 + } + }, + { + "name": "anc_known_neg", + "title": "Number Known Negative", + "description": "Number of ANC clients who self-report known HIV negative prior to first ANC visit and are not tested for HIV", + "type": "integer", + "constraints": { + "minimum": 0 + } + }, + { + "name": "births_facility", + "title": "Number of Facility Births", + "description": "Number of births recorded at health facilities.", + "type": "integer", + "constraints": { + "minimum": 0 + } + } + ], + "require_field_order": false, + "primaryKey": ["area_id", "year", "age_group"], + "foreignKeys": [ + { + "fields": "area_id", + "reference": { + "resource": "inputs-unaids-geographic", + "fields": "area_id" + } + } + ], + "customConstraints": [ + { + "constraint": "anc_clients >= anc_known_pos", + "description": "The total number of anc clients must be greater or equal to the number of anc clients tested." + }, + { + "constraint": "anc_clients >= anc_known_neg", + "description": "The total number of anc clients must be greater or equal to the number of clients already known to be HIV negative." + }, + { + "constraint": "anc_clients >= anc_tested_pos", + "description": "The total number of anc clients must be greater or equal to the number of clients already known to be HIV positive." + }, + { + "constraint": "anc_tested >= anc_tested_pos", + "description": "The total number of anc clients tested must be greater or equal to the number of those clients who tested positive." + } + ], + "title": "ANC Data", + "description": "If data does not exist, please indicate so with the value \"NA\" and ignore any warning given by Excel.", + "version": "3.0" +} diff --git a/table_schemas/art/5_art_frictionlessv5.json b/table_schemas/art/5_art_frictionlessv5.json new file mode 100644 index 0000000..0d6f162 --- /dev/null +++ b/table_schemas/art/5_art_frictionlessv5.json @@ -0,0 +1,102 @@ +{ + "fields": [ + { + "name": "area_id", + "title": "Area ID", + "description": "Must be an area_id from the agreed area hierarchy", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "area_name", + "title": "Area Name", + "description": "Area name corresponding to area_id (optional)", + "type": "string" + }, + { + "name": "sex", + "title": "Sex", + "description": "Biological sex - must be either \"both\", \"female\", or \"male\"", + "type": "string", + "constraints": { + "required": true, + "enum": ["both", "male", "female"] + } + }, + { + "name": "age_group", + "title": "Age Group", + "description": "The age group. Must be either \"Y000_014\" (0-14 y), \"Y015_999\" (15+ y) or \"Y000_999\" (0+)", + "type": "string", + "constraints": { + "required": true, + "enum": ["Y000_014", "Y015_999", "Y000_999"] + } + }, + { + "name": "calendar_quarter", + "title": "Calendar Quarter", + "description": "The calendar quarter reflected the end of reporting period. Formatted as CY20XXQY, for example CY2020Q4 for end of December 2020", + "type": "string" + }, + { + "name": "art_current", + "title": "Number on ART", + "description": "Number currently receiving ART at the end of reporting period", + "type": "number", + "constraints": { + "required": true, + "minimum": 0 + } + }, + { + "name": "art_new", + "title": "Number newly initiated on ART", + "description": "Number newly initiated on ART during reporting period", + "type": "number", + "constraints": { + "minimum": 0 + } + }, + { + "name": "vl_tested_12mos", + "title": "Number VLS Tested", + "description": "The number of people who received a routine viral load test during the 12 months prior to the reporting period end date", + "type": "number", + "constraints": { + "minimum": 0 + } + }, + { + "name": "vl_suppressed_12mos", + "title": "Number VLS", + "description": "The number of people who were virally suppressed among those who received a routine viral load test during the 12 months prior to the reporting period end date", + "type": "number", + "constraints": { + "minimum": 0 + } + } + ], + "customConstraints": [ + { + "constraint": "vls_tested >= vls_suppressed", + "description": "The total number of people who recieved a routine viral load test must be greater than the number among them who were virally supressed." + } + ], + "foreignKeys": [ + { + "fields": "area_id", + "reference": { + "resource": "inputs-unaids-geographic", + "fields": "area_id" + } + } + ], + "require_field_order": false, + "primaryKey": ["area_id", "sex", "age_group", "calendar_quarter"], + "title": "ART Data", + "version": "4", + "description": "If data does not exist, please indicate so with the value \"NA\" and ignore any warning given by Excel." +} diff --git a/table_schemas/population/4_population_frictionlessv5.json b/table_schemas/population/4_population_frictionlessv5.json new file mode 100644 index 0000000..719853e --- /dev/null +++ b/table_schemas/population/4_population_frictionlessv5.json @@ -0,0 +1,84 @@ +{ + "fields": [ + { + "name": "area_id", + "title": "Area ID", + "description": "An area_id from the specified area hierarchy", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "area_name", + "title": "Area Name", + "description": "Area name corresponding to area_id (optional)", + "type": "string" + }, + { + "name": "source", + "title": "Source", + "description": "Source of population data", + "type": "string" + }, + { + "name": "calendar_quarter", + "title": "Calendar Quarter", + "description": "Calendar quarter", + "type": "string" + }, + { + "name": "sex", + "title": "Sex", + "description": "Biological sex - must be either \"both\", \"female\", or \"male\"", + "type": "string", + "constraints": { + "required": true, + "enum": ["both", "male", "female"] + } + }, + { + "name": "age_group", + "title": "Age Group", + "description": "The age group ID, of the form YXXX_ZZZ where XXX is the integer lower limit and ZZZ is the integer upper limit", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "population", + "title": "Population", + "description": "Population for the group", + "type": "number", + "constraints": { + "required": true, + "minimum": 0 + } + }, + { + "name": "asfr", + "title": "Age-specific fertility rate", + "description": "Age-specific fertility rate", + "type": "number", + "constraints": { + "required": false, + "minimum": 0 + } + } + ], + "require_field_order": false, + "foreignKeys": [ + { + "fields": "area_id", + "reference": { + "resource": "inputs-unaids-geographic", + "fields": "area_id" + } + } + ], + "primaryKey": ["area_id", "calendar_quarter", "sex", "age_group"], + "title": "Population Data", + "version": "2.2", + "description": "If data does not exist, please indicate so with the value \"NA\" and ignore any warning given by Excel." +} diff --git a/table_schemas/survey_indicators/3_survey_inputs.json b/table_schemas/survey_indicators/3_survey_inputs.json index 0b9fb0b..9c1c9e7 100644 --- a/table_schemas/survey_indicators/3_survey_inputs.json +++ b/table_schemas/survey_indicators/3_survey_inputs.json @@ -1,150 +1,147 @@ { - "fields": [ - { - "name": "indicator", - "title": "Indicator ID", - "description": "The indicator measured by the survey", - "type": "string", - "constraints": { - "required": true - } - }, - { - "name": "survey_id", - "title": "Survey ID", - "description": "The ID of the survey", - "type": "string", - "constraints": { - "required": true - } - }, - { - "name": "survey_mid_calendar_quarter", - "title": "Survey Midpoint Calendar Quarter", - "description": "The calendar quarter nearest to the midpoint of the survey fieldwork period.", - "type": "string", - "constraints": { - "required": true - } - }, - { - "name": "area_id", - "title": "Area ID", - "description": "An area_id from the specified area hierarchy", - "type": "string", - "constraints": { - "required": true - } - }, - { - "name": "area_name", - "title": "Area Name", - "description": "Area name corresponding to area_id (optional)", - "type": "string" - }, - { - "name": "res_type", - "title": "Residence Type", - "description": "Residence type", - "type": "string" - }, - { - "name": "sex", - "title": "Sex", - "description": "Biological sex - must be either \"both\", \"female\", or \"male\"", - "type": "string", - "constraints": { - "required": true, - "enum": [ - "both", - "female", - "male" - ] - } - }, - { - "name": "age_group", - "title": "Age Group", - "description": "The age group ID, of the form YXXX_ZZZ where XXX is the integer lower limit and ZZZ is the integer upper limit", - "type": "string", - "constraints": { - "required": true - } - }, - { - "name": "n_clusters", - "title": "Number of clusters", - "description": "The number of survey clusters", - "type": "integer" - }, - { - "name": "n_observations", - "title": "Number of observations", - "description": "The number of survey observations", - "type": "integer", - "constraints": { - "required": true - } - }, - { - "name": "n_eff_kish", - "title": "Kish effective sample size", - "description": "The effective number of observations based on Kish effective sample size", - "type": "number", - "constraints": {} - }, - { - "name": "estimate", - "title": "Estimate", - "description": "The value of the survey estimate", - "type": "number", - "constraints": { - "required": true - } - }, - { - "name": "std_error", - "title": "Standard Error", - "description": "The standard error on the estimate", - "type": "number", - "constraints": { - "required": true - } - }, - { - "name": "ci_lower", - "title": "95% Confidence Interval Lower Bound", - "description": "The value of the 95% confidence interval lower bound", - "type": "number", - "constraints": {} - }, - { - "name": "ci_upper", - "title": "95% Confidence Interval Upper Bound", - "description": "The value of the 95% confidence interval upper bound", - "type": "number", - "constraints": {} - } - ], - "require_field_order": false, - "foreignKeys": [ - { - "fields": "area_id", - "reference": { - "resource": "3_geojson_inputs", - "fields": "area_id" - } - } - ], - "primaryKey": [ - "indicator", - "survey_id", - "area_id", - "survey_mid_calendar_quarter", - "age_group", - "sex" - ], - "title": "Survey Data", - "version": "2.1", - "description": "If data does not exist, please indicate so with the value \"NA\" and ignore any warning given by Excel." -} \ No newline at end of file + "fields": [ + { + "name": "indicator", + "title": "Indicator ID", + "description": "The indicator measured by the survey", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "survey_id", + "title": "Survey ID", + "description": "The ID of the survey", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "survey_mid_calendar_quarter", + "title": "Survey Midpoint Calendar Quarter", + "description": "The calendar quarter nearest to the midpoint of the survey fieldwork period.", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "area_id", + "title": "Area ID", + "description": "An area_id from the specified area hierarchy", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "area_name", + "title": "Area Name", + "description": "Area name corresponding to area_id (optional)", + "type": "string" + }, + { + "name": "res_type", + "title": "Residence Type", + "description": "Residence type", + "type": "string" + }, + { + "name": "sex", + "title": "Sex", + "description": "Biological sex - must be either \"both\", \"female\", or \"male\"", + "type": "string", + "constraints": { + "required": true, + "enum": ["both", "female", "male"] + } + }, + { + "name": "age_group", + "title": "Age Group", + "description": "The age group ID, of the form YXXX_ZZZ where XXX is the integer lower limit and ZZZ is the integer upper limit", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "n_clusters", + "title": "Number of clusters", + "description": "The number of survey clusters", + "type": "integer" + }, + { + "name": "n_observations", + "title": "Number of observations", + "description": "The number of survey observations", + "type": "integer", + "constraints": { + "required": true + } + }, + { + "name": "n_eff_kish", + "title": "Kish effective sample size", + "description": "The effective number of observations based on Kish effective sample size", + "type": "number", + "constraints": {} + }, + { + "name": "estimate", + "title": "Estimate", + "description": "The value of the survey estimate", + "type": "number", + "constraints": { + "required": true + } + }, + { + "name": "std_error", + "title": "Standard Error", + "description": "The standard error on the estimate", + "type": "number", + "constraints": { + "required": true + } + }, + { + "name": "ci_lower", + "title": "95% Confidence Interval Lower Bound", + "description": "The value of the 95% confidence interval lower bound", + "type": "number", + "constraints": {} + }, + { + "name": "ci_upper", + "title": "95% Confidence Interval Upper Bound", + "description": "The value of the 95% confidence interval upper bound", + "type": "number", + "constraints": {} + } + ], + "require_field_order": false, + "missingValues": ["NA"], + "foreignKeys": [ + { + "fields": "area_id", + "reference": { + "resource": "inputs-unaids-geographic", + "fields": "area_id" + } + } + ], + "primaryKey": [ + "indicator", + "survey_id", + "area_id", + "survey_mid_calendar_quarter", + "age_group", + "sex" + ], + "title": "Survey Data", + "version": "2.1", + "description": "If data does not exist, please indicate so with the value \"NA\" and ignore any warning given by Excel." +} diff --git a/table_schemas/survey_indicators/4_survey_frictionlessv5.json b/table_schemas/survey_indicators/4_survey_frictionlessv5.json new file mode 100644 index 0000000..9c1c9e7 --- /dev/null +++ b/table_schemas/survey_indicators/4_survey_frictionlessv5.json @@ -0,0 +1,147 @@ +{ + "fields": [ + { + "name": "indicator", + "title": "Indicator ID", + "description": "The indicator measured by the survey", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "survey_id", + "title": "Survey ID", + "description": "The ID of the survey", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "survey_mid_calendar_quarter", + "title": "Survey Midpoint Calendar Quarter", + "description": "The calendar quarter nearest to the midpoint of the survey fieldwork period.", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "area_id", + "title": "Area ID", + "description": "An area_id from the specified area hierarchy", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "area_name", + "title": "Area Name", + "description": "Area name corresponding to area_id (optional)", + "type": "string" + }, + { + "name": "res_type", + "title": "Residence Type", + "description": "Residence type", + "type": "string" + }, + { + "name": "sex", + "title": "Sex", + "description": "Biological sex - must be either \"both\", \"female\", or \"male\"", + "type": "string", + "constraints": { + "required": true, + "enum": ["both", "female", "male"] + } + }, + { + "name": "age_group", + "title": "Age Group", + "description": "The age group ID, of the form YXXX_ZZZ where XXX is the integer lower limit and ZZZ is the integer upper limit", + "type": "string", + "constraints": { + "required": true + } + }, + { + "name": "n_clusters", + "title": "Number of clusters", + "description": "The number of survey clusters", + "type": "integer" + }, + { + "name": "n_observations", + "title": "Number of observations", + "description": "The number of survey observations", + "type": "integer", + "constraints": { + "required": true + } + }, + { + "name": "n_eff_kish", + "title": "Kish effective sample size", + "description": "The effective number of observations based on Kish effective sample size", + "type": "number", + "constraints": {} + }, + { + "name": "estimate", + "title": "Estimate", + "description": "The value of the survey estimate", + "type": "number", + "constraints": { + "required": true + } + }, + { + "name": "std_error", + "title": "Standard Error", + "description": "The standard error on the estimate", + "type": "number", + "constraints": { + "required": true + } + }, + { + "name": "ci_lower", + "title": "95% Confidence Interval Lower Bound", + "description": "The value of the 95% confidence interval lower bound", + "type": "number", + "constraints": {} + }, + { + "name": "ci_upper", + "title": "95% Confidence Interval Upper Bound", + "description": "The value of the 95% confidence interval upper bound", + "type": "number", + "constraints": {} + } + ], + "require_field_order": false, + "missingValues": ["NA"], + "foreignKeys": [ + { + "fields": "area_id", + "reference": { + "resource": "inputs-unaids-geographic", + "fields": "area_id" + } + } + ], + "primaryKey": [ + "indicator", + "survey_id", + "area_id", + "survey_mid_calendar_quarter", + "age_group", + "sex" + ], + "title": "Survey Data", + "version": "2.1", + "description": "If data does not exist, please indicate so with the value \"NA\" and ignore any warning given by Excel." +} From 01e161cc6f79c1dfd6fd7f89b0b21ca053fc98ca Mon Sep 17 00:00:00 2001 From: Chas Nelson Date: Fri, 12 May 2023 15:04:49 +0100 Subject: [PATCH 5/8] feat: move geographic data packages to frictionlessv5 --- .../3_geographic_frictionlessv5.json | 255 ++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 package_schemas/geographic_data/3_geographic_frictionlessv5.json diff --git a/package_schemas/geographic_data/3_geographic_frictionlessv5.json b/package_schemas/geographic_data/3_geographic_frictionlessv5.json new file mode 100644 index 0000000..952942e --- /dev/null +++ b/package_schemas/geographic_data/3_geographic_frictionlessv5.json @@ -0,0 +1,255 @@ +{ + "scheming_version": 1, + "dataset_type": "geographic-data-package-2", + "name": "Geographic Data", + "about": "", + "about_url": "http://github.com/ckan/ckanext-scheming", + "add_data_on_create": false, + "dataset_fields": [ + { + "field_name": "title", + "label": "Title (autogenerated):", + "preset": "text_template", + "template": "{geo-location} Geographic Data {year} {version}", + "form_placeholder": "Geographic Data", + "classes": ["control-large"], + "form_attrs": { + "data-module": "slug-preview-target" + } + }, + { + "field_name": "name", + "label": "URL", + "preset": "dataset_slug", + "form_placeholder": "eg. my-dataset" + }, + { + "field_name": "geo-location", + "label": "Geographical Location", + "form_placeholder": "Country or province", + "preset": "country_list", + "display_property": "dc:contributor", + "validators": "not_empty" + }, + { + "field_name": "year", + "label": "Year", + "preset": "year", + "validators": "not_empty" + }, + { + "field_name": "version", + "label": "Version", + "validators": "unicode package_version_validator", + "form_placeholder": "e.g. FINAL / DRAFT / v1" + }, + { + "field_name": "tag_string", + "label": "Tags", + "preset": "tag_string_autocomplete", + "form_placeholder": "Geographic, Naomi", + "default": "Geographic, Naomi", + "classes": ["hidden"] + }, + { + "field_name": "maintainer", + "label": "Maintainer", + "preset": "user", + "user_field": "fullname", + "form_placeholder": "e.g. Joe Bloggs", + "display_property": "dc:contributor", + "validators": "not_empty" + }, + { + "field_name": "maintainer_email", + "label": "Maintainer Email", + "form_placeholder": "joe@example.com", + "preset": "user", + "user_field": "email", + "display_snippet": "email.html", + "display_email_name_field": "maintainer", + "validators": "not_empty" + }, + { + "field_name": "notes", + "label": "Description/Source", + "form_snippet": "markdown.html", + "form_placeholder": "eg. Some useful notes about the data. Please write a little about where this data came from and give any relevant references" + }, + { + "field_name": "license_id", + "label": "License", + "form_snippet": "license.html", + "default": "cc-by-igo", + "classes": ["hidden"], + "help_text": "License definitions and additional information can be found at http://opendefinition.org/" + }, + { + "field_name": "owner_org", + "label": "Organization", + "preset": "dataset_organization" + }, + { + "label": "Data Type", + "field_name": "type_name", + "preset": "hidden_value", + "field_value": "Geographic Data" + }, + { + "field_name": "org_to_allow_transfer_to", + "preset": "org_to_allow_transfer_to" + } + ], + "resources": [ + { + "name": "Location Hierarchy", + "about": "A validated location hierarchy.", + "resource_type": "geographic-location-hierarchy", + "display_group_order": [ + "General", + "Geographic Metadata", + "Access Restriction" + ], + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Location Hierarchy" + }, + { + "field_name": "description", + "preset": "hidden_value", + "field_value": "A validated location hierarchy." + }, + { + "field_name": "schema", + "preset": "hidden_value", + "field_value": "2_geographic_location_hierarchy_frictionlessv5" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "geographic-location-hierarchy" + } + ] + }, + { + "name": "Areas Metadata", + "about": "A validated areas metadata table.", + "resource_type": "geographic-metadata", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Areas Metadata" + }, + { + "field_name": "description", + "preset": "hidden_value", + "field_value": "A validated areas metadata table." + }, + { + "field_name": "schema", + "preset": "hidden_value", + "field_value": "2_geographic_metadata_frictionlessv5" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "geographic-metadata" + } + ] + }, + { + "name": "Regional Geometry", + "about": "A validated geometry file in SHP or GeoJSON format.", + "resource_type": "geographic-regional-geometry", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Regional Geometry" + }, + { + "field_name": "description", + "preset": "hidden_value", + "field_value": "A validated geometry file in SHP or GeoJSON format." + }, + { + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete", + "required": true, + "default": "geojson" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "geographic-regional-geometry" + }, + { + "field_name": "schema", + "preset": "hidden_value", + "field_value": "4_geojson_frictionlessv5" + } + ] + }, + { + "name": "Area ID Crosswalk Table", + "about": "Crosswalk table between area IDs and other systems e.g. dhis2.", + "resource_type": "geographic-crosswalk", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Area ID Crosswalk Table" + }, + { + "field_name": "description", + "preset": "hidden_value", + "field_value": "Crosswalk table between area IDs and other systems e.g. dhis2." + }, + { + "field_name": "schema", + "preset": "hidden_value", + "field_value": "2_geographic_crosswalk_frictionlessv5" + }, + { + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "geographic-crosswalk" + } + ] + } + ], + "resource_fields": [ + { + "field_name": "url", + "label": "URL", + "preset": "resource_url_upload" + }, + { + "field_name": "name", + "label": "Name", + "form_placeholder": "eg. January 2011 Gold Prices", + "required": true + }, + { + "field_name": "source", + "label": "Source/Notes", + "form_snippet": "markdown.html", + "form_placeholder": "Please share some information about the source of this data." + }, + { + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete" + }, + { + "field_name": "restricted", + "label": "Access Restriction", + "preset": "restricted_fields", + "display_group": "Access Restriction" + } + ] +} From 973516eb260966285ccc5c93116609ccd53e5c0a Mon Sep 17 00:00:00 2001 From: Chas Nelson Date: Fri, 12 May 2023 15:06:44 +0100 Subject: [PATCH 6/8] fix: don't upgrade unused table schemas --- .../csavr/2_csavr_frictionlessv5.json | 87 ------------------- ..._geographic_facilities_frictionlessv5.json | 60 ------------- 2 files changed, 147 deletions(-) delete mode 100644 table_schemas/csavr/2_csavr_frictionlessv5.json delete mode 100644 table_schemas/geographic_facilities/2_geographic_facilities_frictionlessv5.json diff --git a/table_schemas/csavr/2_csavr_frictionlessv5.json b/table_schemas/csavr/2_csavr_frictionlessv5.json deleted file mode 100644 index 76d0940..0000000 --- a/table_schemas/csavr/2_csavr_frictionlessv5.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "fields": [ - { - "name": "area_id", - "title": "Area ID", - "description": "An area_id from the specified area hierarchy.", - "type": "string", - "constraints": { - "required": true - } - }, - { - "name": "area_name", - "title": "Area Name", - "description": "Area name corresponding to area_id (optional).", - "type": "string" - }, - { - "name": "indicator_id", - "title": "Indicator ID", - "description": "The indicator that the value represents.", - "type": "string", - "constraints": { - "required": true, - "enum": ["new_hiv_diagnoses", "aids_deaths"] - } - }, - { - "name": "year", - "title": "Year", - "description": "The calendar year.", - "type": "integer", - "constraints": { - "required": true, - "minimum": 1970, - "maximum": 2021 - } - }, - { - "name": "sex", - "title": "Sex", - "description": "Biological sex. Must be \"male\", \"female\", or \"both\" where sex stratification is not available.", - "type": "string", - "constraints": { - "required": true, - "enum": ["male", "female", "both"] - } - }, - { - "name": "age_group", - "title": "Age Group", - "description": "The age group", - "type": "string", - "constraints": { - "required": true - } - }, - { - "name": "sub_population", - "title": "Sub Population", - "description": "The sub population the value corresponds to e.g. all, fsw, msm, idu", - "type": "string", - "constraints": { - "required": true - } - }, - { - "name": "value", - "title": "Value", - "description": "The value", - "type": "number", - "constraints": { - "required": true, - "minimum": 0 - } - } - ], - "require_field_order": false, - "primaryKey": [ - "area_id", - "indicator_id", - "year", - "age_group", - "sex", - "sub_population" - ] -} diff --git a/table_schemas/geographic_facilities/2_geographic_facilities_frictionlessv5.json b/table_schemas/geographic_facilities/2_geographic_facilities_frictionlessv5.json deleted file mode 100644 index bbafb0f..0000000 --- a/table_schemas/geographic_facilities/2_geographic_facilities_frictionlessv5.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "fields": [ - { - "name": "facility_id", - "title": "Facility ID", - "type": "string", - "constraints": { - "required": true - } - }, - { - "name": "facility_name", - "title": "Facility Name", - "type": "string" - }, - { - "name": "parent_area_id", - "title": "Area ID", - "type": "string", - "constraints": { - "required": true - } - }, - { - "name": "lat", - "title": "Latitude", - "type": "number", - "decimalChar": ".", - "constraints": { - "minimum": -90, - "maximum": 90 - } - }, - { - "name": "long", - "title": "Longitude", - "type": "number", - "decimalChar": ".", - "constraints": { - "minimum": -180, - "maximum": 180 - } - }, - { - "name": "type", - "title": "Facility Type", - "type": "string" - } - ], - "primaryKey": "facility_id", - "foreignKeys": [ - { - "fields": "parent_area_id", - "reference": { - "resource": "geographic_location_hierachy", - "fields": "area_id" - } - } - ] -} From 87fff718150880fbfc6a74b9999a7f9d38a1f46a Mon Sep 17 00:00:00 2001 From: Chas Nelson Date: Fri, 4 Aug 2023 10:54:24 +0100 Subject: [PATCH 7/8] feat: move frictionless package schema to 2024 estimates --- .../4_country_estimates_frictionlessv5.json | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/package_schemas/country_estimates/4_country_estimates_frictionlessv5.json b/package_schemas/country_estimates/4_country_estimates_frictionlessv5.json index 5a9472a..c139ac6 100644 --- a/package_schemas/country_estimates/4_country_estimates_frictionlessv5.json +++ b/package_schemas/country_estimates/4_country_estimates_frictionlessv5.json @@ -1,8 +1,8 @@ { "scheming_version": 1, "dataset_type": "country-estimates-23", - "name": "Country HIV Estimates 2023", - "link_name": "Country HIV Estimates 2023", + "name": "Country HIV Estimates 2024", + "link_name": "Country HIV Estimates 2024", "about": "", "about_url": "http://github.com/ckan/ckanext-scheming", "add_data_on_create": false, @@ -13,10 +13,10 @@ "form_snippet": "text.html", "validators": "autogenerate", "classes": ["hidden"], - "template": "{} HIV Estimates 2023", + "template": "{} HIV Estimates 2024", "template_args": ["geo-location"], "template_formatters": ["comma_swap"], - "display_group": "HIV Estimates 2023" + "display_group": "HIV Estimates 2024" }, { "field_name": "name", @@ -24,10 +24,10 @@ "form_snippet": "text.html", "validators": "autogenerate auto_create_valid_name not_empty unicode name_validator package_name_validator", "classes": ["hidden"], - "template": "{}-country-estimates-2023", + "template": "{}-country-estimates-2024", "template_args": ["geo-location"], "template_formatters": ["slugify"], - "display_group": "HIV Estimates 2023" + "display_group": "HIV Estimates 2024" }, { "field_name": "geo-location", @@ -36,7 +36,7 @@ "preset": "country_list", "display_property": "dc:contributor", "validators": "not_empty unique_combination", - "display_group": "HIV Estimates 2023" + "display_group": "HIV Estimates 2024" }, { "field_name": "tag_string", @@ -44,7 +44,7 @@ "preset": "tag_string_autocomplete", "default": "ANC, ART, SVY, Country Estimates", "classes": ["hidden"], - "display_group": "HIV Estimates 2023" + "display_group": "HIV Estimates 2024" }, { "field_name": "maintainer", @@ -54,7 +54,7 @@ "form_placeholder": "e.g. Joe Bloggs", "display_property": "dc:contributor", "validators": "not_empty", - "display_group": "HIV Estimates 2023" + "display_group": "HIV Estimates 2024" }, { "field_name": "maintainer_email", @@ -63,14 +63,14 @@ "display_snippet": "email.html", "display_email_name_field": "maintainer", "validators": "email_validator", - "display_group": "HIV Estimates 2023" + "display_group": "HIV Estimates 2024" }, { "field_name": "notes", "label": "Description/Source", "form_snippet": "markdown.html", "default": "A record of the input data and final HIV estimates.", - "display_group": "HIV Estimates 2023" + "display_group": "HIV Estimates 2024" }, { "field_name": "license_id", @@ -79,7 +79,7 @@ "default": "cc-by-igo", "classes": ["hidden"], "help_text": "License definitions and additional information can be found at http://opendefinition.org/", - "display_group": "HIV Estimates 2023" + "display_group": "HIV Estimates 2024" }, { "field_name": "owner_org", @@ -87,15 +87,15 @@ "preset": "dataset_organization", "private": false, "visibility_classes": ["hidden"], - "display_group": "HIV Estimates 2023" + "display_group": "HIV Estimates 2024" }, { "label": "Year", "field_name": "year", "preset": "hidden_value", - "field_value": "2023", + "field_value": "2024", "validators": "unique_combination", - "display_group": "HIV Estimates 2023" + "display_group": "HIV Estimates 2024" }, { "label": "Data Type", @@ -103,12 +103,12 @@ "preset": "hidden_value", "field_value": "Country Estimates", "validators": "unique_combination", - "display_group": "HIV Estimates 2023" + "display_group": "HIV Estimates 2024" }, { "field_name": "org_to_allow_transfer_to", "preset": "org_to_allow_transfer_to", - "display_group": "HIV Estimates 2023" + "display_group": "HIV Estimates 2024" } ], "resources": [ From 815b783aa11b66bace84f5c52d69cb830df295dd Mon Sep 17 00:00:00 2001 From: Chas Nelson Date: Fri, 4 Aug 2023 16:49:17 +0100 Subject: [PATCH 8/8] wip delete me --- .../4_country_estimates_24.json | 724 ++++++++++-------- .../4_country_estimates_frictionlessv5.json | 449 ----------- 2 files changed, 390 insertions(+), 783 deletions(-) delete mode 100644 package_schemas/country_estimates/4_country_estimates_frictionlessv5.json diff --git a/package_schemas/country_estimates/4_country_estimates_24.json b/package_schemas/country_estimates/4_country_estimates_24.json index 70de8c9..e46acac 100644 --- a/package_schemas/country_estimates/4_country_estimates_24.json +++ b/package_schemas/country_estimates/4_country_estimates_24.json @@ -1,393 +1,449 @@ { - "scheming_version": 1, - "dataset_type": "country-estimates-24", - "name": "Country HIV Estimates 2024", - "link_name": "Country HIV Estimates 2024", - "about": "", - "about_url": "http://github.com/ckan/ckanext-scheming", - "add_data_on_create": false, - "dataset_fields": [{ - "field_name": "title", - "label": "Title (autogenerated):", - "form_snippet": "text.html", - "validators": "autogenerate", - "classes": ["hidden"], - "template": "{} HIV Estimates 2024", - "template_args": ["geo-location"], - "template_formatters": ["comma_swap"], - "display_group": "HIV Estimates 2024" + "scheming_version": 1, + "dataset_type": "country-estimates-24", + "name": "Country HIV Estimates 2024", + "link_name": "Country HIV Estimates 2024", + "about": "", + "about_url": "http://github.com/ckan/ckanext-scheming", + "add_data_on_create": false, + "dataset_fields": [ + { + "field_name": "title", + "label": "Title (autogenerated):", + "form_snippet": "text.html", + "validators": "autogenerate", + "classes": ["hidden"], + "template": "{} HIV Estimates 2024", + "template_args": ["geo-location"], + "template_formatters": ["comma_swap"], + "display_group": "HIV Estimates 2024" + }, + { + "field_name": "name", + "label": "URL", + "form_snippet": "text.html", + "validators": "autogenerate auto_create_valid_name not_empty unicode name_validator package_name_validator", + "classes": ["hidden"], + "template": "{}-country-estimates-2024", + "template_args": ["geo-location"], + "template_formatters": ["slugify"], + "display_group": "HIV Estimates 2024" + }, + { + "field_name": "geo-location", + "label": "Location", + "form_placeholder": "Country", + "preset": "country_list", + "display_property": "dc:contributor", + "validators": "not_empty unique_combination", + "display_group": "HIV Estimates 2024" + }, + { + "field_name": "tag_string", + "label": "Tags", + "preset": "tag_string_autocomplete", + "default": "ANC, ART, SVY, Country Estimates", + "classes": ["hidden"], + "display_group": "HIV Estimates 2024" + }, + { + "field_name": "maintainer", + "label": "Contact Name", + "preset": "user", + "user_field": "fullname", + "form_placeholder": "e.g. Joe Bloggs", + "display_property": "dc:contributor", + "validators": "not_empty", + "display_group": "HIV Estimates 2024" + }, + { + "field_name": "maintainer_email", + "label": "Contact Email", + "form_placeholder": "joe@example.com", + "display_snippet": "email.html", + "display_email_name_field": "maintainer", + "validators": "email_validator", + "display_group": "HIV Estimates 2024" + }, + { + "field_name": "notes", + "label": "Description/Source", + "form_snippet": "markdown.html", + "default": "A record of the input data and final HIV estimates.", + "display_group": "HIV Estimates 2024" + }, + { + "field_name": "license_id", + "label": "License", + "form_snippet": "license.html", + "default": "cc-by-igo", + "classes": ["hidden"], + "help_text": "License definitions and additional information can be found at http://opendefinition.org/", + "display_group": "HIV Estimates 2024" + }, + { + "field_name": "owner_org", + "label": "Organization", + "preset": "dataset_organization", + "private": false, + "visibility_classes": ["hidden"], + "display_group": "HIV Estimates 2024" + }, + { + "label": "Year", + "field_name": "year", + "preset": "hidden_value", + "field_value": "2024", + "validators": "unique_combination", + "display_group": "HIV Estimates 2024" + }, + { + "label": "Data Type", + "field_name": "type_name", + "preset": "hidden_value", + "field_value": "Country Estimates", + "validators": "unique_combination", + "display_group": "HIV Estimates 2024" + }, + { + "field_name": "org_to_allow_transfer_to", + "preset": "org_to_allow_transfer_to", + "display_group": "HIV Estimates 2024" + } + ], + "resources": [ + { + "name": "Geographic Data", + "about": "A validated geographic dataset", + "resource_type": "inputs-unaids-geographic", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Geographic Data" }, { - "field_name": "name", - "label": "URL", - "form_snippet": "text.html", - "validators": "autogenerate auto_create_valid_name not_empty unicode name_validator package_name_validator", - "classes": ["hidden"], - "template": "{}-country-estimates-2024", - "template_args": ["geo-location"], - "template_formatters": ["slugify"], - "display_group": "HIV Estimates 2024" + "field_name": "schema", + "preset": "hidden_value", + "field_value": "4_geojson_frictionlessv5" }, { - "field_name": "geo-location", - "label": "Location", - "form_placeholder": "Country", - "preset": "country_list", - "display_property": "dc:contributor", - "validators": "not_empty unique_combination", - "display_group": "HIV Estimates 2024" + "field_name": "validate_package", + "preset": "hidden_value", + "field_value": "true" }, { - "field_name": "tag_string", - "label": "Tags", - "preset": "tag_string_autocomplete", - "default": "ANC, ART, SVY, Country Estimates", - "classes": ["hidden"], - "display_group": "HIV Estimates 2024" + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete", + "default": "GeoJSON" }, { - "field_name": "maintainer", - "label": "Contact Name", - "preset": "user", - "user_field": "fullname", - "form_placeholder": "e.g. Joe Bloggs", - "display_property": "dc:contributor", - "validators": "not_empty", - "display_group": "HIV Estimates 2024" + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-geographic" + } + ] + }, + { + "name": "ANC Data", + "about": "A validated ANC dataset.", + "resource_type": "inputs-unaids-anc", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "ANC Data" }, { - "field_name": "maintainer_email", - "label": "Contact Email", - "form_placeholder": "joe@example.com", - "display_snippet": "email.html", - "display_email_name_field": "maintainer", - "validators": "email_validator", - "display_group": "HIV Estimates 2024" + "field_name": "schema", + "preset": "hidden_value", + "field_value": "5_anc_frictionlessv5" }, { - "field_name": "notes", - "label": "Description/Source", - "form_snippet": "markdown.html", - "default": "A record of the input data and final HIV estimates.", - "display_group": "HIV Estimates 2024" + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-anc" + } + ] + }, + { + "name": "ART Data", + "about": "A validated ART dataset", + "resource_type": "inputs-unaids-art", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "ART Data" }, { - "field_name": "license_id", - "label": "License", - "form_snippet": "license.html", - "default": "cc-by-igo", - "classes": ["hidden"], - "help_text": "License definitions and additional information can be found at http://opendefinition.org/", - "display_group": "HIV Estimates 2024" + "field_name": "schema", + "preset": "hidden_value", + "field_value": "5_art_frictionlessv5" }, { - "field_name": "owner_org", - "label": "Organization", - "preset": "dataset_organization", - "private": false, - "visibility_classes": ["hidden"], - "display_group": "HIV Estimates 2024" + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-art" + } + ] + }, + { + "name": "Survey Data", + "about": "A validated survey dataset", + "resource_type": "inputs-unaids-survey", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Survey Data" }, { - "label": "Year", - "field_name": "year", - "preset": "hidden_value", - "field_value": "2024", - "validators": "unique_combination", - "display_group": "HIV Estimates 2024" + "field_name": "schema", + "preset": "hidden_value", + "field_value": "4_survey_frictionlessv5" }, { - "label": "Data Type", - "field_name": "type_name", - "preset": "hidden_value", - "field_value": "Country Estimates", - "validators": "unique_combination", - "display_group": "HIV Estimates 2024" + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-survey" + } + ] + }, + { + "name": "Population Data", + "about": "A validated population dataset", + "resource_type": "inputs-unaids-population", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Population Data" + }, + { + "field_name": "schema", + "preset": "hidden_value", + "field_value": "4_population_frictionlessv5" }, { - "field_name": "org_to_allow_transfer_to", - "preset": "org_to_allow_transfer_to", - "display_group": "HIV Estimates 2024" + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-population" } - ], - "resources": [ - { - "name": "Geographic Data", - "about": "A validated geographic dataset", - "resource_type": "inputs-unaids-geographic", - "resource_fields": [{ - "field_name": "name", - "preset": "hidden_value", - "field_value": "Geographic Data" - }, { - "field_name": "schema", - "preset": "hidden_value", - "field_value": "3_geojson_inputs" - }, { - "field_name": "validate_package", - "preset": "hidden_value", - "field_value": "true" - },{ - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete", - "default": "GeoJSON" - }, { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-geographic" - }] + ] + }, + { + "name": "Shiny90 HIV Testing Data", + "about": "A validated Shiny90 HIV testing input", + "resource_type": "inputs-unaids-hiv-testing", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Shiny90 HIV Testing Data" }, { - "name": "ANC Data", - "about": "A validated ANC dataset.", - "resource_type": "inputs-unaids-anc", - "resource_fields": [{ - "field_name": "name", - "preset": "hidden_value", - "field_value": "ANC Data" - }, { - "field_name": "schema", - "preset": "hidden_value", - "field_value": "4_anc_estimates" - }, { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-anc" - }] + "field_name": "schema", + "preset": "hidden_value", + "field_value": "1_hiv_testing_inputs" }, { - "name": "ART Data", - "about": "A validated ART dataset", - "resource_type": "inputs-unaids-art", - "resource_fields": [{ - "field_name": "name", - "preset": "hidden_value", - "field_value": "ART Data" - }, { - "field_name": "schema", - "preset": "hidden_value", - "field_value": "4_art_estimates" - }, { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-art" - }] + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-hiv-testing" + } + ] + }, + { + "name": "Spectrum File", + "about": "A spectrum file used to run the Naomi model", + "resource_type": "inputs-unaids-spectrum-file", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Spectrum File" }, { - "name": "Survey Data", - "about": "A validated survey dataset", - "resource_type": "inputs-unaids-survey", - "resource_fields": [{ - "field_name": "name", - "preset": "hidden_value", - "field_value": "Survey Data" - }, { - "field_name": "schema", - "preset": "hidden_value", - "field_value": "3_survey_inputs" - }, { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-survey" - }] + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete", + "validators": "autofill if_empty_guess_format ignore_missing clean_format unicode", + "default": "pjnz" }, { - "name": "Population Data", - "about": "A validated population dataset", - "resource_type": "inputs-unaids-population", - "resource_fields": [{ - "field_name": "name", - "preset": "hidden_value", - "field_value": "Population Data" - }, { - "field_name": "schema", - "preset": "hidden_value", - "field_value": "3_population_inputs" - }, { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-population" - }] + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-spectrum-file" + } + ] + }, + { + "name": "Shiny90 Survey Data", + "about": "Shiny90 survey data input", + "resource_type": "inputs-unaids-shiny90-survey", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Shiny 90 Survey Data" }, { - "name": "Shiny90 HIV Testing Data", - "about": "A validated Shiny90 HIV testing input", - "resource_type": "inputs-unaids-hiv-testing", - "resource_fields": [{ - "field_name": "name", - "preset": "hidden_value", - "field_value": "Shiny90 HIV Testing Data" - }, { - "field_name": "schema", - "preset": "hidden_value", - "field_value": "1_hiv_testing_inputs" - }, { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-hiv-testing" - }] + "field_name": "schema", + "preset": "hidden_value", + "field_value": "1_shiny90_survey_estimates" }, { - "name": "Spectrum File", - "about": "A spectrum file used to run the Naomi model", - "resource_type": "inputs-unaids-spectrum-file", - "resource_fields": [{ - "field_name": "name", - "preset": "hidden_value", - "field_value": "Spectrum File" - }, { - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete", - "validators": "autofill if_empty_guess_format ignore_missing clean_format unicode", - "default": "pjnz" - }, { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-spectrum-file" - }] + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-shiny90-survey" + } + ] + }, + { + "name": "Shiny90 Output ZIP", + "about": "The Shiny90 output zip file", + "resource_type": "inputs-unaids-shiny90-output-zip", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Shiny 90 Output ZIP" }, { - "name": "Shiny90 Survey Data", - "about": "Shiny90 survey data input", - "resource_type": "inputs-unaids-shiny90-survey", - "resource_fields": [{ - "field_name": "name", - "preset": "hidden_value", - "field_value": "Shiny 90 Survey Data" - }, { - "field_name": "schema", - "preset": "hidden_value", - "field_value": "1_shiny90_survey_estimates" - }, { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-shiny90-survey" - }] + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete", + "default": "ZIP" }, { - "name": "Shiny90 Output ZIP", - "about": "The Shiny90 output zip file", - "resource_type": "inputs-unaids-shiny90-output-zip", - "resource_fields": [{ - "field_name": "name", - "preset": "hidden_value", - "field_value": "Shiny 90 Output ZIP" - }, { - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete", - "default": "ZIP" - }, { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-shiny90-output-zip" - }] + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-shiny90-output-zip" + } + ] + }, + { + "name": "Naomi Output ZIP", + "about": "The Naomi output zip file", + "resource_type": "inputs-unaids-naomi-output-zip", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Naomi Output ZIP" }, { - "name": "Naomi Output ZIP", - "about": "The Naomi output zip file", - "resource_type": "inputs-unaids-naomi-output-zip", - "resource_fields": [{ - "field_name": "name", - "preset": "hidden_value", - "field_value": "Naomi Output ZIP" - }, { - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete", - "default": "ZIP" - }, { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-naomi-output-zip" - }] + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete", + "default": "ZIP" }, { - "name": "Naomi Results and Summary Report", - "about": "The Naomi HTML report file", - "resource_type": "inputs-unaids-naomi-report", - "resource_fields": [{ - "field_name": "name", - "preset": "hidden_value", - "field_value": "Naomi Results and Summary Report" - }, { - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete", - "default": "URL" - }, { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-naomi-report" - }] + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-naomi-output-zip" + } + ] + }, + { + "name": "Naomi Results and Summary Report", + "about": "The Naomi HTML report file", + "resource_type": "inputs-unaids-naomi-report", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Naomi Results and Summary Report" }, { - "name": "Naomi Comparison Report", - "about": "The Naomi Comparison report file", - "resource_type": "inputs-unaids-naomi-comparison-report", - "resource_fields": [{ - "field_name": "name", - "preset": "hidden_value", - "field_value": "Naomi Comparison Report" - }, { - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete", - "default": "URL" - }, { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-naomi-comparison-report" - }] + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete", + "default": "URL" }, { - "name": "Key Populations Excel Workbook", - "about": "The Key Populations Excel Workbook", - "resource_type": "inputs-unaids-key-populations-workbook", - "resource_fields": [{ - "field_name": "name", - "preset": "hidden_value", - "field_value": "Key Populations Excel Workbook" - }, { - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete", - "default": "XLSX" - }, { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-key-populations-workbook" - }] + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-naomi-report" } - ], - "resource_fields": [{ - "field_name": "url", - "label": "URL", - "preset": "resource_url_upload" + ] + }, + { + "name": "Naomi Comparison Report", + "about": "The Naomi Comparison report file", + "resource_type": "inputs-unaids-naomi-comparison-report", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Naomi Comparison Report" }, { - "field_name": "name", - "label": "Name", - "form_placeholder": "eg. January 2011 Gold Prices" + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete", + "default": "URL" }, { - "field_name": "description", - "label": "Description", - "form_snippet": "markdown.html", - "form_placeholder": "Some useful notes about the data" + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-naomi-comparison-report" + } + ] + }, + { + "name": "Key Populations Excel Workbook", + "about": "The Key Populations Excel Workbook", + "resource_type": "inputs-unaids-key-populations-workbook", + "resource_fields": [ + { + "field_name": "name", + "preset": "hidden_value", + "field_value": "Key Populations Excel Workbook" }, { - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete" + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete", + "default": "XLSX" }, { - "field_name": "restricted", - "label": "Access Restriction", - "preset": "restricted_fields", - "display_group": "Access Restriction" + "field_name": "resource_type", + "preset": "hidden_value", + "field_value": "inputs-unaids-key-populations-workbook" } - ] + ] + } + ], + "resource_fields": [ + { + "field_name": "url", + "label": "URL", + "preset": "resource_url_upload" + }, + { + "field_name": "name", + "label": "Name", + "form_placeholder": "eg. January 2011 Gold Prices" + }, + { + "field_name": "description", + "label": "Description", + "form_snippet": "markdown.html", + "form_placeholder": "Some useful notes about the data" + }, + { + "field_name": "format", + "label": "Format", + "preset": "resource_format_autocomplete" + }, + { + "field_name": "restricted", + "label": "Access Restriction", + "preset": "restricted_fields", + "display_group": "Access Restriction" + } + ] } diff --git a/package_schemas/country_estimates/4_country_estimates_frictionlessv5.json b/package_schemas/country_estimates/4_country_estimates_frictionlessv5.json deleted file mode 100644 index c139ac6..0000000 --- a/package_schemas/country_estimates/4_country_estimates_frictionlessv5.json +++ /dev/null @@ -1,449 +0,0 @@ -{ - "scheming_version": 1, - "dataset_type": "country-estimates-23", - "name": "Country HIV Estimates 2024", - "link_name": "Country HIV Estimates 2024", - "about": "", - "about_url": "http://github.com/ckan/ckanext-scheming", - "add_data_on_create": false, - "dataset_fields": [ - { - "field_name": "title", - "label": "Title (autogenerated):", - "form_snippet": "text.html", - "validators": "autogenerate", - "classes": ["hidden"], - "template": "{} HIV Estimates 2024", - "template_args": ["geo-location"], - "template_formatters": ["comma_swap"], - "display_group": "HIV Estimates 2024" - }, - { - "field_name": "name", - "label": "URL", - "form_snippet": "text.html", - "validators": "autogenerate auto_create_valid_name not_empty unicode name_validator package_name_validator", - "classes": ["hidden"], - "template": "{}-country-estimates-2024", - "template_args": ["geo-location"], - "template_formatters": ["slugify"], - "display_group": "HIV Estimates 2024" - }, - { - "field_name": "geo-location", - "label": "Location", - "form_placeholder": "Country", - "preset": "country_list", - "display_property": "dc:contributor", - "validators": "not_empty unique_combination", - "display_group": "HIV Estimates 2024" - }, - { - "field_name": "tag_string", - "label": "Tags", - "preset": "tag_string_autocomplete", - "default": "ANC, ART, SVY, Country Estimates", - "classes": ["hidden"], - "display_group": "HIV Estimates 2024" - }, - { - "field_name": "maintainer", - "label": "Contact Name", - "preset": "user", - "user_field": "fullname", - "form_placeholder": "e.g. Joe Bloggs", - "display_property": "dc:contributor", - "validators": "not_empty", - "display_group": "HIV Estimates 2024" - }, - { - "field_name": "maintainer_email", - "label": "Contact Email", - "form_placeholder": "joe@example.com", - "display_snippet": "email.html", - "display_email_name_field": "maintainer", - "validators": "email_validator", - "display_group": "HIV Estimates 2024" - }, - { - "field_name": "notes", - "label": "Description/Source", - "form_snippet": "markdown.html", - "default": "A record of the input data and final HIV estimates.", - "display_group": "HIV Estimates 2024" - }, - { - "field_name": "license_id", - "label": "License", - "form_snippet": "license.html", - "default": "cc-by-igo", - "classes": ["hidden"], - "help_text": "License definitions and additional information can be found at http://opendefinition.org/", - "display_group": "HIV Estimates 2024" - }, - { - "field_name": "owner_org", - "label": "Organization", - "preset": "dataset_organization", - "private": false, - "visibility_classes": ["hidden"], - "display_group": "HIV Estimates 2024" - }, - { - "label": "Year", - "field_name": "year", - "preset": "hidden_value", - "field_value": "2024", - "validators": "unique_combination", - "display_group": "HIV Estimates 2024" - }, - { - "label": "Data Type", - "field_name": "type_name", - "preset": "hidden_value", - "field_value": "Country Estimates", - "validators": "unique_combination", - "display_group": "HIV Estimates 2024" - }, - { - "field_name": "org_to_allow_transfer_to", - "preset": "org_to_allow_transfer_to", - "display_group": "HIV Estimates 2024" - } - ], - "resources": [ - { - "name": "Geographic Data", - "about": "A validated geographic dataset", - "resource_type": "inputs-unaids-geographic", - "resource_fields": [ - { - "field_name": "name", - "preset": "hidden_value", - "field_value": "Geographic Data" - }, - { - "field_name": "schema", - "preset": "hidden_value", - "field_value": "4_geojson_frictionlessv5" - }, - { - "field_name": "validate_package", - "preset": "hidden_value", - "field_value": "true" - }, - { - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete", - "default": "GeoJSON" - }, - { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-geographic" - } - ] - }, - { - "name": "ANC Data", - "about": "A validated ANC dataset.", - "resource_type": "inputs-unaids-anc", - "resource_fields": [ - { - "field_name": "name", - "preset": "hidden_value", - "field_value": "ANC Data" - }, - { - "field_name": "schema", - "preset": "hidden_value", - "field_value": "5_anc_frictionlessv5" - }, - { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-anc" - } - ] - }, - { - "name": "ART Data", - "about": "A validated ART dataset", - "resource_type": "inputs-unaids-art", - "resource_fields": [ - { - "field_name": "name", - "preset": "hidden_value", - "field_value": "ART Data" - }, - { - "field_name": "schema", - "preset": "hidden_value", - "field_value": "5_art_frictionlessv5" - }, - { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-art" - } - ] - }, - { - "name": "Survey Data", - "about": "A validated survey dataset", - "resource_type": "inputs-unaids-survey", - "resource_fields": [ - { - "field_name": "name", - "preset": "hidden_value", - "field_value": "Survey Data" - }, - { - "field_name": "schema", - "preset": "hidden_value", - "field_value": "4_survey_frictionlessv5" - }, - { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-survey" - } - ] - }, - { - "name": "Population Data", - "about": "A validated population dataset", - "resource_type": "inputs-unaids-population", - "resource_fields": [ - { - "field_name": "name", - "preset": "hidden_value", - "field_value": "Population Data" - }, - { - "field_name": "schema", - "preset": "hidden_value", - "field_value": "4_population_frictionlessv5" - }, - { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-population" - } - ] - }, - { - "name": "Shiny90 HIV Testing Data", - "about": "A validated Shiny90 HIV testing input", - "resource_type": "inputs-unaids-hiv-testing", - "resource_fields": [ - { - "field_name": "name", - "preset": "hidden_value", - "field_value": "Shiny90 HIV Testing Data" - }, - { - "field_name": "schema", - "preset": "hidden_value", - "field_value": "1_hiv_testing_inputs" - }, - { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-hiv-testing" - } - ] - }, - { - "name": "Spectrum File", - "about": "A spectrum file used to run the Naomi model", - "resource_type": "inputs-unaids-spectrum-file", - "resource_fields": [ - { - "field_name": "name", - "preset": "hidden_value", - "field_value": "Spectrum File" - }, - { - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete", - "validators": "autofill if_empty_guess_format ignore_missing clean_format unicode", - "default": "pjnz" - }, - { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-spectrum-file" - } - ] - }, - { - "name": "Shiny90 Survey Data", - "about": "Shiny90 survey data input", - "resource_type": "inputs-unaids-shiny90-survey", - "resource_fields": [ - { - "field_name": "name", - "preset": "hidden_value", - "field_value": "Shiny 90 Survey Data" - }, - { - "field_name": "schema", - "preset": "hidden_value", - "field_value": "1_shiny90_survey_estimates" - }, - { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-shiny90-survey" - } - ] - }, - { - "name": "Shiny90 Output ZIP", - "about": "The Shiny90 output zip file", - "resource_type": "inputs-unaids-shiny90-output-zip", - "resource_fields": [ - { - "field_name": "name", - "preset": "hidden_value", - "field_value": "Shiny 90 Output ZIP" - }, - { - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete", - "default": "ZIP" - }, - { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-shiny90-output-zip" - } - ] - }, - { - "name": "Naomi Output ZIP", - "about": "The Naomi output zip file", - "resource_type": "inputs-unaids-naomi-output-zip", - "resource_fields": [ - { - "field_name": "name", - "preset": "hidden_value", - "field_value": "Naomi Output ZIP" - }, - { - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete", - "default": "ZIP" - }, - { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-naomi-output-zip" - } - ] - }, - { - "name": "Naomi Results and Summary Report", - "about": "The Naomi HTML report file", - "resource_type": "inputs-unaids-naomi-report", - "resource_fields": [ - { - "field_name": "name", - "preset": "hidden_value", - "field_value": "Naomi Results and Summary Report" - }, - { - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete", - "default": "URL" - }, - { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-naomi-report" - } - ] - }, - { - "name": "Naomi Comparison Report", - "about": "The Naomi Comparison report file", - "resource_type": "inputs-unaids-naomi-comparison-report", - "resource_fields": [ - { - "field_name": "name", - "preset": "hidden_value", - "field_value": "Naomi Comparison Report" - }, - { - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete", - "default": "URL" - }, - { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-naomi-comparison-report" - } - ] - }, - { - "name": "Key Populations Excel Workbook", - "about": "The Key Populations Excel Workbook", - "resource_type": "inputs-unaids-key-populations-workbook", - "resource_fields": [ - { - "field_name": "name", - "preset": "hidden_value", - "field_value": "Key Populations Excel Workbook" - }, - { - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete", - "default": "XLSX" - }, - { - "field_name": "resource_type", - "preset": "hidden_value", - "field_value": "inputs-unaids-key-populations-workbook" - } - ] - } - ], - "resource_fields": [ - { - "field_name": "url", - "label": "URL", - "preset": "resource_url_upload" - }, - { - "field_name": "name", - "label": "Name", - "form_placeholder": "eg. January 2011 Gold Prices" - }, - { - "field_name": "description", - "label": "Description", - "form_snippet": "markdown.html", - "form_placeholder": "Some useful notes about the data" - }, - { - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete" - }, - { - "field_name": "restricted", - "label": "Access Restriction", - "preset": "restricted_fields", - "display_group": "Access Restriction" - } - ] -}