geneontology / obographs

Basic and Advanced OBO Graphs: specification and reference implementation
64 stars 12 forks source link

Casting error needs to be more informative #49

Open matentzn opened 5 years ago

matentzn commented 5 years ago

This is unfortunately impossible to debug other than with binary search (deleting portions of the ontology until it works..)

uk.ac.manchester.cs.owl.owlapi.OWLAnonymousIndividualImpl cannot be cast to org.semanticweb.owlapi.model.OWLLiteral
java.lang.ClassCastException: uk.ac.manchester.cs.owl.owlapi.OWLAnonymousIndividualImpl cannot be cast to org.semanticweb.owlapi.model.OWLLiteral
    at org.geneontology.obographs.owlapi.FromOwl.generateGraph(FromOwl.java:477)
    at org.geneontology.obographs.owlapi.FromOwl.generateGraphDocument(FromOwl.java:110)
    at org.obolibrary.robot.IOHelper.saveOntologyFile(IOHelper.java:1214)
    at org.obolibrary.robot.IOHelper.saveOntology(IOHelper.java:638)
    at org.obolibrary.robot.CommandLineHelper.maybeSaveOutput(CommandLineHelper.java:663)
    at org.obolibrary.robot.ConvertCommand.execute(ConvertCommand.java:141)
    at org.obolibrary.robot.CommandManager.executeCommand(CommandManager.java:248)
    at org.obolibrary.robot.CommandManager.execute(CommandManager.java:192)
    at org.obolibrary.robot.CommandManager.main(CommandManager.java:139)
    at org.obolibrary.robot.CommandLineInterface.main(CommandLineInterface.java:56)
matentzn commented 5 years ago

I cant see anything wrong with the code.. The only place I can think of being a problem is:

String val = v instanceof IRI ? ((IRI)v).toString() : ((OWLLiteral)v).getLiteral();
balhoff commented 5 years ago

That line will fail when the annotation target is a blank node (also suggested by the error).

matentzn commented 5 years ago

Yes, the weird thing is though that this line is in a different method than the above error suggests.. I think this might be a problem with obographs version in owlapi/robot..