Skip to content

Commit

Permalink
Update basic_ontology_interface.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Oct 13, 2023
1 parent 78e7309 commit 890b834
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/oaklib/interfaces/basic_ontology_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,7 @@ def uri_to_curie(
:param use_uri_fallback: if cannot be contracted, use the URI as a CURIE proxy [default: True]
:return: contracted URI, or original URI if no contraction possible
"""
rv = self.converter.compress(uri)
if use_uri_fallback:
strict = False
rv = self.converter.compress(uri, passthrough=use_uri_fallback)
if rv is None and strict:
prefix_map_text = "\n".join(
f" {prefix} -> {uri_prefix}"
Expand All @@ -279,8 +277,6 @@ def uri_to_curie(
f"{self.__class__.__name__}.prefix_map() does not support compressing {uri}.\n"
f"This ontology interface contains {len(self.prefix_map()):,} prefixes:\n{prefix_map_text}"
)
if rv is None and use_uri_fallback:
return uri
return rv

@property
Expand Down

0 comments on commit 890b834

Please sign in to comment.