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

.obo SyntaxErorrs #131

Open
joelduerksen opened this issue Mar 29, 2021 · 3 comments
Open

.obo SyntaxErorrs #131

joelduerksen opened this issue Mar 29, 2021 · 3 comments
Labels
external An issue related to an external dependency or project.

Comments

@joelduerksen
Copy link

joelduerksen commented Mar 29, 2021

What is the best way to force pronto to continue in the face of messy/real data?

>>> cl = Ontology("http://purl.obolibrary.org/obo/uberon.obo")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/plastic/anaconda3/envs/uberon/lib/python3.8/site-packages/pronto/ontology.py", line 283, in __init__
    cls(self).parse_from(_handle)  # type: ignore
  File "/home/plastic/anaconda3/envs/uberon/lib/python3.8/site-packages/pronto/parsers/obo.py", line 45, in parse_from
    raise SyntaxError(s.args[0], location) from None
  File "http://purl.obolibrary.org/obo/uberon.obo", line 199316
    def: "A free, modified neural spine of a preural or a ural vertebra that is placed between the last developed neural spine of a preural centrum and the dorsal axis (= anterior margin of first uroneural) of the caudal skeleton . An epural commonly supports one or more dorsal procurrent rays. An epural is an unpaired median perichondrally ossified bone." [TAO:Arratia and Schultze_1992]␊
                                                                                                                                                                                                                                                                                                                                                                                    ^
SyntaxError: expected QuotedString

>>> cl = Ontology("http://purl.obolibrary.org/obo/cl.obo")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/plastic/anaconda3/envs/uberon/lib/python3.8/site-packages/pronto/ontology.py", line 283, in __init__
    cls(self).parse_from(_handle)  # type: ignore
  File "/home/plastic/anaconda3/envs/uberon/lib/python3.8/site-packages/pronto/parsers/obo.py", line 45, in parse_from
    raise SyntaxError(s.args[0], location) from None
  File "http://purl.obolibrary.org/obo/cl.obo", line 163708
    creation_date: 202z-09-29T15:45:36Z␊
                   ^
SyntaxError: expected Iso8601Year

>>> cl = Ontology("http://purl.obolibrary.org/obo/basic.obo")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/plastic/anaconda3/envs/uberon/lib/python3.8/site-packages/pronto/ontology.py", line 283, in __init__
    cls(self).parse_from(_handle)  # type: ignore
  File "/home/plastic/anaconda3/envs/uberon/lib/python3.8/site-packages/pronto/parsers/rdfxml.py", line 89, in parse_from
    raise ValueError("could not find `owl:Ontology` element")
ValueError: could not find `owl:Ontology` element

@althonos
Copy link
Owner

althonos commented May 8, 2021

Hi @joelduerksen ,

pronto is backed by fastobo, which is a library I developed during a MSc placement in order to assess the syntactic correctness of OBO ontologies. As such, it means that pronto will only load correct ontologies, in an effort to improve the landscape of OBO products.

So, in the case of Uberon and CL, I am in contact with the ontology developers, so I can likely patch the issues. The third example you are showing is something else, because you request a non-existing file to the OBO library 😄

@althonos althonos added the external An issue related to an external dependency or project. label May 8, 2021
@althonos
Copy link
Owner

althonos commented May 8, 2021

UBERON issues have been reported in uberon#1850. CL issues are actually coming from UBERON imports, so fixing UBERON will likely fix CL as well.

@jkanche
Copy link

jkanche commented Jun 16, 2021

running into the same issue as well...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external An issue related to an external dependency or project.
Projects
None yet
Development

No branches or pull requests

3 participants