from_bioportal
- from_bioportal(ontology_1: str, ontology_2: str, *, converter: curies.Converter, client: ontoportal_client.BioPortalClient | None = None, progress: bool = False) list[SemanticMapping][source]
Get mappings from BioPortal.
- Parameters:
ontology_1 – The OntoPortal instance’s key for the first ontology. Note that this might not be the standard key/prefix, e.g., that’s in the Bioregistry.
ontology_2 – The OntoPortal instance’s key for the second ontology. Note that this might not be the standard key/prefix, e.g., that’s in the Bioregistry.
converter – A converter for parsing URIs
client – A pre-instantiated BioPortal client. If not given, will try to automatically construct one. Note that this requires having an API key configured.
- Returns:
A list of semantic mappings.
Warning
BioPortal doesn’t provide an option to only return mappings between entities defined in the two given ontologies. For example, if you ask for mappings between
SNOMEDCTandAERO, you will also get mappings between OGMS and SNOMEDCT (because OGMS terms are imported in AERO).This means that you should probably apply post-hoc filtering to only retain relevant mappings.
Simple usage:
import bioregistry from sssom_pydantic.contrib.ontoportal import from_bioportal converter = bioregistry.get_converter() mappings = from_bioportal("SNOMEDCT", "AERO", converter=converter)
Usage with explicitly defined converter, which implicitly filters only to relevant mappings:
import curies from sssom_pydantic.contrib.ontoportal import from_bioportal converter = curies.Converter.from_prefix_map( { "AERO": "http://purl.obolibrary.org/obo/AERO_", "SNOMEDCT": "http://purl.bioontology.org/ontology/SNOMEDCT/", } ) mappings = from_bioportal("SNOMEDCT", "AERO", converter=converter)