Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Casting error needs to be more informative #49

Open
matentzn opened this issue Sep 9, 2019 · 3 comments
Open

Casting error needs to be more informative #49

matentzn opened this issue Sep 9, 2019 · 3 comments

Comments

@matentzn
Copy link

matentzn commented Sep 9, 2019

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
Copy link
Author

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
Copy link
Member

balhoff commented Sep 12, 2019

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

@matentzn
Copy link
Author

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..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants