According to your example, the error you're showing to us does not
match the code you provided. The problem is that somewhere in your
code you use a literal as object for an
OWLObjectPropertyAssertionAxiom which is indeed wrong.
I am trying the below portion from an open example to add an
property using the owlapi, but I am getting the below error.