OBO Graph Adapter


This is an alternative to Pronto / OBO Files Adapter for loading OBO Graph JSON files.


To ensure use of this implementation when specifying a selector, use the obograph scheme:

runoak -i obograph:path/to/file.json COMMAND [COMMAND-OPTIONS]


class oaklib.implementations.obograph.obograph_implementation.OboGraphImplementation(resource: ~oaklib.resource.OntologyResource | None = None, strict: bool = False, _multilingual: bool | None = None, autosave: bool = <factory>, exclude_owl_top_and_bottom: bool = <factory>, ontology_metamodel_mapper: ~oaklib.mappers.ontology_metadata_mapper.OntologyMetadataMapper | None = None, _converter: ~curies.api.Converter | None = None, auto_relax_axioms: bool | None = None, cache_lookups: bool = False, property_cache: ~oaklib.utilities.keyval_cache.KeyValCache = <factory>, _edge_index: ~oaklib.indexes.edge_index.EdgeIndex | None = None, _entailed_edge_index: ~oaklib.indexes.edge_index.EdgeIndex | None = None, obograph_document: ~oaklib.datamodels.obograph.GraphDocument | None = None, _relationship_index_cache: ~typing.Dict[str, ~typing.List[~typing.Tuple[str, str, str]]] | None = None, **_kwargs)[source]

OBO Graphs JSON backed implementation.

This implementation works off of an in-memory GraphDocument object.

To use:

>>> from oaklib import get_adapter
>>> oi = get_adapter('obograph:tests/input/go-nucleus.json')
>>> for node_id in oi.entities():
...     print(node_id, oi.label(node_id))

GO:0043226 organelle