diff --git a/jsonld-utility/pom.xml b/jsonld-utility/pom.xml index eb439b5..53d8390 100644 --- a/jsonld-utility/pom.xml +++ b/jsonld-utility/pom.xml @@ -6,7 +6,7 @@ org.unece.uncefact vocab-jsonld-utility - 1.6.2 + 1.6.3 diff --git a/jsonld-utility/src/main/java/org/unece/uncefact/vocab/md/DomainsToMD.java b/jsonld-utility/src/main/java/org/unece/uncefact/vocab/md/DomainsToMD.java index 2cee862..a2ce257 100644 --- a/jsonld-utility/src/main/java/org/unece/uncefact/vocab/md/DomainsToMD.java +++ b/jsonld-utility/src/main/java/org/unece/uncefact/vocab/md/DomainsToMD.java @@ -5,6 +5,8 @@ import org.unece.uncefact.vocab.FileGenerator; import jakarta.json.*; +import jakarta.json.JsonValue.ValueType; + import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; @@ -760,7 +762,11 @@ else if (comment instanceof JsonArray){ JsonObjectBuilder mdCodeListValue = Json.createObjectBuilder(); mdCodeListValue.add("uri",jsonObject.getString(Constants.ID)); if(jsonObject.containsKey(Constants.RDFS_COMMENT)){ - mdCodeListValue.add("comment",jsonObject.getString(Constants.RDFS_COMMENT)); + if (jsonObject.getValueType() == ValueType.ARRAY) { + mdCodeListValue.add("comment",jsonObject.getJsonArray(Constants.RDFS_COMMENT)); + } else if (jsonObject.getValueType() == ValueType.STRING) { + mdCodeListValue.add("comment",jsonObject.getString(Constants.RDFS_COMMENT)); + } } else{ mdCodeListValue.add("comment",""); } @@ -773,7 +779,11 @@ else if (comment instanceof JsonArray){ batchFieldsObject = Json.createObjectBuilder(); batchFieldsObject.add("label", StringUtils.substringAfter(jsonObject.getString(Constants.ID), ":")); if(jsonObject.containsKey(Constants.RDFS_COMMENT)){ - batchFieldsObject.add("comment", jsonObject.getString(Constants.RDFS_COMMENT)); + if (jsonObject.getValueType() == ValueType.ARRAY) { + batchFieldsObject.add("comment",jsonObject.getJsonArray(Constants.RDFS_COMMENT)); + } else if (jsonObject.getValueType() == ValueType.STRING) { + batchFieldsObject.add("comment",jsonObject.getString(Constants.RDFS_COMMENT)); + } } else{ batchFieldsObject.add("comment", ""); }