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

procedures to combine a few indicators into one #55

Open
semio opened this issue Mar 23, 2017 · 0 comments
Open

procedures to combine a few indicators into one #55

semio opened this issue Mar 23, 2017 · 0 comments
Labels

Comments

@semio
Copy link
Owner

semio commented Mar 23, 2017

use case

For example, we have these indicators:

  • population_male by geo, year
  • population_female by geo, year
  • population_total by geo, year

and we want to combine these into one multidimensional indicator: population by gender, geo, year.

proposal

We need a procedure for combining indicators, as well as a procedure to extract entities from the combined result.

1. the combine_indicators procedure

procedure: combine_indicators
ingredients:
  - input_ingredient
result: output_ingredient
options:
    dictionary:  # a list of indicators to combine, can be inline or a json file
        new_indicator_1:
            - indicator: base_indicator_1_1
              entities:
                  gender: male
                  an_other_entity: foo
            - indicator: base_indicator_1_2
              entities:
                 gender: female
                 an_other_entity: bar
        new_indicator_2:
            - indicator: base_indicator_2_1
              entities:
                 gender: male
                 an_other_entity: foo
            - ...

Considering similar indicators have similar name pattern, we can add a pattern option

procedure: combine_indicators
ingredients:
 - input_ingredient
result: output_ingredient
options:
   pattern_dictionary:
       new_indicator_1:
           pattern: indicator_([0-9a-z]*)_([0-9a-z]*)  # will combine all indicators with this pattern.
           entities: ["gender", "an_other_entities"]  # assign the matched groups to the entities.

for above example, if we have 2 indicators:

  • indicator_male_foo
  • indicator_female_baz

then indicator_male_foo will be assigned gender = male and an_other_entities = foo and indicator_female_baz will be assigned gender = female and an_other_entities = baz

2. extract_entities

see #56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant