diff --git a/paxtools-core/src/main/java/org/biopax/paxtools/io/SimpleIOHandler.java b/paxtools-core/src/main/java/org/biopax/paxtools/io/SimpleIOHandler.java index ca168a705..7515b9e85 100644 --- a/paxtools-core/src/main/java/org/biopax/paxtools/io/SimpleIOHandler.java +++ b/paxtools-core/src/main/java/org/biopax/paxtools/io/SimpleIOHandler.java @@ -1,6 +1,7 @@ package org.biopax.paxtools.io; import org.apache.commons.lang3.StringEscapeUtils; +import org.apache.commons.lang3.StringUtils; import org.biopax.paxtools.controller.AbstractPropertyEditor; import org.biopax.paxtools.controller.PropertyEditor; import org.biopax.paxtools.controller.SimpleEditorMap; @@ -660,12 +661,13 @@ private void writeStatementFor(BioPAXElement bean, PropertyEditor editor, Object { String type = findLiteralType(editor); String valString = StringEscapeUtils.escapeXml(value.toString()); - out.write(" rdf:datatype = \"xsd:" + type + "\">" + valString + - ""); + if(StringUtils.isNotBlank(type)) { + out.write(" rdf:datatype = \"" + xsd + type + "\""); + } + out.write(">" + valString + ""); } } - private String findLiteralType(PropertyEditor editor) { Class range = editor.getRange();