Skip to content

Commit

Permalink
Fixed #54 for v5.2.x branch
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorRodchenkov committed May 13, 2024
1 parent ffd92fb commit 393ad83
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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 +
"</" + prop + ">");
if(StringUtils.isNotBlank(type)) {
out.write(" rdf:datatype = \"" + xsd + type + "\"");
}
out.write(">" + valString + "</" + prop + ">");
}
}


private String findLiteralType(PropertyEditor editor)
{
Class range = editor.getRange();
Expand Down

0 comments on commit 393ad83

Please sign in to comment.