althonos / pronto

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

Unable to create Pronto object since 2.5.6 (synonyms change) #219

Open Zethson opened 3 months ago

Zethson commented 3 months ago

Since the 2.5.6 release and the changes to how synonyms are handled (https://github.com/althonos/pronto/issues/218), I run into

Traceback (most recent call last):
  File "/home/zeth/PycharmProjects/bionty-base/test.py", line 8, in <module>
    Ontology("efo.owl")
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/ontology.py", line 283, in __init__
    cls(self).parse_from(_handle)  # type: ignore
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/parsers/rdfxml.py", line 119, in parse_from
    self._process_axiom(axiom, curies)
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/parsers/rdfxml.py", line 819, in _process_axiom
    for s in entity.synonyms
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/entity/__init__.py", line 465, in synonyms
    return frozenset(Synonym(ontology, s) for s in termdata.synonyms)
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/entity/__init__.py", line 465, in <genexpr>
    return frozenset(Synonym(ontology, s) for s in termdata.synonyms)
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/synonym.py", line 133, in __init__
    raise ValueError(f"undeclared synonym type: {syndata.type}")
ValueError: undeclared synonym type: OMO:0003000

when trying to read the https://www.ebi.ac.uk/efo/ ontology.

Works with 2.5.5, does NOT work with 2.5.6 anymore.

from pronto import Ontology

Ontology("efo.owl")