Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upheno.owl cannot be parsed with Pronto #919

Open
Zethson opened this issue Jun 20, 2023 · 4 comments
Open

upheno.owl cannot be parsed with Pronto #919

Zethson opened this issue Jun 20, 2023 · 4 comments

Comments

@Zethson
Copy link

Zethson commented Jun 20, 2023

Traceback (most recent call last):
  File "/home/zeth/PycharmProjects/bionty/ree.py", line 3, in <module>
    test = Ontology("upheno.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 95, in parse_from
    self.process_imports(
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/parsers/base.py", line 70, in process_imports
    return dict(pool.map(lambda i: (i, process(i)), imports))
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/multiprocessing/pool.py", line 367, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/multiprocessing/pool.py", line 774, in get
    raise self._value
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/parsers/base.py", line 70, in <lambda>
    return dict(pool.map(lambda i: (i, process(i)), imports))
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/parsers/base.py", line 49, in process_import
    return Ontology(url, max(import_depth - 1, -1), timeout)
  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 95, in parse_from
    self.process_imports(
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/parsers/base.py", line 70, in process_imports
    return dict(pool.map(lambda i: (i, process(i)), imports))
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/multiprocessing/pool.py", line 367, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/multiprocessing/pool.py", line 774, in get
    raise self._value
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/parsers/base.py", line 70, in <lambda>
    return dict(pool.map(lambda i: (i, process(i)), imports))
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/parsers/base.py", line 49, in process_import
    return Ontology(url, max(import_depth - 1, -1), timeout)
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/ontology.py", line 286, in __init__
    raise ValueError(f"could not find a parser to parse {handle!r}")
ValueError: could not find a parser to parse 'http://purl.obolibrary.org/obo/upheno/upheno_root_alignments.owl'

https://github.com/althonos/pronto is the defacto standard for accessing ontologies in Python. I was using the latest upheno.owl from this repository. Attempting to read it with Pronto also triggered hundreds of warnings.

@matentzn
Copy link
Collaborator

https://github.com/althonos/pronto is the defacto standard for accessing ontologies in Python

While I love pronto and its developer @althonos, this is a bit of a misunderstanding - the defacto standard for accessing ontologies in python does not really exist (maybe the "defacto" part, as many people use pronto, but "standard" certainly not, as it is very lossy and does not cover half of the contents of ontologies like uPheno); there is no single python implementation that covers all ontologies. OAK attempts to unify all ontology parsers under one hood, but its still struggling with complex OWL axioms such as the ones in uPheno.

The reference implementation for all ontologies is OWL API, and ROBOT is the (OWLAPI based) tool we use to process our ontologies to make sure they are parseable etc.

That said, which URL do you use to obtain uPheno? we can contemplate to create a simple OBO release for users like yourself, where we drop all the non-OBO conformant axioms..

@althonos
Copy link

I second this. pronto is mostly focused on reading Open Biomedial Ontologies, either in OBO format (.obo) or after they have been converted to OWL/XML (.owl), using a reverse-translation that is mostly incomplete (hence the hundred of warnings, which say that pronto doesn't support the parsing of certain constructs, not that the OWL file is broken).

@serjoshua
Copy link

I just want to add that loading UPHENO in OLS is having issues. In summary, there is also a failure importing http://purl.obolibrary.org/obo/upheno/upheno_root_alignments.owl.

Linking this to EBISPOT/ols4#453 for reference.

@matentzn
Copy link
Collaborator

matentzn commented Aug 4, 2023

Thanks @serjoshua, @udp and me are working on migrating upheno as we speak to a newer version, which will take care of this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants