Explicit removal of NoneType CURIE Ids
Browse files- oaklib_utils.py +2 -1
oaklib_utils.py
CHANGED
@@ -20,5 +20,6 @@ def get_candidates(term: str, top_k: int = 10) -> list[tuple[str, str]]:
|
|
20 |
|
21 |
# Keep both URI and standard terms for "explainable" output
|
22 |
# But first convert CURIE IDs to URIs
|
23 |
-
|
|
|
24 |
return candidates
|
|
|
20 |
|
21 |
# Keep both URI and standard terms for "explainable" output
|
22 |
# But first convert CURIE IDs to URIs
|
23 |
+
# Add explicit if clause because I saw sometimes the curies were None
|
24 |
+
candidates = list((adapter.curie_to_uri(curie), term) for (curie, term) in labels if curie is not None)
|
25 |
return candidates
|