01
register_crosswalk
action
register_dataset
config (3 keys)
{
"dataset_id": "country_codes_crosswalk",
"format": "csv",
"unit_of_analysis": "other"
}Registers the bundled country_codes.csv as a DuckDB-queryable table and derives construct observations for each of the four code types (COW, Polity, G&W, ISO3). Entity IDs are the country_name strings (lowercased for consistency with Praxis conventions). Each row in country_codes.csv becomes one observation per non-null code column. NULL Polity/G&W values (meaning "same as COW") are NOT emitted as separate observations — the COW observation is the fallback.
{
"dataset_id": "country_codes_crosswalk",
"format": "csv",
"unit_of_analysis": "other"
}{
"dataset_id": "country_codes_crosswalk",
"sql": "SELECT\n 'country_code_cow' AS construct_id,\n LOWER(country_name) AS entity_id,\n NULL AS time_value,\n CAST(ccode_cow AS DOUBLE) AS value_numeric,\n country_name AS value_text,\n 'other' AS unit_of_analysis\nFROM dataset\nWHERE ccode_cow IS NOT NULL\n"
}{
"dataset_id": "country_codes_crosswalk",
"sql": "SELECT\n 'country_code_polity' AS construct_id,\n LOWER(country_name) AS entity_id,\n NULL AS time_value,\n CAST(ccode_polity AS DOUBLE) AS value_numeric,\n country_name AS value_text,\n 'other' AS unit_of_analysis\nFROM dataset\nWHERE ccode_polity IS NOT NULL\n AND TRIM(CAST(ccode_polity AS VARCHAR)) \u003c\u003e ''\n"
}{
"dataset_id": "country_codes_crosswalk",
"sql": "SELECT\n 'country_code_gw' AS construct_id,\n LOWER(country_name) AS entity_id,\n NULL AS time_value,\n CAST(ccode_gw AS DOUBLE) AS value_numeric,\n country_name AS value_text,\n 'other' AS unit_of_analysis\nFROM dataset\nWHERE ccode_gw IS NOT NULL\n AND TRIM(CAST(ccode_gw AS VARCHAR)) \u003c\u003e ''\n"
}{
"dataset_id": "country_codes_crosswalk",
"sql": "SELECT\n 'country_code_iso3' AS construct_id,\n LOWER(country_name) AS entity_id,\n NULL AS time_value,\n NULL AS value_numeric,\n iso3 AS value_text,\n 'other' AS unit_of_analysis\nFROM dataset\nWHERE iso3 IS NOT NULL\n AND TRIM(iso3) \u003c\u003e ''\n"
}