Closed caufieldjh closed 6 months ago
A similar thing has happened in the recent past with FOODON re: things making obojson sad: https://github.com/FoodOntology/foodon/issues/277#issuecomment-1615257724
Trying out locally with ROBOT version 1.9.5:
$ wget http://purl.obolibrary.org/obo/foodon.owl
...
$ robot --vvv relax --input foodon.owl --output foodon_relaxed.owl
...
$ robot -vvv convert --input foodon_relaxed.owl --format json --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
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:65)
The above approach is to try to repair by first removing object properties, then removing comments.
$ robot -vvv remove --input foodon_relaxed.owl --select object-properties --output foodon.json
...
2024-03-19 12:38:18,331 WARN org.obolibrary.robot.RelatedObjectsHelper - Circular subclass definition: http://purl.obolibrary.org/obo/FOODON_00002511
2024-03-19 12:38:18,554 DEBUG org.obolibrary.robot.IOHelper - Saving ontology as OboGraphs JSON Syntax with to IRI file:/home/harry/kg-obo/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.RemoveCommand.execute(RemoveCommand.java:202)
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:65)
$ robot -vvv remove --input foodon_relaxed.owl --term rdfs:comment --output foodon.json
...
2024-03-19 12:40:07,351 WARN org.obolibrary.robot.RelatedObjectsHelper - Circular subclass definition: http://purl.obolibrary.org/obo/FOODON_00002511
2024-03-19 12:40:07,587 DEBUG org.obolibrary.robot.IOHelper - Saving ontology as OboGraphs JSON Syntax with to IRI file:/home/harry/kg-obo/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.RemoveCommand.execute(RemoveCommand.java:202)
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:65)
Could that circular subclass definition be the issue? Probably not, because it's been like that since 2019 and previous KG-OBO builds (e.g., translating the 2023-05-03 version) worked as expected.
Not sure exactly what the issue is.
As a workaround, patch up the error handling so this doesn't impact the rest of the KG-OBO build.
Alternatively, can default to using a base file if it's available, as it is in this case.
This works:
$ robot -vvv remove --input foodon_relaxed.owl --exclude-term IAO:0000115 --output foodon.json
Describe the bug
In the last build, ROBOT's attempts to translate FOODON v2024-02-21 to obojson fail repeatedly.
Here's how it went:
So converting the relaxed owl to obojson fails initially, and continues to do so even after the usual repairs. Try it locally.