-
Notifications
You must be signed in to change notification settings - Fork 91
Add GeoJSON and DateTime, unitCode and observedAt NGSI-LD support #843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GeoJSON and DateTime, unitCode and observedAt NGSI-LD support #843
Conversation
Prettify tests and update tests to use ES6 and update Copyrights
Tidy JSON response mocks
NGSI-LD Specification does not permit a String at the root level observedAt is only allowed within properties and relationships
- Update CNR - Add Docker ENV to docs - basic LD set-up documentation - amend copy-paste JavaDoc - add missing JavaDoc - remove blank lines.
Merge branch 'feature/ngsi-ld-measure' into feature/time-and-geo
}, | ||
BadTimestamp: function(payload) { | ||
this.name = 'BAD_TIMESTAMP'; | ||
this.message = 'Invalid ISO8601 timestamp [' + payload + ']'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CHANGES_NEXT_RELEASE entry should be added
(Maybe at the end we will group all the NGSI-LD ones together in a single entry, but by the moment let's add the one corresponding to each PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the other hand, I understand this PR doesn't need any addition/modification to the documentation, does it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the following behaviour should be documented (not fully sure)?
The NGSI v2
TimeInstant
element has been mapped onto the NGSI-LDobservedAt
propertyThe NGSI v2
metadata.unitCode
attribute has been mapped onto the NGSI-LDunitCode
property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CNR has been updated: 1da050b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about documentation modifications?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minimal documentation has been added: fa90072
lib/services/ngsi/ngsiService.js
Outdated
obj[key] = json[key]; | ||
break; | ||
case constants.TIMESTAMP_ATTRIBUTE: | ||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover? Code to ve activated in a next PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Replaced with comment - 3d72455
Co-Authored-By: Fermín Galán Márquez <fgalan@users.noreply.github.com>
Co-Authored-By: Fermín Galán Márquez <fgalan@users.noreply.github.com>
Co-Authored-By: Fermín Galán Márquez <fgalan@users.noreply.github.com>
Co-Authored-By: Fermín Galán Márquez <fgalan@users.noreply.github.com>
Co-Authored-By: Fermín Galán Márquez <fgalan@users.noreply.github.com>
Co-Authored-By: Fermín Galán Márquez <fgalan@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR adds GeoJSON and DateTime,
unitCode
andobservedAt
NGSI-LD supportParsing now supports native parsing of JSON primitives plus the following:
Temporal Properties
DateTime
- always expressed in UTC, using ISO 8601Date
- always expressed in UTC, using ISO 8601Time
- always expressed in UTC, using ISO 8601Geospatial Properties
Point
- represent ascoordinates
as mandated by IETF RFC 7946LineString
- represent ascoordinates
as mandated by IETF RFC 7946Polygon
- represent ascoordinates
as mandated by IETF RFC 7946MultiPoint
- represent ascoordinates
as mandated by IETF RFC 7946MultiLineString
- represent ascoordinates
as mandated by IETF RFC 7946MultiPolygon
- represent ascoordinates
as mandated by IETF RFC 7946The NGSI v2
TimeInstant
element has been mapped onto the NGSI-LDobservedAt
propertyThe NGSI v2
metadata.unitCode
attribute has been mapped onto the NGSI-LDunitCode
propertyThe set of tests expectation have been amended where necessary. Additional tests added.