diff --git a/nifi-ngsild-postgresql-processors/src/main/java/egm/io/nifi/processors/ngsild/utils/NGSIUtils.java b/nifi-ngsild-postgresql-processors/src/main/java/egm/io/nifi/processors/ngsild/utils/NGSIUtils.java index f1dbb53..53625ef 100644 --- a/nifi-ngsild-postgresql-processors/src/main/java/egm/io/nifi/processors/ngsild/utils/NGSIUtils.java +++ b/nifi-ngsild-postgresql-processors/src/main/java/egm/io/nifi/processors/ngsild/utils/NGSIUtils.java @@ -137,7 +137,7 @@ private Attribute parseNgsiLdAttribute(String key, JSONObject value, boolean fla addAttributeIfValid(subAttributes, subAttribute); } } else if (object instanceof JSONObject) { - Attribute subAttribute = parseNgsiLdSubAttribute(keyOne, value.getJSONObject(keyOne)); + Attribute subAttribute = parseNgsiLdSubAttribute(keyOne, value.getJSONObject(keyOne)); addAttributeIfValid(subAttributes, subAttribute); } else { logger.warn("Sub Attribute {} has unexpected value type: {}", keyOne, object.getClass()); @@ -150,6 +150,10 @@ private Attribute parseNgsiLdAttribute(String key, JSONObject value, boolean fla "parametername", "Property", "", "", "", "", key.toLowerCase(), false, null ); subAttributes.add(parameterName); + Attribute parameterDatasetId = new Attribute( + "datasetid", "Property", "", "", "", "", datasetId.toLowerCase(), false, null + ); + subAttributes.add(parameterDatasetId); return new Attribute(GENERIC_MEASURE, attrType, "", observedAt, createdAt, modifiedAt, attrValue, true, subAttributes); } else { return new Attribute(key.toLowerCase(), attrType, datasetId, observedAt, createdAt, modifiedAt, attrValue, !subAttributes.isEmpty(), subAttributes);