Obo

class Obo(date=<factory>, data_version=None, force=False)[source]

Bases: object

An OBO document.

Attributes Summary

auto_generated_by

An annotation about how an ontology was generated

bioversions_key

check_bioregistry_prefix

Should the prefix be validated against the Bioregistry?

data_version

The ontology version

date

The date the ontology was generated

date_formatted

Get the date as a formatted string.

dynamic_version

Set to true for resources that are unversioned/very dynamic, like MGI

edges_header

Header for the edges dataframe.

force

Should this ontology be reloaded?

hierarchy

A graph representing the parent/child relationships between the entities.

idspaces

The idspaces used in the document

imports

iter_only

For super-sized datasets that shouldn't be read into memory

literal_properties_header

Property dataframe header.

name

The name of the ontology.

nodes_header

Get the header for nodes.

object_properties_header

Property dataframe header.

ontology

The prefix for the ontology

ontology_iri

ontology_version_iri

properties_header

Property dataframe header.

property_values

relations_header

Header for the relations dataframe.

root_terms

Root terms to use for the ontology

skip_maintainers

Allow skipping adding maintainers annotations, in case the resource maintainers don't want their names associated with the OWL exports that e.g. end up on EBI OLS.

static_version

Set to a static version for the resource (i.e., the resource is not itself versioned)

subsetdefs

synonym_typedefs

Synonym type definitions

typedefs

Type definitions

Methods Summary

ancestors(identifier)

Return a set of identifiers for parents of the given identifier.

cli(*args)

Run the CLI for this class.

descendants(identifier)

Return a set of identifiers for the children of the given identifier.

get_cls_cli()

Get the CLI for this class.

get_edges_df(*[, use_tqdm])

Get an edges dataframe.

get_filtered_multixrefs_mapping(prefix, *[, ...])

Get filtered xrefs as a dictionary.

get_filtered_properties_df(prop, *[, use_tqdm])

Get a dataframe of terms' identifiers to the given property's values.

get_filtered_properties_mapping(prop, *[, ...])

Get a mapping from a term's identifier to the property.

get_filtered_properties_multimapping(prop, *)

Get a mapping from a term's identifier to the property values.

get_filtered_relations_df(relation, *[, ...])

Get a specific relation from OBO.

get_filtered_xrefs_mapping(prefix, *[, use_tqdm])

Get filtered xrefs as a dictionary.

get_grounder()

Get a grounder from this ontology.

get_id_alts_mapping()

Get a mapping from identifiers to a list of alternative identifiers.

get_id_definition_mapping(*[, use_tqdm])

Get a mapping from identifiers to definitions.

get_id_multirelations_mapping(typedef, *[, ...])

Get a mapping from identifiers to a list of all references for the given relation.

get_id_name_mapping(*[, use_tqdm])

Get a mapping from identifiers to names.

get_id_species_mapping(*[, prefix, use_tqdm])

Get a mapping from identifiers to species.

get_id_synonyms_mapping(*[, use_tqdm])

Get a mapping from identifiers to a list of sorted synonym strings.

get_ids(*[, use_tqdm])

Get the set of identifiers.

get_literal_mappings()

Get literal mappings in a standard data model.

get_literal_mappings_df()

Get a literal mappings dataframe.

get_literal_properties_df(*[, use_tqdm])

Get all properties as a dataframe.

get_mappings_df(*[, use_tqdm])

Get a dataframe with SSSOM extracted from the OBO document.

get_metadata()

Get metadata.

get_object_properties_df(*[, use_tqdm])

Get all properties as a dataframe.

get_obsolete(*[, use_tqdm])

Get the set of obsolete identifiers.

get_properties_df(*[, use_tqdm, drop_na])

Get all properties as a dataframe.

get_relation(source_identifier, relation, ...)

Get the value for a bijective relation mapping between this resource and a target resource.

get_relation_mapping(relation, target_prefix, *)

Get a mapping from the term's identifier to the target's identifier.

get_relation_multimapping(relation, ...[, ...])

Get a mapping from the term's identifier to the target's identifiers.

get_relations_df(*[, use_tqdm])

Get all relations from the OBO.

get_semantic_mappings(*[, progress])

Iterate over semantic mappings.

get_typedef_df([use_tqdm])

Get a typedef dataframe.

get_typedef_id_name_mapping()

Get a mapping from typedefs' identifiers to names.

is_descendant(descendant, ancestor)

Return if the given identifier is a descendant of the ancestor.

iter_literal_properties(*[, use_tqdm])

Iterate over literal properties quads.

iter_object_properties(*[, use_tqdm])

Iterate over object property triples.

iter_relation_rows([use_tqdm])

Iterate the relations' rows.

iter_terms([force])

Iterate over terms in this ontology.

iter_typedef_id_name()

Iterate over typedefs' identifiers and their respective names.

iterate_alt_rows()

Iterate over pairs of terms' primary identifiers and alternate identifiers.

iterate_alts()

Iterate over alternative identifiers.

iterate_edge_rows([use_tqdm])

Iterate the edge rows.

iterate_edges(*[, use_tqdm, include_xrefs])

Iterate over triples of terms, relations, and their targets.

iterate_filtered_properties(prop, *[, use_tqdm])

Iterate over tuples of terms and the values for the given property.

iterate_filtered_relations(relation, *[, ...])

Iterate over tuples of terms and ther targets for the given relation.

iterate_filtered_relations_filtered_targets(...)

Iterate over relationships between one identifier and another.

iterate_filtered_xrefs(prefix, *[, use_tqdm])

Iterate over xrefs to a given prefix.

iterate_id_definition(*[, use_tqdm])

Iterate over pairs of terms' identifiers and their respective definitions.

iterate_id_name(*[, use_tqdm])

Iterate identifier name pairs.

iterate_id_species(*[, prefix, use_tqdm])

Iterate over terms' identifiers and respective species (if available).

iterate_ids(*[, use_tqdm])

Iterate over identifiers.

iterate_literal_mapping_rows()

Iterate over literal mapping rows.

iterate_node_rows([sep])

Get a nodes iterator appropriate for serialization.

iterate_obo_lines([emit_object_properties, ...])

Iterate over the lines to write in an OBO file.

iterate_properties(*[, use_tqdm])

Iterate over tuples of terms, properties, and their values.

iterate_references(*[, use_tqdm])

Iterate over identifiers.

iterate_relations(*[, use_tqdm])

Iterate over tuples of terms, relations, and their targets.

iterate_synonym_rows(*[, use_tqdm])

Iterate over pairs of identifier and synonym text.

iterate_synonyms(*[, use_tqdm])

Iterate over pairs of term and synonym object.

iterate_xrefs(*[, use_tqdm])

Iterate over xrefs.

to_obonet(*[, use_tqdm])

Export as a :mod`obonet` style graph.

write_cache(*[, force])

Write cache parts.

write_default([use_tqdm, force, write_obo, ...])

Write the OBO to the default path.

write_edges(path)

Write a edges TSV file.

write_metadata()

Write the metadata JSON file.

write_nodes(path)

Write a nodes TSV file.

write_obo([file, use_tqdm, ...])

Write the OBO to a file.

write_obograph(path, *[, converter])

Write OBO Graph JSON.

write_obonet_gz(path)

Write the OBO to a gzipped dump in Obonet JSON.

write_ofn(path)

Write as Functional OWL (OFN).

write_owl(path)

Write OWL, by first outputting OFN then converting with ROBOT.

write_prefix_map()

Write a prefix map file that includes all prefixes used in this ontology.

write_rdf(path)

Write as Turtle RDF.

Attributes Documentation

Parameters:
auto_generated_by: ClassVar[str | None] = None

An annotation about how an ontology was generated

bioversions_key: ClassVar[str | None] = None
check_bioregistry_prefix: ClassVar[bool] = True

Should the prefix be validated against the Bioregistry?

data_version: str | None = None

The ontology version

date: datetime | None = <dataclasses._MISSING_TYPE object>

The date the ontology was generated

date_formatted

Get the date as a formatted string.

dynamic_version: ClassVar[bool] = False

Set to true for resources that are unversioned/very dynamic, like MGI

edges_header

Header for the edges dataframe.

force: bool = False

Should this ontology be reloaded?

hierarchy

A graph representing the parent/child relationships between the entities.

To get all children of a given entity, do:

from pyobo import get_ontology

obo = get_ontology("go")

identifier = "1905571"  # interleukin-10 receptor complex
is_complex = "0032991" in nx.descendants(obo.hierarchy, identifier)  # should be true
idspaces: ClassVar[Mapping[str, str] | None] = None

The idspaces used in the document

imports: ClassVar[list[str] | None] = None
iter_only: ClassVar[bool] = False

For super-sized datasets that shouldn’t be read into memory

literal_properties_header

Property dataframe header.

name: ClassVar[str | None] = None

The name of the ontology. If not given, tries looking up with the Bioregistry.

nodes_header

Get the header for nodes.

object_properties_header

Property dataframe header.

ontology: ClassVar[str] = <dataclasses._MISSING_TYPE object>

The prefix for the ontology

ontology_iri: ClassVar[str | None] = None
ontology_version_iri: ClassVar[str | None] = None
properties_header

Property dataframe header.

property_values: ClassVar[list[Annotation] | None] = None
relations_header

Header for the relations dataframe.

root_terms: ClassVar[list[NormalizedNamableReference] | None] = None

Root terms to use for the ontology

skip_maintainers: ClassVar[bool] = False

Allow skipping adding maintainers annotations, in case the resource maintainers don’t want their names associated with the OWL exports that e.g. end up on EBI OLS

static_version: ClassVar[str | None] = None

Set to a static version for the resource (i.e., the resource is not itself versioned)

subsetdefs: ClassVar[dict[NormalizedNamableReference, str] | None] = None
synonym_typedefs: ClassVar[list[SynonymTypeDef] | None] = None

Synonym type definitions

typedefs: ClassVar[list[TypeDef] | None] = None

Type definitions

Methods Documentation

ancestors(identifier)[source]

Return a set of identifiers for parents of the given identifier.

Parameters:

identifier (str)

Return type:

set[str]

classmethod cli(*args)[source]

Run the CLI for this class.

Parameters:

args (Any)

Return type:

Any

descendants(identifier)[source]

Return a set of identifiers for the children of the given identifier.

Parameters:

identifier (str)

Return type:

set[str]

classmethod get_cls_cli()[source]

Get the CLI for this class.

Return type:

Command

get_edges_df(*, use_tqdm=False)[source]

Get an edges dataframe.

Parameters:

use_tqdm (bool)

Return type:

DataFrame

get_filtered_multixrefs_mapping(prefix, *, use_tqdm=False)[source]

Get filtered xrefs as a dictionary.

Parameters:
Return type:

Mapping[str, list[str]]

get_filtered_properties_df(prop, *, use_tqdm=False)[source]

Get a dataframe of terms’ identifiers to the given property’s values.

Parameters:
  • prop (NormalizedNamableReference | Referenced | Reference | NamedReference | tuple[str, str] | str)

  • use_tqdm (bool)

Return type:

DataFrame

get_filtered_properties_mapping(prop, *, use_tqdm=False)[source]

Get a mapping from a term’s identifier to the property.

Warning

Assumes there’s only one version of the property for each term.

Parameters:
  • prop (NormalizedNamableReference | Referenced | Reference | NamedReference | tuple[str, str] | str)

  • use_tqdm (bool)

Return type:

Mapping[str, str]

get_filtered_properties_multimapping(prop, *, use_tqdm=False)[source]

Get a mapping from a term’s identifier to the property values.

Parameters:
  • prop (NormalizedNamableReference | Referenced | Reference | NamedReference | tuple[str, str] | str)

  • use_tqdm (bool)

Return type:

Mapping[str, list[str]]

get_filtered_relations_df(relation, *, use_tqdm=False)[source]

Get a specific relation from OBO.

Parameters:
  • relation (NormalizedNamableReference | Referenced | Reference | NamedReference | tuple[str, str] | str)

  • use_tqdm (bool)

Return type:

DataFrame

get_filtered_xrefs_mapping(prefix, *, use_tqdm=False)[source]

Get filtered xrefs as a dictionary.

Parameters:
Return type:

Mapping[str, str]

get_grounder()[source]

Get a grounder from this ontology.

Returns:

An object that can be used for named entity recognition and named entity normalization

Return type:

Grounder

Here’s example usage for a built-in ontology:

import pyobo
import ssslm

ontology = pyobo.get_ontology("taxrank")
grounder: ssslm.Grounder = ontology.get_grounder()
matches: list[ssslm.Match] = grounder.ground("species")

Here’s example usage for a custom ontology:

import pyobo
import ssslm
from urllib.request import urlretrieve

url = "http://purl.obolibrary.org/obo/taxrank.obo"
path = "taxrank.obo"
urlretrieve(url, path)

ontology = pyobo.from_obo_path(path, prefix="taxrank")
grounder: ssslm.Grounder = ontology.get_grounder()
matches: list[ssslm.Match] = grounder.get_matches("species")

Warning

It’s required to tell PyOBO the prefix for a custom ontology when using pyobo.from_obo_path(), and it must be registered in the Bioregistry

get_id_alts_mapping()[source]

Get a mapping from identifiers to a list of alternative identifiers.

Return type:

Mapping[str, list[str]]

get_id_definition_mapping(*, use_tqdm=False)[source]

Get a mapping from identifiers to definitions.

Parameters:

use_tqdm (bool)

Return type:

Mapping[str, str]

get_id_multirelations_mapping(typedef, *, use_tqdm=False)[source]

Get a mapping from identifiers to a list of all references for the given relation.

Parameters:
  • typedef (NormalizedNamableReference | Referenced | Reference | NamedReference | tuple[str, str] | str)

  • use_tqdm (bool)

Return type:

Mapping[str, list[NormalizedNamableReference]]

get_id_name_mapping(*, use_tqdm=False)[source]

Get a mapping from identifiers to names.

Parameters:

use_tqdm (bool)

Return type:

Mapping[str, str]

get_id_species_mapping(*, prefix=None, use_tqdm=False)[source]

Get a mapping from identifiers to species.

Parameters:
  • prefix (str | None)

  • use_tqdm (bool)

Return type:

Mapping[str, str]

get_id_synonyms_mapping(*, use_tqdm=False)[source]

Get a mapping from identifiers to a list of sorted synonym strings.

Parameters:

use_tqdm (bool)

Return type:

Mapping[str, list[str]]

get_ids(*, use_tqdm=False)[source]

Get the set of identifiers.

Parameters:

use_tqdm (bool)

Return type:

set[str]

get_literal_mappings()[source]

Get literal mappings in a standard data model.

Return type:

Iterable[LiteralMapping]

get_literal_mappings_df()[source]

Get a literal mappings dataframe.

Return type:

DataFrame

get_literal_properties_df(*, use_tqdm=False)[source]

Get all properties as a dataframe.

Parameters:

use_tqdm (bool)

Return type:

DataFrame

get_mappings_df(*, use_tqdm=False)[source]

Get a dataframe with SSSOM extracted from the OBO document.

Parameters:

use_tqdm (bool) – Should a progres bar be shown

Returns:

A pandas dataframe representing SSSOM records

Return type:

DataFrame

get_metadata()[source]

Get metadata.

Return type:

dict[str, Any]

get_object_properties_df(*, use_tqdm=False)[source]

Get all properties as a dataframe.

Parameters:

use_tqdm (bool)

Return type:

DataFrame

get_obsolete(*, use_tqdm=False)[source]

Get the set of obsolete identifiers.

Parameters:

use_tqdm (bool)

Return type:

set[str]

get_properties_df(*, use_tqdm=False, drop_na=True)[source]

Get all properties as a dataframe.

Parameters:
Return type:

DataFrame

get_relation(source_identifier, relation, target_prefix, *, use_tqdm=False)[source]

Get the value for a bijective relation mapping between this resource and a target resource.

>>> from pyobo.sources.hgnc import HGNCGetter
>>> obo = HGNCGetter()
>>> human_mapt_hgnc_id = "6893"
>>> mouse_mapt_mgi_id = "97180"
>>> assert mouse_mapt_mgi_id == obo.get_relation(human_mapt_hgnc_id, "ro:HOM0000017", "mgi")
Parameters:
  • source_identifier (str)

  • relation (NormalizedNamableReference | Referenced | Reference | NamedReference | tuple[str, str] | str)

  • target_prefix (str)

  • use_tqdm (bool)

Return type:

str | None

get_relation_mapping(relation, target_prefix, *, use_tqdm=False)[source]

Get a mapping from the term’s identifier to the target’s identifier.

Warning

Assumes there’s only one version of the property for each term.

Example usage: get homology between HGNC and MGI:

>>> from pyobo.sources.hgnc import HGNCGetter
>>> obo = HGNCGetter()
>>> human_mapt_hgnc_id = "6893"
>>> mouse_mapt_mgi_id = "97180"
>>> hgnc_mgi_orthology_mapping = obo.get_relation_mapping("ro:HOM0000017", "mgi")
>>> assert mouse_mapt_mgi_id == hgnc_mgi_orthology_mapping[human_mapt_hgnc_id]
Parameters:
  • relation (NormalizedNamableReference | Referenced | Reference | NamedReference | tuple[str, str] | str)

  • target_prefix (str)

  • use_tqdm (bool)

Return type:

Mapping[str, str]

get_relation_multimapping(relation, target_prefix, *, use_tqdm=False)[source]

Get a mapping from the term’s identifier to the target’s identifiers.

Parameters:
  • relation (NormalizedNamableReference | Referenced | Reference | NamedReference | tuple[str, str] | str)

  • target_prefix (str)

  • use_tqdm (bool)

Return type:

Mapping[str, list[str]]

get_relations_df(*, use_tqdm=False)[source]

Get all relations from the OBO.

Parameters:

use_tqdm (bool)

Return type:

DataFrame

get_semantic_mappings(*, progress=False)[source]

Iterate over semantic mappings.

Parameters:

progress (bool)

Return type:

Iterable[SemanticMapping]

get_typedef_df(use_tqdm=False)[source]

Get a typedef dataframe.

Parameters:

use_tqdm (bool)

Return type:

DataFrame

get_typedef_id_name_mapping()[source]

Get a mapping from typedefs’ identifiers to names.

Return type:

Mapping[str, str]

is_descendant(descendant, ancestor)[source]

Return if the given identifier is a descendant of the ancestor.

from pyobo import get_ontology

obo = get_ontology("go")

interleukin_10_complex = "1905571"  # interleukin-10 receptor complex
all_complexes = "0032991"
assert obo.is_descendant("1905571", "0032991")
Parameters:
  • descendant (str)

  • ancestor (str)

Return type:

bool

iter_literal_properties(*, use_tqdm=False)[source]

Iterate over literal properties quads.

Parameters:

use_tqdm (bool)

Return type:

Iterable[tuple[str, str, str, str, str]]

iter_object_properties(*, use_tqdm=False)[source]

Iterate over object property triples.

Parameters:

use_tqdm (bool)

Return type:

Iterable[tuple[str, str, str]]

iter_relation_rows(use_tqdm=False)[source]

Iterate the relations’ rows.

Parameters:

use_tqdm (bool)

Return type:

Iterable[tuple[str, str, str, str, str]]

iter_terms(force=False)[source]

Iterate over terms in this ontology.

Parameters:

force (bool)

Return type:

Iterable[Term]

iter_typedef_id_name()[source]

Iterate over typedefs’ identifiers and their respective names.

Return type:

Iterable[tuple[str, str | None]]

iterate_alt_rows()[source]

Iterate over pairs of terms’ primary identifiers and alternate identifiers.

Return type:

Iterable[tuple[str, str]]

iterate_alts()[source]

Iterate over alternative identifiers.

Return type:

Iterable[tuple[Stanza, NormalizedNamableReference]]

iterate_edge_rows(use_tqdm=False)[source]

Iterate the edge rows.

Parameters:

use_tqdm (bool)

Return type:

Iterable[tuple[str, str, str]]

iterate_edges(*, use_tqdm=False, include_xrefs=True)[source]

Iterate over triples of terms, relations, and their targets.

Parameters:
Return type:

Iterable[tuple[Stanza, TypeDef, NormalizedNamableReference]]

iterate_filtered_properties(prop, *, use_tqdm=False)[source]

Iterate over tuples of terms and the values for the given property.

Parameters:
  • prop (NormalizedNamableReference | Referenced | Reference | NamedReference | tuple[str, str] | str)

  • use_tqdm (bool)

Return type:

Iterable[tuple[Stanza, str]]

iterate_filtered_relations(relation, *, use_tqdm=False)[source]

Iterate over tuples of terms and ther targets for the given relation.

Parameters:
  • relation (NormalizedNamableReference | Referenced | Reference | NamedReference | tuple[str, str] | str)

  • use_tqdm (bool)

Return type:

Iterable[tuple[Stanza, NormalizedNamableReference]]

iterate_filtered_relations_filtered_targets(relation, target_prefix, *, use_tqdm=False)[source]

Iterate over relationships between one identifier and another.

Parameters:
  • relation (NormalizedNamableReference | Referenced | Reference | NamedReference | tuple[str, str] | str)

  • target_prefix (str)

  • use_tqdm (bool)

Return type:

Iterable[tuple[Stanza, NormalizedNamableReference]]

iterate_filtered_xrefs(prefix, *, use_tqdm=False)[source]

Iterate over xrefs to a given prefix.

Parameters:
Return type:

Iterable[tuple[Stanza, NormalizedNamableReference]]

iterate_id_definition(*, use_tqdm=False)[source]

Iterate over pairs of terms’ identifiers and their respective definitions.

Parameters:

use_tqdm (bool)

Return type:

Iterable[tuple[str, str]]

iterate_id_name(*, use_tqdm=False)[source]

Iterate identifier name pairs.

Parameters:

use_tqdm (bool)

Return type:

Iterable[tuple[str, str]]

iterate_id_species(*, prefix=None, use_tqdm=False)[source]

Iterate over terms’ identifiers and respective species (if available).

Parameters:
  • prefix (str | None)

  • use_tqdm (bool)

Return type:

Iterable[tuple[str, str]]

iterate_ids(*, use_tqdm=False)[source]

Iterate over identifiers.

Parameters:

use_tqdm (bool)

Return type:

Iterable[str]

iterate_literal_mapping_rows()[source]

Iterate over literal mapping rows.

Return type:

Iterable[LiteralMappingTuple]

iterate_node_rows(sep=';')[source]

Get a nodes iterator appropriate for serialization.

Parameters:

sep (str)

Return type:

Iterable[Sequence[str]]

iterate_obo_lines(emit_object_properties=True, emit_annotation_properties=True)[source]

Iterate over the lines to write in an OBO file.

Here’s the order:

  1. format-version (technically, this is the only required field)

  2. data-version

  3. date

  4. saved-by

  5. auto-generated-by

  6. import

  7. subsetdef

  8. synonymtypedef

  9. default-namespace

  10. namespace-id-rule

  11. idspace

  12. treat-xrefs-as-equivalent

  13. treat-xrefs-as-genus-differentia

  14. treat-xrefs-as-relationship

  15. treat-xrefs-as-is_a

  16. remark

  17. ontology

Parameters:
  • emit_object_properties (bool)

  • emit_annotation_properties (bool)

Return type:

Iterable[str]

iterate_properties(*, use_tqdm=False)[source]

Iterate over tuples of terms, properties, and their values.

Parameters:

use_tqdm (bool)

Return type:

Iterable[tuple[Stanza, Annotation]]

iterate_references(*, use_tqdm=False)[source]

Iterate over identifiers.

Parameters:

use_tqdm (bool)

Return type:

Iterable[NormalizedNamableReference]

iterate_relations(*, use_tqdm=False)[source]

Iterate over tuples of terms, relations, and their targets.

This only outputs stuff from the relationship: tag, not all possible triples. For that, see iterate_edges().

Parameters:

use_tqdm (bool)

Return type:

Iterable[tuple[Stanza, TypeDef, NormalizedNamableReference]]

iterate_synonym_rows(*, use_tqdm=False)[source]

Iterate over pairs of identifier and synonym text.

Parameters:

use_tqdm (bool)

Return type:

Iterable[tuple[str, str]]

iterate_synonyms(*, use_tqdm=False)[source]

Iterate over pairs of term and synonym object.

Parameters:

use_tqdm (bool)

Return type:

Iterable[tuple[Stanza, Synonym]]

iterate_xrefs(*, use_tqdm=False)[source]

Iterate over xrefs.

Parameters:

use_tqdm (bool)

Return type:

Iterable[tuple[Stanza, NormalizedNamableReference]]

to_obonet(*, use_tqdm=False)[source]

Export as a :mod`obonet` style graph.

Parameters:
Return type:

MultiDiGraph

write_cache(*, force=False)[source]

Write cache parts.

Parameters:

force (bool)

Return type:

None

write_default(use_tqdm=False, force=False, write_obo=False, write_obonet=False, write_obograph=False, write_owl=False, write_ofn=False, write_ttl=False, write_nodes=False, obograph_use_internal=False, write_cache=True)[source]

Write the OBO to the default path.

Parameters:
Return type:

None

write_edges(path)[source]

Write a edges TSV file.

Parameters:

path (str | Path)

Return type:

None

write_metadata()[source]

Write the metadata JSON file.

Return type:

None

write_nodes(path)[source]

Write a nodes TSV file.

Parameters:

path (str | Path)

Return type:

None

write_obo(file=None, *, use_tqdm=False, emit_object_properties=True, emit_annotation_properties=True)[source]

Write the OBO to a file.

Parameters:
Return type:

None

write_obograph(path, *, converter=None)[source]

Write OBO Graph JSON.

Parameters:
  • path (str | Path)

  • converter (Converter | None)

Return type:

None

write_obonet_gz(path)[source]

Write the OBO to a gzipped dump in Obonet JSON.

Parameters:

path (str | Path)

Return type:

None

write_ofn(path)[source]

Write as Functional OWL (OFN).

Parameters:

path (str | Path)

Return type:

None

write_owl(path)[source]

Write OWL, by first outputting OFN then converting with ROBOT.

Parameters:

path (str | Path)

Return type:

None

write_prefix_map()[source]

Write a prefix map file that includes all prefixes used in this ontology.

Return type:

None

write_rdf(path)[source]

Write as Turtle RDF.

Parameters:

path (str | Path)

Return type:

None