open_ontology

pyhornedowl.open_ontology(ontology: str, serialization: Literal2['owl', 'rdf', 'ofn', 'owx', 'omn', 'obo'] | None = None, index_strategy: IndexCreationStrategy = ...) → Ontology

Opens an ontology from a path or plain text.

If ontology is a path, the file is loaded. Otherwise, ontology is interpreted as an ontology in plain text. If no serialization is specified, it is guessed from the file extension (for a path) or detected from the content. Raises a ValueError if the serialization cannot be determined.