Skip to content

Commit 9d49781

Browse files
authored
Merge pull request #402 from broadinstitute/jb-ncbi-taxon-complete
Use fallback validation to OLS for taxon ID (SCP-6070)
2 parents a52b3bd + 579c257 commit 9d49781

File tree

12 files changed

+43
-3
lines changed

12 files changed

+43
-3
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ source env/bin/activate
2929
pip install -r requirements.txt
3030
source scripts/setup-mongo-dev.sh
3131
```
32+
Note: if you encounter the following error:
33+
```
34+
AttributeError: module 'coverage' has no attribute 'types'
35+
```
36+
You can run the following to address this:
37+
```
38+
pip install --upgrade coverage
39+
```
3240

3341
### Docker
3442

5.34 KB
Binary file not shown.
1.01 KB
Binary file not shown.
359 Bytes
Binary file not shown.
1.46 KB
Binary file not shown.
9.13 KB
Binary file not shown.
475 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1752088054 # validation cache key
1+
1764096355 # validation cache key

ingest/validation/validate_metadata.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,17 @@ def retrieve_label_and_synonyms(
476476
:param property_type: attribute type for term (string, array, boolean)
477477
"""
478478
ontology_name = re.split("[_:]", ontology_id)[0].lower()
479-
if ontology_is_local(ontology_name):
479+
# use OLS fallback for taxon IDs since minified version is not authoritative
480+
use_fallback = ontology_name == "ncbitaxon"
481+
if ontology_is_local(ontology_name) and not use_fallback:
480482
return minified_reader.find_ontology_entry(ontology_name, ontology_id, property_name)
483+
elif ontology_is_local(ontology_name) and use_fallback:
484+
try:
485+
return minified_reader.find_ontology_entry(ontology_name, ontology_id, property_name)
486+
except ValueError:
487+
return retriever.retrieve_ontology_term_label_and_synonyms(
488+
ontology_id, property_name, convention, property_type
489+
)
481490
else:
482491
return retriever.retrieve_ontology_term_label_and_synonyms(
483492
ontology_id, property_name, convention, property_type

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ cellarium-cas[vis]==1.4.11
1818

1919
# Dev dependencies
2020
pytest==7.2.1
21-
coverage==4.5.3
21+
coverage==7.12.0
2222
pytest-xdist==1.29.0
2323
pre-commit==1.18.1
2424
black==24.3.0

0 commit comments

Comments
 (0)