get_uri_prefix

get_uri_prefix(prefix: str, *, priority: Sequence[str] | None = None, strict: Literal[False] = False) str | None[source]
get_uri_prefix(prefix: str, *, priority: Sequence[str] | None = None, strict: Literal[True] = False) str

Get a well-formed URI prefix for usage in a prefix map.

Parameters:
  • prefix – The prefix to lookup.

  • priority – The prioirty order for get_format().

  • strict – If true, will error on a missing value

Returns:

The URI prefix. Similar to what’s returned by bioregistry.get_format(), but it MUST have only one $1 and end with $1 to use thie function.

>>> import bioregistry
>>> bioregistry.get_uri_prefix("chebi")
'http://purl.obolibrary.org/obo/CHEBI_'