ebi-ait / ebi-ait/ingest-graph-validator
20220207: Unit comes with a value associated
- Dominant language
- Python
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the issue**
As a data wrangler, I would like to ensure that units are always associated with a value.
**Test template**
- Test name: Unit has value associated
- Test Description: Ensure that any unit-related field has a value associated with the unit, otherwise throw an error
- Cypher query:
```
MATCH (b)
WITH b, keys(b) as fields
WHERE any(field IN fields WHERE field CONTAINS "unit")
WITH b, [field IN fields WHERE field contains "unit"] as unit_fields, [field IN fields WHERE NOT field contains "unit"] as no_unit_fields
WHERE NOT ANY(u in unit_fields WHERE any(n in no_unit_fields where u contains n))
return b, "Missing unit values", labels(b)
```
** Acceptance criteria**
- [ ] The test has been reviewed
- [ ] The test has been implemented into the `graph_test_set` folder
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.