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

WRONG_ENTITY_IS_HEADER rule providing #82

Closed
buchslava opened this issue May 5, 2016 · 1 comment
Closed

WRONG_ENTITY_IS_HEADER rule providing #82

buchslava opened this issue May 5, 2016 · 1 comment

Comments

@buchslava
Copy link
Collaborator

  • Rule name: Should be filled if this issue depends on particular rule especially during new rule creation. This name should be a valid JS variable name and should be used for connecting with code.

WRONG_ENTITY_IS_HEADER

  • Rule test folder: Should be filled if type of Request is rule. Needed for documentation auto generation.

test/fixtures/rules-cases/wrong-entity-is-header

  • Rule description: Should be filled if type of Request is rule. Needed for documentation auto generation.

An issue according to this rule will be fired when is-header in concept is defined and not valid: not a concept with entity_set type

  • Examples of correct data:

ddf--concepts.csv

"concept","name","concept_type","domain",
"income_groups","Income groups","entity_set","geo",
"geo","Geographic location","entity_domain",,

and
ddf--entities--geo--income_groups.csv

income_groups,name,gwid,is--income_groups
high_income,High income,i268,TRUE
lower_middle_income,Lower middle income,i269,TRUE
low_income,Low income,i266,TRUE
upper_middle_income,Upper middle income,i267,TRUE
  • Examples of incorrect data:

ddf--concepts.csv

"concept","name","concept_type","domain",
"income_groups","Income groups","entity_set","geo",
"geo","Geographic location","entity_domain",,

and
ddf--entities--geo--income_groups.csv

income_groups,name,gwid,is--foo_groups
high_income,High income,i268,TRUE
lower_middle_income,Lower middle income,i269,TRUE
low_income,Low income,i266,TRUE
upper_middle_income,Upper middle income,i267,TRUE
  • Scenarios Should be filled if type of Request is rule.
when dataset is correct
  any issue should NOT be found for this rule
when dataset is NOT correct
  issues in accordance with wrong is-headers quantity should be detected for this rule
  output data for any issue should be expected
  • Output data format Additional data that depends on particular issue type. Should be filled if type of Request is rule.

file, wrong header

@jheeffer
Copy link
Member

jheeffer commented May 6, 2016

To be clear:

is--header is not mandatory anywhere, absence just means all entities have value false for that is--header.

only error when: is--xxx is used when xxx is not defined in concepts as an entity_set. No other case should give an error.

error when:

  • is--xxx is used when xxx is not defined in concepts as an entity_set.
  • is--xxx is used when xxx is an entity set which is not in the same domain as the primary key of the file

So the following is invalid (because country is not a set in income_groups and another_income_group is not an entity set):
ddf--concepts.csv

"concept","name","concept_type","domain"
"income_groups","Income groups","entity_domain",
"another_income_group","Another Income Group","string",
"geo","Geographic location","entity_domain",
"country","Country","entity_set","geo"

incomegroups.csv

income_groups,name,gwid,is--country,is--another_income_group
high_income,High income,i268,FALSE,TRUE
lower_middle_income,Lower middle income,i269,FALSE,TRUE
low_income,Low income,i266,TRUE,TRUE
upper_middle_income,Upper middle income,i267,TRUE,FALSE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment