althonos / pronto

A Python frontend to (Open Biomedical) Ontologies.
https://pronto.readthedocs.io
MIT License
229 stars 48 forks source link

Is it possible to write OWL? #232

Open sorenwacker opened 2 weeks ago

sorenwacker commented 2 weeks ago
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[20], line 2
      1 with open("chebi_core.owl", "wb") as f:
----> 2     ont.dump(f, format="owl")

File [~/miniforge3/envs/ds/lib/python3.11/site-packages/pronto/ontology.py:408](http://localhost:8888/lab/tree/~/miniforge3/envs/ds/lib/python3.11/site-packages/pronto/ontology.py#line=407), in Ontology.dump(self, file, format)
    406         break
    407 else:
--> 408     raise ValueError(f"could not find a serializer to handle {format!r}")

ValueError: could not find a serializer to handle 'owl'
althonos commented 2 weeks ago

Hi @sorenwacker,

At the moment it is not possible. Ultimately I want to export the whole Ontology to an OBO document with fastobo, and then use the mapping to OWL in there to generate the OWL file, but I didn't get around to write it.