Getting and Writing Semantic Mappings

I/O functions for SeMRA.

Functions

from_bioontologies(prefix[, confidence])

Get mappings from a given ontology via bioontologies.

from_cache_df(path, source_prefix, *[, ...])

Get mappings from a pyobo-flavored cache file.

from_digraph(graph)

Extract mappings from a simple directed graph data model.

from_jsonl(-> list[~semra.struct.Mapping])

Read a list of Mapping objects from a JSONL file.

from_multidigraph(graph)

Extract mappings from a multi-directed graph data model.

from_pickle(path)

Read the mappings from a pickle.

from_pyobo(prefix[, target_prefix, ...])

Get mappings from a given ontology via pyobo.

from_sssom(path, *[, mapping_set_id, ...])

Get mappings from a path to a SSSOM TSV file.

from_sssom_df(df, *[, mapping_set_id, ...])

Get mappings from a SSSOM dataframe.

get_sssom_df(mappings, *[, add_labels, prune])

Get a SSSOM dataframe.

to_digraph(mappings)

Convert mappings into a simple directed graph data model.

to_multidigraph(mappings, *[, progress])

Convert mappings into a multi directed graph data model.

write_jsonl(-> None)

Write a list of Pydantic objects into a JSONL file.

write_neo4j(mappings, directory, *[, ...])

Write all files needed to construct a Neo4j graph database from a set of mappings.

write_pickle(mappings, path)

Write the mappings as a pickle.

write_sssom(...)

Export mappings as an SSSOM file (could be lossy).