get_ontology

pyobo.get_ontology(prefix, *, force=False, rewrite=False, strict=True, version=None, robot_check=True)[source]

Get the OBO for a given graph.

Parameters:
  • prefix (str) – The prefix of the ontology to look up

  • version (Optional[str]) – The pre-looked-up version of the ontology

  • force (bool) – Download the data again

  • rewrite (bool) – Should the OBO cache be rewritten? Automatically set to true if force is true

  • strict (bool) – Should CURIEs be treated strictly? If true, raises exceptions on invalid/malformed

  • robot_check (bool) – If set to false, will send the --check=false command to ROBOT to disregard malformed ontology components. Necessary to load some ontologies like VO.

Return type:

Obo

Returns:

An OBO object

Raises:

OnlyOWLError – If the OBO foundry only has an OWL document for this resource.

Alternate usage if you have a custom url:

>>> from pystow.utils import download
>>> from pyobo import Obo, from_obo_path
>>> url = ...
>>> obo_path = ...
>>> download(url=url, path=path)
>>> obo = from_obo_path(path)