Skip to content

Commit

Permalink
Inline upgrading
Browse files Browse the repository at this point in the history
Related to #7
  • Loading branch information
cthoyt committed Nov 14, 2022
1 parent 65fdc83 commit 43fe70c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/bioontologies/obograph.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from tqdm.auto import tqdm
from typing_extensions import Literal

from . import upgrade
from .relations import ground_relation

__all__ = [
Expand Down Expand Up @@ -571,9 +570,11 @@ def _parse_obo_rel(s: str, identifier: str) -> Union[Tuple[str, str], Tuple[None
def _compress_uri_or_curie_or_str(
s: str, *, debug: bool = False
) -> Union[Tuple[str, str], Tuple[None, str]]:
from .upgrade import insert, upgrade

s = s.replace(" ", "")

cv = upgrade.upgrade(s)
cv = upgrade(s)
if cv:
return cv

Expand All @@ -593,7 +594,7 @@ def _compress_uri_or_curie_or_str(
if s.startswith(x):
prefix, identifier = ground_relation(s[len(x) :])
if prefix and identifier:
upgrade.insert(s, prefix, identifier)
insert(s, prefix, identifier)
return prefix, identifier
elif s not in WARNED:
tqdm.write(f"could not parse legacy RO: {s}")
Expand Down

0 comments on commit 43fe70c

Please sign in to comment.