ontodev / robot

ROBOT is an OBO Tool
http://robot.obolibrary.org
BSD 3-Clause "New" or "Revised" License
260 stars 74 forks source link

Something is not working with the JSON parser #1009

Closed matentzn closed 2 years ago

matentzn commented 2 years ago

ROBOT 1.8.4:

robot convert -I http://purl.obolibrary.org/obo/pato.owl -f json -o pato.json

causes:

Exception in thread "main" java.lang.NoSuchMethodError: 'java.util.stream.Collector com.google.common.collect.ImmutableSet.toImmutableSet()'
    at org.geneontology.obographs.owlapi.FromOwl.generateGraph(FromOwl.java:236)
    at org.geneontology.obographs.owlapi.FromOwl.generateGraphDocument(FromOwl.java:63)
    at org.obolibrary.robot.IOHelper.saveOntologyFile(IOHelper.java:1720)
    at org.obolibrary.robot.IOHelper.saveOntology(IOHelper.java:846)
    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:60)
jamesaoverton commented 2 years ago

Nico and I think this is a JAR packaging/shading problem with gson the combination of ROBOT and obographs.

Maybe related to our recent gson bump? https://github.com/ontodev/robot/pull/1003

It would be good to have a ROBOT integration test to cover this.

julesjacobsen commented 2 years ago

Since when has this been an issue? obographs-owlapi pulls in guava (the library where Google Immutable Collections lives) as a transitive dependency from obographs-core. Have you added the obographs-core dependency to robot-core/pom.xml too?

jamesaoverton commented 2 years ago

As far as ROBOT is concerned, the problem was introduced in #934. When I build 999ded295fdf4d5a211f6972891a61296f9a750b, Nico's robot convert example succeeds, and when I build c195f5b9f4ca7a22b499b04c9fb7d9cb670f1241 it fails with the error above.