Add support for NGSI-LD valueType and more NGSI-LD sub-property types.#1723
Add support for NGSI-LD valueType and more NGSI-LD sub-property types.#1723fgalan merged 9 commits intotelefonicaid:masterfrom
valueType and more NGSI-LD sub-property types.#1723Conversation
There was a problem hiding this comment.
This file (and the rest of similar ones) are under ngsiv2/ structure.
Maybe they are no longer used but we forgot to remove them? In that case, thanks for the clean up :)
There was a problem hiding this comment.
Remove: autocast (including env var IOTA_AUTOCAST) (#1498) was part of 4.0.0 release
| options.json[constants.TIMESTAMP_ATTRIBUTE] = { | ||
| type: constants.TIMESTAMP_TYPE_NGSI2, | ||
| value: moment() | ||
| value: new Date().toISOString() |
There was a problem hiding this comment.
Really needed or a kind of improvement?
There was a problem hiding this comment.
Moment.js is deprecated, or rather there are better ways of achieving the same result without the use of an unnecessary extra package. In this case Date gives us everything we need from moment.
https://momentjs.com/docs/#/-project-status/
Ideally I'd like to remove both moment and moment-timezone entirely at some point
Co-authored-by: Fermín Galán Márquez <fgalan@users.noreply.github.com>
fgalan
left a comment
There was a problem hiding this comment.
LGTM
Let's wait for @AlvaroVega to merge this PR.
doc/admin.md
Outdated
| host: '192.168.56.101', | ||
| port: '1026', | ||
| ngsiVersion: 'ld', | ||
| valueType: 'valueType', |
There was a problem hiding this comment.
Given that value type is only used by NGSI-LD and taking into account that other LD-related config use the "Ld" token in the name (eg jsonLdContext, maybe it shoulb be named ldValueType?
In that case, the env var could be renamed to IOTA_CB_NGSILD_VALUE_TYPE
There was a problem hiding this comment.
Fixed b50a691
Moved to IOTA_LD_SUPPORT_DATA_TYPE with config value server.ldSupport.datatype - this aligns to the other LD only config values.
As defined in the 1.9.1 NGSI-LD specification, there are now two mechanisms available for supporting the equivlent of NGSI-v2
typeattribute holding an attribute's datatype.This PR updates NGSI-LD processing to allow for three types of valueType processing to add datatype metadata
valueType@typeThe previous 1.8.1 default (and recommendation) was
@type, but this should change sincevalueTypewas created to simplifyvalueand make it queriable, The new default (for now) should be nothing, sincevalueTypeis not widely supported by context brokers yet.Note that
valueTypealwayd optional - it is still possible to define attributes asProperty,GeoPropertyorRelationship. Furthermore the additional sub-types ofPropertysuch asJsonProperty,VocabPropertyandListPropertyare also now supported.