openownership / lib-cove-bods

Check that your data complies with the Beneficial Ownership Data Standard (BODS) using our install our data review library to analyse files via your command line interface
https://datareview.openownership.org/
Other
1 stars 0 forks source link

Additional check: entitySubtype aligns with entityType #82

Closed kd-ods closed 1 month ago

kd-ods commented 2 years ago

Check: Where entitySubtype.generalCategory has a non-empty value, the first part of its value (up to the dash) is the same as the value of entityType. (See the codelists.)

Error message: "The specified entitySubtype is not valid for the specified entityType."

odscjames commented 2 years ago

Applying to 0.3+ only

Blueskies00 commented 2 years ago

Tests: https://docs.google.com/spreadsheets/d/1NtLpEI6ejQA9dPMJI1tYxFG2PsKmxwyhnfwmbWPIv1g/edit#gid=1978293582

  1. entityType = state AND entitySubtype/generalCategory = stateBody-governmentDepartment Expected result: Error warning - entityType does not align with entitySubtype. Actual result: No validation error. Additional check flagged: "The specified entitySubtype is not valid for the specified entityType. " Comments: Test: PASSED ACTIONS: None
  2. entityType = stateBody AND entitySubtype/generalCategory = null Expected result: No error. Actual result: Validation Error: "entitySubtype/generalCategory is missing but required. Check that the field is included and correctly spelled." Comments: This appears to suffer from a lack of guidance in the schema. The entityType guidance does not state that subtype is required when the type is stateBody. Test: INCONCLUSIVE ACTIONS: Decide whether subtype is required when entityType is stateBody and update the schema reference. If not required, then this check isn't required either.
  3. entityType = stateBody AND entitySubtype/generalCategory = stateBody-stateAgency Expected result: No error. Actual result: No error. Comments: Test: PASSED ACTIONS: None.
  4. entityType = stateBody AND entitySubtype/generalCategory = stateBody-other Expected result: No error. Actual result: No error. Comments: Test: PASSED ACTIONS: None.
  5. entityType = legalEntity AND entitySubtype/generalCategory = stateBody-other Expected result: Error warning - entityType does not align with entitySubtype. Actual result: No validation error. Additional check flagged: "The specified entitySubtype is not valid for the specified entityType. " Comments: Test: PASSED ACTIONS: None
  6. entityType = state AND entitySubtype/generalCategory = state-governmentDepartment Expected result: Error warning - subtype isn't in codelist. Actual result: Validation Error: "entitySubtype/generalCategory contains an unrecognised value. Check the related codelist for allowed code values." Comments: Test: PASSED ACTIONS: None.
  7. entityType = stateBody AND entitySubtype/generalCategory = lawEnforcement Expected result: Error warning - entityType does not align with entitySubtype. Error warning - subtype isn't in codelist. Actual result: Validation Error: "entitySubtype/generalCategory contains an unrecognised value. Check the related codelist for allowed code values." Additional check flagged: "The specified entitySubtype is not valid for the specified entityType. " Comments: Test: PASSED ACTIONS: None.
  8. entityType = legalEntity AND entitySubtype/generalCategory = legalEntity-PLC Expected result: Error warning - subtype isn't in codelist. Actual result: Validation Error: entitySubtype/generalCategory contains an unrecognised value. Check the related codelist for allowed code values. Comments: entityType and subtype align in this test. Test: PASSED ACTIONS: None.
  9. entityType = stateBody AND entitySubtype/generalCategory = stateBody-supremeCourt Expected result: Error warning - subtype isn't in codelist. Actual result: Validation Error: entitySubtype/generalCategory contains an unrecognised value. Check the related codelist for allowed code values. Comments: entityType and subtype align in this test. Test: PASSED ACTIONS: None.

@kd-ods Just one action from test number 2 to decide on.

kd-ods commented 2 years ago

Thanks, @Blueskies00.

On (2), the entitySubtype field in Entity Statements isn't required, but - if it is included - then entitySubtype.generalCategory is required. So this is expected behaviour. No further action is needed

Blueskies00 commented 2 years ago

Having spoken to Kadie, I agree that test 2 is fine!