Mapping Provider

Synopsis

>>> DIGIT = 'UBERON:0002544'
>>> oi = OlsImplementation()
>>> for m in oi.get_sssom_mappings_by_curie(DIGIT):
>>>     print(f'{m.subject_id} <-> {m.object_id}')

About

This interface provides a “mappings” abstraction.

The central datamodel used here is SSSOM

Note

This interface is for serving pre-calculated mappings. See sssom_utils for on-the-fly mapping creation

Warning

Some aspects may change, in particular how symmetrical mappings are handled

Implementations

  • BioportalImplementation

    • uses the BioPortal API endpoint, which has pregenerated mappings using LOOM

    • requires an APIkey

    • implements a small subset of SSSOM fields

    • match types are unspecified

  • :ref:.OlsImplementation` currently implements a subset of SSSOM fields

    • uses the OLS OxO API endpoint, which serves mappings that are provided by source ontologies

    • implements a subset of SSSOM fields

    • the original source is provided

  • Others

    • Most other implementations provide this but only serve up limited SSSOM metadata, as only the base triple is stored

    • .ProntoImplementation

    • .SqlImplementation

    • .UbergraphImplementation

    • .OntobeeImplementation

Command Line Use

runoak -i bioportal: term-mappings UBERON:0002101  -O sssom -o limb-mappings.sssom.tsv

Code

Example

Autodoc

class oaklib.interfaces.mapping_provider_interface.MappingProviderInterface(resource: Optional[oaklib.resource.OntologyResource] = None, strict: bool = False)[source]

An ontology provider that provides SSSOM mappings

TODO: move code from mapping-walker

all_sssom_mappings(subject_or_object_source: Optional[str] = None) Iterable[sssom_schema.datamodel.sssom_schema.Mapping][source]

Deprecated since version Replaced: by sssom_mappings()

get_sssom_mappings_by_curie(curie: str) Iterable[sssom_schema.datamodel.sssom_schema.Mapping][source]

All SSSOM mappings about a curie

MUST yield mappings where EITHER subject OR object equals the CURIE

Parameters

curie

Returns

Deprecated since version Use: sssom_mappings()

get_transitive_mappings_by_curie(curie: str) Iterable[sssom_schema.datamodel.sssom_schema.Mapping][source]
Parameters

curie

Returns

sssom_mappings(curie: Optional[str] = None, source: Optional[str] = None) Iterable[sssom_schema.datamodel.sssom_schema.Mapping][source]

returns all sssom mappings matching filter conditions

Parameters
  • curie

  • source

Returns

sssom_mappings_by_source(subject_or_object_source: Optional[str] = None) Iterable[sssom_schema.datamodel.sssom_schema.Mapping][source]

All SSSOM mappings in the ontology

The subject_id MUST be a CURIE in the ontology

Parameters

object_source

Returns