Skip to content

Commit

Permalink
Add datasetid column
Browse files Browse the repository at this point in the history
  • Loading branch information
gasserluc committed Oct 17, 2024
1 parent 07c4f37 commit fccc332
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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);
Expand Down

0 comments on commit fccc332

Please sign in to comment.