Skip to content

Commit

Permalink
Update codelists2ttl_sub-discipline.py
Browse files Browse the repository at this point in the history
  • Loading branch information
antje-s authored Mar 12, 2024
1 parent bc6ebef commit a094260
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions scripts/codelists2ttl_sub-discipline.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,17 @@ def gen_skos_concept(name: str, description: str, source: str = None) -> str:
def read_subdomain_index(index_file):
with open(index_file, "r") as fh_index:
reader_index = csv.DictReader(fh_index)
for row3 in reader_index:
concept_ttl_file = register_ttl_dir / f"{row3['Name']}.ttl"
print(f'Generating {concept_ttl_file}')
with concept_ttl_file.open('w') as fh2_index:
ttl = gen_skos_concept(row3['Name'],
row3['Description'])
fh2_index.write(ttl)
concept_csv_dir = os.path.abspath(index_file)
concept_csv_file = f"{concept_csv_dir}/{row3['Name']}/index.csv"
if concept_csv_file.exists():
read_subdomain_index(concept_csv_file)
for row3 in reader_index:
concept_ttl_file = f"{register_ttl_dir}/{row3['Name']}.ttl"
print(f'Generating {concept_ttl_file}')
with open(concept_ttl_file, 'w') as fh2_index:
ttl = gen_skos_concept(row3['Name'],
row3['Description'])
fh2_index.write(ttl)
concept_csv_dir = os.path.abspath(index_file)
concept_csv_file = f"{concept_csv_dir}/{row3['Name']}/index.csv"
if concept_csv_file.exists():
read_subdomain_index(concept_csv_file)


REGISTER = 'http://codes.wmo.int/wis'
Expand Down

0 comments on commit a094260

Please sign in to comment.