It's all about the answers!

Ask a question

OSLC4J: Cannot get a ChangeRequest that contains special characters

Ana-Maria Rosu (388) | asked Jul 14 '21, 4:25 a.m.

Hello everyone,

I am trying to get a ChangeRequest from IBM Jazz using OSLC4J Library, but I have a problem when that ChangeRequest (in IBM called EWM workitem) contains special characters (e.g. quotation marks) in some of the fields.

When the workitem contains quotation marks in the Title or the Description (which are standard dcterms attributes) then the request works and the item is retrieved,


When the special characters are in the extended/custom properties, for example “Requested Due Date Change Reason” custom text field, then it gives me the error HTTP 400 Bad Request caused by illegal instance of Datatype rdf:XMLLiteral (see the stacktrace at the end).

I checked the raw response and all text fields are of type XMLLiteral, so both the title and “Requested Due Date Change Reason” field are XML Literals, the only difference is that the title (and the description) are represented using dcterms and “Requested Due Date Change Reason” is rtc_ext.


Caused by: org.apache.jena.datatypes.DatatypeFormatException: Lexical form '"test"' is not a legal instance of Datatype[] Bad rdf:XMLLiteral

at org.apache.jena.graph.impl.LiteralLabelImpl.getValue(
at org.apache.jena.graph.Node_Literal.getLiteralValue(
at org.apache.jena.rdf.model.impl.LiteralImpl.getValue(
at org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper.handleExtendedPropertyValue(
at org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper.fromResource(
at org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper.createObjectResultList(
at org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper.fromJenaModel(
at org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper.unmarshal(
at org.eclipse.lyo.oslc4j.provider.jena.AbstractOslcRdfXmlProvider.readFrom(

For me it looks like that for extended/properties you have a different mechanism (JenaModelHelper.handleExtendedPropertyValue) to read properties compared to the to the procedure for reading properties from standard domains (like dcterms).

Do you have a solution for this?



One answer

permanent link
David Honey (1.8k17) | answered Jul 14 '21, 8:52 a.m.
I believe that OSLC4J is part of and is not part of any Jazz product. You should ask your question in

That Jena exception means you have specified an invalid RDF XMLiteral, and the exception is thrown by Jena. You should look at the Jena documentation, and also look at There are some characters that are illegal in XML literals, and there are requirements that the text is well-formed XML.

Ana-Maria Rosu commented Jul 14 '21, 9:16 a.m.

Hello, David! Thank you for your response, I will also ask on the open-services forum. 

Your answer

Register or to post your answer.