Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce Source column in CSVs (#141) #145

Merged
merged 3 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions scripts/codelists2ttl.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ def gen_skos_subregister(name: str, description: str,
'description': description
}

SUBREGISTER += ' .'
if source != '':
SUBREGISTER += ' ;\n rdfs:isDefinedBy "$source" .'
template_vars['source'] = source
else:
SUBREGISTER += ' .'

return Template(SUBREGISTER).substitute(template_vars).strip()

Expand Down Expand Up @@ -84,7 +88,11 @@ def gen_skos_concept(name: str, description: str, source: str = None) -> str:
'description': description
}

CONCEPT += ' .'
if source != '':
CONCEPT += ' ;\n rdfs:isDefinedBy "$source" .'
template_vars['source'] = source
else:
CONCEPT += ' .'

return Template(CONCEPT).substitute(template_vars).strip()

Expand Down Expand Up @@ -137,7 +145,8 @@ def process_subdomain_index(relative_path: Path, csv_base_path: Path,
if verbose:
print(f' creating sub-register {file_name}')
ttl = gen_skos_subregister(csv_record['Name'],
csv_record['Description'])
csv_record['Description'],
csv_record['Source'])
write_ttl_file(ttl, ttl_base_path, relative_path / file_name)
# recursion
process_subdomain_index(relative_path / csv_record['Name'],
Expand All @@ -147,7 +156,8 @@ def process_subdomain_index(relative_path: Path, csv_base_path: Path,
print(f' no sub-directory {csv_sub_dir}')
print(f' creating concept {file_name}')
ttl = gen_skos_concept(csv_record['Name'],
csv_record['Description'])
csv_record['Description'],
csv_record['Source'])
write_ttl_file(ttl, ttl_base_path, relative_path / file_name)


Expand Down Expand Up @@ -208,7 +218,8 @@ def process_subdomain_index(relative_path: Path, csv_base_path: Path,
print(f'Generating {concept_ttl_file}')
with concept_ttl_file.open('w') as fh4:
ttl = gen_skos_concept(row2['Name'],
row2['Description'])
row2['Description'],
row2['Source'])
fh4.write(ttl)
else:
with register_ttl_file.open('w') as fh2:
Expand Down
16 changes: 8 additions & 8 deletions topic-hierarchy.csv
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Level,Name,Description
1,channel,"Location of where the data originates from (data providers are 'origin' and global services are 'cache')"
2,version,"Alphabetical version of the topic hierarchy, currently 'a'"
3,system,Fixed value of 'wis2' for WIS2
4,centre-id,Acronym proposed by member and endorsed by WMO Secretariat.
5,notification-type,"WIS2 notification types ('data' or 'metadata')"
6,data-policy,"Data policy as defined by the WMO Unified Data Policy ('core' and 'recommended')"
7,earth-system-discipline,"Seven high-level categories as defined by the WMO Unified Data Policy, Annex 1: 'atmospheric-composition', 'climate', 'cryosphere', 'hydrology', 'ocean', 'space-weather', or 'weather'"
Level,Name,Description,Source
1,channel,"Location of where the data originates from (data providers are 'origin' and global services are 'cache')",
2,version,"Alphabetical version of the topic hierarchy, currently 'a'",
3,system,Fixed value of 'wis2' for WIS2,
4,centre-id,Acronym proposed by member and endorsed by WMO Secretariat,
5,notification-type,"WIS2 notification types ('data' or 'metadata')",
6,data-policy,"Data policy as defined by the WMO Unified Data Policy ('core' and 'recommended')",
7,earth-system-discipline,"Seven high-level categories as defined by the WMO Unified Data Policy, Annex 1: 'atmospheric-composition', 'climate', 'cryosphere', 'hydrology', 'ocean', 'space-weather', or 'weather'",
40 changes: 20 additions & 20 deletions topic-hierarchy/centre-id.csv
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Name,Description
ca-eccc-msc,"Environment and Climate Change Canada, Meteorological Service of Canada"
ca-eccc-msc-global-discovery-catalogue,"Environment and Climate Change Canada, Meteorological Service of Canada, Global Discovery Catalogue Service"
cn-cma-babj,"China Meteorological Administration (CMA); National Meteorological Information Center (NMIC)"
cu-insmet,Institute of Meteorology of Cuba
data-metoffice-noaa-global-cache,"Met Office / National Oceanic and Atmospheric Administration, Global Cache Service"
de-dwd,Deutscher Wetterdienst
de-dwd-gts-to-wis2,"Deutscher Wetterdienst, GTS to WIS2 Gateway"
de-dwd-global-cache,"Deutscher Wetterdienst, Global Cache Service"
fr-meteo-france,Météo-France
int-ecmwf,European Centre for Medium-Range Weather Forecasts
int-eumetsat,European Organisation for the Exploitation of Meteorological Satellites
it-meteoam,Italian National Centre of Meteorology and Climatology
ma-marocmeteo,Maroc Météo
org-woudc,World Ozone and Ultraviolet Radiation Data Centre
uk-metoffice-nmc,UK Meteorological Office
uk-metoffice-wis2-to-gts,"UK Meteorological Office, WIS2 to GTS Gateway"
us-noaa-nws,"National Oceanic and Atmospheric Administration, National Weather Service"
us-noaa-nws-global-broker,"National Oceanic and Atmospheric Administration, National Weather Service, Global Broker Service"
us-synoptic_data_pbc,Synoptic Data Public Benefit Corporation (PBC)
Name,Description,Source
ca-eccc-msc,"Environment and Climate Change Canada, Meteorological Service of Canada",
ca-eccc-msc-global-discovery-catalogue,"Environment and Climate Change Canada, Meteorological Service of Canada, Global Discovery Catalogue Service",
cn-cma-babj,"China Meteorological Administration (CMA); National Meteorological Information Center (NMIC)",
cu-insmet,Institute of Meteorology of Cuba,
data-metoffice-noaa-global-cache,"Met Office / National Oceanic and Atmospheric Administration, Global Cache Service",
de-dwd,Deutscher Wetterdienst,
de-dwd-gts-to-wis2,"Deutscher Wetterdienst, GTS to WIS2 Gateway",
de-dwd-global-cache,"Deutscher Wetterdienst, Global Cache Service",
fr-meteo-france,Météo-France,
int-ecmwf,European Centre for Medium-Range Weather Forecasts,
int-eumetsat,European Organisation for the Exploitation of Meteorological Satellites,
it-meteoam,Italian National Centre of Meteorology and Climatology,
ma-marocmeteo,Maroc Météo,
org-woudc,World Ozone and Ultraviolet Radiation Data Centre,
uk-metoffice-nmc,UK Meteorological Office,
uk-metoffice-wis2-to-gts,"UK Meteorological Office, WIS2 to GTS Gateway",
us-noaa-nws,"National Oceanic and Atmospheric Administration, National Weather Service",
us-noaa-nws-global-broker,"National Oceanic and Atmospheric Administration, National Weather Service, Global Broker Service",
us-synoptic_data_pbc,Synoptic Data Public Benefit Corporation (PBC),
6 changes: 3 additions & 3 deletions topic-hierarchy/channel.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
origin,Data downloadable from the original NC/DCPC
cache,Data downloadable from a Global Cache
Name,Description,Source
origin,Data downloadable from the original NC/DCPC,
cache,Data downloadable from a Global Cache,
6 changes: 3 additions & 3 deletions topic-hierarchy/data-policy.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
core,Core data
recommended,Recommended data
Name,Description,Source
core,Core data,
recommended,Recommended data,
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Name,Description
experimental,Experimental topics
Name,Description,Source
experimental,Experimental topics,
4 changes: 2 additions & 2 deletions topic-hierarchy/earth-system-discipline/climate/index.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Name,Description
experimental,Experimental topics
Name,Description,Source
experimental,Experimental topics,
4 changes: 2 additions & 2 deletions topic-hierarchy/earth-system-discipline/cryosphere/index.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Name,Description
experimental,Experimental topics
Name,Description,Source
experimental,Experimental topics,
4 changes: 2 additions & 2 deletions topic-hierarchy/earth-system-discipline/hydrology/index.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Name,Description
experimental,Experimental topics
Name,Description,Source
experimental,Experimental topics,
16 changes: 8 additions & 8 deletions topic-hierarchy/earth-system-discipline/index.csv
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Name,Description
weather,Weather
climate,Climate
hydrology,Hydrology
atmospheric-composition,Atmospheric Composition
cryosphere,Cryosphere
ocean,Ocean
space-weather,Space Weather
Name,Description,Source
weather,Weather,
climate,Climate,
hydrology,Hydrology,
atmospheric-composition,Atmospheric Composition,
cryosphere,Cryosphere,
ocean,Ocean,
space-weather,Space Weather,
4 changes: 2 additions & 2 deletions topic-hierarchy/earth-system-discipline/ocean/index.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Name,Description
experimental,Experimental topics
Name,Description,Source
experimental,Experimental topics,
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Name,Description
experimental,Experimental topics
Name,Description,Source
experimental,Experimental topics,
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Name,Description
metar,Aerodrome observation
taf,Aerodrome forecast
qvaci,Quantitative volcanic ash concentration information
Name,Description,Source
metar,Aerodrome observation,
taf,Aerodrome forecast,
qvaci,Quantitative volcanic ash concentration information,
12 changes: 6 additions & 6 deletions topic-hierarchy/earth-system-discipline/weather/index.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name,Description
advisories-warnings,Advisories and warnings
aviation,Aviation
prediction,"Data sets produced by quantitative algorithms, such as numerical or statistical prediction models, describing the past, present and future meteorological states"
surface-based-observations,Surface based observations
experimental,Experimental topics
Name,Description,Source
advisories-warnings,Advisories and warnings,
aviation,Aviation,
prediction,"Data sets produced by quantitative algorithms, such as numerical or statistical prediction models, describing the past, present and future meteorological states",
surface-based-observations,Surface based observations,
experimental,Experimental topics,
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name,Description
medium-range,A prediction system up to the order of 240 hours ahead
nowcasting,A prediction system up to the order of 120 minutes ahead
seasonal,A prediction system up to the order of 6 months ahead
short-range,A prediction system up to the order of 72 hours ahead
subseasonal,A prediction system up to the order of 30 days ahead
Name,Description,Source
medium-range,A prediction system up to the order of 240 hours ahead,
nowcasting,A prediction system up to the order of 120 minutes ahead,
seasonal,A prediction system up to the order of 6 months ahead,
short-range,A prediction system up to the order of 72 hours ahead,
subseasonal,A prediction system up to the order of 30 days ahead,
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
global,A prediction system that covers the entire globe
limited-area,A prediction system that does not cover the entire globe
Name,Description,Source
global,A prediction system that covers the entire globe,
limited-area,A prediction system that does not cover the entire globe,
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
deterministic,Outputs from a prediction system which provides one single scenario
probabilistic,"Outputs from a prediction system which provides multiple scenarios, including probability distribution and uncertainty information"
Name,Description,Source
deterministic,Outputs from a prediction system which provides one single scenario,
probabilistic,"Outputs from a prediction system which provides multiple scenarios, including probability distribution and uncertainty information",
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
global,A prediction system that covers the entire globe
limited-area,A prediction system that does not cover the entire globe
Name,Description,Source
global,A prediction system that covers the entire globe,
limited-area,A prediction system that does not cover the entire globe,
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
global,A prediction system that covers the entire globe
limited-area,A prediction system that does not cover the entire globe
Name,Description,Source
global,A prediction system that covers the entire globe,
limited-area,A prediction system that does not cover the entire globe,
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
deterministic,Outputs from a prediction system which provides one single scenario
probabilistic,"Outputs from a prediction system which provides multiple scenarios, including probability distribution and uncertainty information"
Name,Description,Source
deterministic,Outputs from a prediction system which provides one single scenario,
probabilistic,"Outputs from a prediction system which provides multiple scenarios, including probability distribution and uncertainty information",
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
global,A prediction system that covers the entire globe
limited-area,A prediction system that does not cover the entire globe
Name,Description,Source
global,A prediction system that covers the entire globe,
limited-area,A prediction system that does not cover the entire globe,
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
global,A prediction system that covers the entire globe
limited-area,A prediction system that does not cover the entire globe
Name,Description,Source
global,A prediction system that covers the entire globe,
limited-area,A prediction system that does not cover the entire globe,
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
deterministic,Outputs from a prediction system which provides one single scenario
probabilistic,"Outputs from a prediction system which provides multiple scenarios, including probability distribution and uncertainty information"
Name,Description,Source
deterministic,Outputs from a prediction system which provides one single scenario,
probabilistic,"Outputs from a prediction system which provides multiple scenarios, including probability distribution and uncertainty information",
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
global,A prediction system that covers the entire globe
limited-area,A prediction system that does not cover the entire globe
Name,Description,Source
global,A prediction system that covers the entire globe,
limited-area,A prediction system that does not cover the entire globe,
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
global,A prediction system that covers the entire globe
limited-area,A prediction system that does not cover the entire globe
Name,Description,Source
global,A prediction system that covers the entire globe,
limited-area,A prediction system that does not cover the entire globe,
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
deterministic,Outputs from a prediction system which provides one single scenario
probabilistic,"Outputs from a prediction system which provides multiple scenarios, including probability distribution and uncertainty information"
Name,Description,Source
deterministic,Outputs from a prediction system which provides one single scenario,
probabilistic,"Outputs from a prediction system which provides multiple scenarios, including probability distribution and uncertainty information",
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
global,A prediction system that covers the entire globe
limited-area,A prediction system that does not cover the entire globe
Name,Description,Source
global,A prediction system that covers the entire globe,
limited-area,A prediction system that does not cover the entire globe,
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
global,A prediction system that covers the entire globe
limited-area,A prediction system that does not cover the entire globe
Name,Description,Source
global,A prediction system that covers the entire globe,
limited-area,A prediction system that does not cover the entire globe,
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
deterministic,Outputs from a prediction system which provides one single scenario
probabilistic,"Outputs from a prediction system which provides multiple scenarios, including probability distribution and uncertainty information"
Name,Description,Source
deterministic,Outputs from a prediction system which provides one single scenario,
probabilistic,"Outputs from a prediction system which provides multiple scenarios, including probability distribution and uncertainty information",
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
global,A prediction system that covers the entire globe
limited-area,A prediction system that does not cover the entire globe
Name,Description,Source
global,A prediction system that covers the entire globe,
limited-area,A prediction system that does not cover the entire globe,
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name,Description
nowcasting,A prediction system up to the order of 120 minutes ahead
short-range,A prediction system up to the order of 72 hours ahead
medium-range,A prediction system up to the order of 240 hours ahead
subseasonal,A prediction system up to the order of 30 days ahead
seasonal,A prediction system up to the order of 6 months ahead
Name,Description,Source
medium-range,A prediction system up to the order of 240 hours ahead,
nowcasting,A prediction system up to the order of 120 minutes ahead,
seasonal,A prediction system up to the order of 6 months ahead,
short-range,A prediction system up to the order of 72 hours ahead,
subseasonal,A prediction system up to the order of 30 days ahead,
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
global,A prediction system that covers the entire globe
limited-area,A prediction system that does not cover the entire globe
Name,Description,Source
global,A prediction system that covers the entire globe,
limited-area,A prediction system that does not cover the entire globe,
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
deterministic,Outputs from a prediction system which provides one single scenario
probabilistic,"Outputs from a prediction system which provides multiple scenarios, including probability distribution and uncertainty information"
Name,Description,Source
deterministic,Outputs from a prediction system which provides one single scenario,
probabilistic,"Outputs from a prediction system which provides multiple scenarios, including probability distribution and uncertainty information",
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
global,A prediction system that covers the entire globe
limited-area,A prediction system that does not cover the entire globe
Name,Description,Source
global,A prediction system that covers the entire globe,
limited-area,A prediction system that does not cover the entire globe,
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
global,A prediction system that covers the entire globe
limited-area,A prediction system that does not cover the entire globe
Name,Description,Source
global,A prediction system that covers the entire globe,
limited-area,A prediction system that does not cover the entire globe,
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
deterministic,Outputs from a prediction system which provides one single scenario
probabilistic,"Outputs from a prediction system which provides multiple scenarios, including probability distribution and uncertainty information"
Name,Description,Source
deterministic,Outputs from a prediction system which provides one single scenario,
probabilistic,"Outputs from a prediction system which provides multiple scenarios, including probability distribution and uncertainty information",
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Name,Description
global,A prediction system that covers the entire globe
limited-area,A prediction system that does not cover the entire globe
Name,Description,Source
global,A prediction system that covers the entire globe,
limited-area,A prediction system that does not cover the entire globe,
Loading
Loading