get_iri(prefix, identifier=None, *, priority=None, prefix_map=None, use_bioregistry_io=True, provider=None)[source]

Get the best link for the CURIE, if possible.

  • prefix (str) – The prefix in the CURIE

  • identifier (Optional[str]) – The identifier in the CURIE. If identifier is given as None, then this function will assume that the first argument (prefix) is actually a full CURIE.

  • priority (Optional[Sequence[str]]) –

    A user-defined priority list. In addition to the metaprefixes in the Bioregistry corresponding to resources that are resolvers/lookup services, you can also use default to correspond to the first-party IRI and custom to refer to the custom prefix map. The default priority list is:

    1. Custom prefix map (custom) 1. First-party IRI (default) 2. / MIRIAM (miriam) 3. Ontology Lookup Service (ols) 4. OBO PURL (obofoundry) 5. Name-to-Thing (n2t) 6. BioPortal (bioportal)

  • prefix_map (Optional[Mapping[str, str]]) – A custom prefix map to go with the custom key in the priority list

  • use_bioregistry_io (bool) – Should the bioregistry resolution IRI be used? Defaults to true.

  • provider (Optional[str]) – The provider code to use for a custom provider

Return type



The best possible IRI that can be generated based on the priority list.

A pre-parse CURIE can be given as the first two arguments >>> get_iri(“chebi”, “24867”) ‘

A CURIE can be given directly as a single argument >>> get_iri(“chebi:24867”) ‘’

A priority list can be given >>> priority = [“obofoundry”, “default”, “bioregistry”] >>> get_iri(“chebi:24867”, priority=priority) ‘’

A custom prefix map can be supplied. >>> prefix_map = {“chebi”: “”} >>> get_iri(“chebi:24867”, prefix_map=prefix_map) ‘’ >>> get_iri(“fbbt:00007294”) ‘’

A custom prefix map can be supplied in combination with a priority list >>> prefix_map = {“lipidmaps”: “”} >>> priority = [“obofoundry”, “custom”, “default”, “bioregistry”] >>> get_iri(“chebi:24867”, prefix_map=prefix_map, priority=priority) ‘’ >>> get_iri(“lipidmaps:1234”, prefix_map=prefix_map, priority=priority) ‘’

A custom provider is given, which makes the Bioregistry very extensible >>> get_iri(“chebi:24867”, provider=”chebi-img”) ‘’