monarch-initiative / MAxO

Medical action ontology
Creative Commons Attribution 4.0 International
51 stars 4 forks source link

OAK cant handle maxo.json/owl/obo because of opaque error during parsing #362

Closed pnrobinson closed 2 months ago

pnrobinson commented 1 year ago

Trying with maxo json/obo/owl throws various errors with the following code (and with phenol)

from oaklib.resource import OntologyResource
from oaklib.implementations.pronto.pronto_implementation import ProntoImplementation
oi = ProntoImplementation(OntologyResource(local=False, slug='maxo.json'))
oi = ProntoImplementation(resource)

e.g.,

ValueError: graphs[0].logicalDefinitionAxioms[0]: missing field `genusIds` at line 212757 column 9
matentzn commented 1 year ago

I do not know what to do about this error, but I will try to find out:

https://github.com/geneontology/obographs/issues/89

matentzn commented 1 year ago

@hrshdhgd can you look into this? I added it to your board with high priority.

hrshdhgd commented 1 year ago

If you're not married to using Pronto, may I suggest using SQLImplementation? It is definitely faster than the former.

from oaklib.resource import OntologyResource
from oaklib.implementations.sqldb.sql_implementation import SqlImplementation

resource = OntologyResource(slug="obo:maxo")
oi = SqlImplementation(resource=resource)

Just to be sure use the latest version of oaklib [v0.1.68]. Example in oak repo.

matentzn commented 1 year ago

@hrshdhgd I think it is a good workaround, but we really need to get obographs to be handled correctly in OAK - Peter may have a local version of maxo.json which he needs to query..

pnrobinson commented 1 year ago

I think the problem is not in OAK, it is in obographs, and we cannot parse MAXO with phenol either. In general, it is time for us to say goodbye to OBO, we need to stick to the one source of truth principle (sortof, because we have json and OWL for different downstream applications)

matentzn commented 1 year ago

In this case, the problem is that the json parser which is provided by an external library is too strict. We investigated the format and it turned out to be fine;

The error with phenol, can you remind me where it is documented? Is there an issue?

LCCarmody commented 2 months ago

Is this resolved?

matentzn commented 2 months ago

Yes!

LCCarmody commented 2 months ago

Thanks! closing.