Skip to content

Commit

Permalink
add concepts for country properties
Browse files Browse the repository at this point in the history
  • Loading branch information
semio committed Aug 3, 2021
1 parent 8ab8cfb commit 91b9bf3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion etl/scripts/etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def main():
.drop(country_mask_col, axis=1)
.rename(columns={'Table Name': 'Name'})
.set_index('Country Code'))
countries_cols = countries.columns
country_props_cols = countries.columns.tolist()
countries.columns = countries.columns.map(to_concept_id)
all_entities = extract_economy_entities(countries, domains, groups)

Expand Down Expand Up @@ -281,6 +281,10 @@ def main():
concept_discrete = [c for c in concepts if c.concept_type != 'measure']
for c in extract_concept_entities(eco_domain):
concept_discrete.append(c)
# append concepts in country properties
for c in country_props_cols:
if c != 'Name': # Name is already included, no need to add it twice
concept_discrete.append(Concept(id=to_concept_id(c), concept_type='string', props=dict(name=c)))
# hard code the `year` and `domain` concept
concept_discrete.append(
Concept(id='year', concept_type='time', props=dict(name='Year')))
Expand Down

0 comments on commit 91b9bf3

Please sign in to comment.