RTXteam / RTX-KG2

Build system for the RTX-KG2 biomedical knowledge graph, part of the ARAX reasoning system (https://github.com/RTXTeam/RTX)
MIT License
34 stars 9 forks source link

Food Ontology Import Issue #303

Open ecwood opened 1 year ago

ecwood commented 1 year ago

Motivated by #300 and https://github.com/FoodOntology/foodon/issues/277, we need to investigate the food ontology issue more.

Currently, we are going to use a pickled version of foodon.json from buildkg2.rtx.ai and use that in the build.

ecwood commented 1 year ago

With ab8a4e2, I committed a patch so it will build. HOWEVER, with this patch, you cannot run the code in --savePickle mode.

saramsey commented 1 year ago

Can we mark this "verify in next build"?

ecwood commented 1 year ago

Can we mark this "verify in next build"?

@saramsey Sort of... it hasn't been fixed in the upstream ontology, so this is just a temporary workaround.

saramsey commented 1 year ago

Looks like the current version of robot also fails to convert the current verson of foodon.owl to obograph-json:

./robot convert --input foodon.owl --output foodon.json
OBO GRAPH ERROR Could not convert ontology to OBO Graph (see https://github.com/geneontology/obographs)
For details see: http://robot.obolibrary.org/errors#obo-graph-error
Use the -vvv option to show the stack trace.
Use the --help option to see usage information.
saramsey commented 1 year ago

Here is the tail end of the long output from running the above with -vvv:

2023-06-30 15:28:56,023 DEBUG org.obolibrary.robot.IOHelper - Saving ontology as OboGraphs JSON Syntax with to IRI file:/Users/sramsey/Desktop/foodon.json
OBO GRAPH ERROR Could not convert ontology to OBO Graph (see https://github.com/geneontology/obographs)
For details see: http://robot.obolibrary.org/errors#obo-graph-error
java.io.IOException: errors#OBO GRAPH ERROR Could not convert ontology to OBO Graph (see https://github.com/geneontology/obographs)
    at org.obolibrary.robot.IOHelper.saveOntologyFile(IOHelper.java:1752)
    at org.obolibrary.robot.IOHelper.saveOntology(IOHelper.java:876)
    at org.obolibrary.robot.CommandLineHelper.maybeSaveOutput(CommandLineHelper.java:667)
    at org.obolibrary.robot.ConvertCommand.execute(ConvertCommand.java:141)
    at org.obolibrary.robot.CommandManager.executeCommand(CommandManager.java:244)
    at org.obolibrary.robot.CommandManager.execute(CommandManager.java:188)
    at org.obolibrary.robot.CommandManager.main(CommandManager.java:135)
    at org.obolibrary.robot.CommandLineInterface.main(CommandLineInterface.java:61)
saramsey commented 1 year ago

This seems like maybe the start of a solution? http://robot.obolibrary.org/errors#obo-graph-error

saramsey commented 1 year ago

@ecwood I have a temporary solution. In ont-load-inventory.yaml, let's switch to using foodon-base.owl, which doesn't trigger any errors with robot or owltools. This works on my laptop:

./owltools foodon-base.owl -o -f json foodon-base.json

This also works:

./robot convert --input foodon-base.owl --output foodon-base.json

This is in place of importing foodon.owl into RTX-KG2.

saramsey commented 1 year ago

Longer term, maybe we can use a solution based robot remove as described on this page.

saramsey commented 1 year ago

In the really long-term, maybe we'll find an alternative to ontobio that doesn't require the conversion to obograph JSON. I don't know. I know previously, I struggled with rdflib and that is why we ended up using ontobio.

ecwood commented 12 months ago

We need to add this to kg2-versions.md for documentation purposes.

d33bs commented 5 months ago

I came across this issue when trying to run the full RTX-KG2 workflow. In addition or perhaps alongside the changes mentioned regarding a pickled version of the original data, would it make sense to remove or update the reference in in ont-load-inventory.yaml (line 51) to reference foodon-base.json instead? As it stands, owltools errors seem to come up as a result of attempting to run the workflow.

Current data in ont-load-inventory.yaml:

-
  url: http://purl.obolibrary.org/obo/foodon.owl 
  file: foodon.owl
  download: true
  title: FOODON (Food Ontology)

Suggested updates (retaining the non-base FOODON data with hopes that it may be resolved and for later developer reference):

# Commented due to owlapi / owltools errors with conversions and object types.
# Replaced by FOODON base below in reference to RTXteam/RTX-KG2#300
# See: 
# - https://github.com/RTXteam/RTX-KG2/issues/303
# - https://github.com/FoodOntology/foodon/issues/277
#
#-
#   url: http://purl.obolibrary.org/obo/foodon.owl 
#   file: foodon.owl
#   download: true
#   title: FOODON (Food Ontology)
-
  url: https://raw.githubusercontent.com/FoodOntology/foodon/master/foodon-base.owl
  file: foodon-base.owl
  download: true
  title: FOODON (Food Ontology) Base