Skip to content

Conversation

jason-fox
Copy link
Contributor

@jason-fox jason-fox commented Feb 10, 2020

This PR adds GeoJSON and DateTime,unitCode and observedAt NGSI-LD support

Parsing now supports native parsing of JSON primitives plus the following:

Temporal Properties

  • DateTime - always expressed in UTC, using ISO 8601
  • Date - always expressed in UTC, using ISO 8601
  • Time - always expressed in UTC, using ISO 8601

Geospatial Properties

  • Point - represent as coordinates as mandated by IETF RFC 7946
  • LineString - represent as coordinates as mandated by IETF RFC 7946
  • Polygon - represent as coordinates as mandated by IETF RFC 7946
  • MultiPoint - represent as coordinates as mandated by IETF RFC 7946
  • MultiLineString - represent as coordinates as mandated by IETF RFC 7946
  • MultiPolygon - represent as coordinates as mandated by IETF RFC 7946

The NGSI v2 TimeInstant element has been mapped onto the NGSI-LD observedAt property

The NGSI v2 metadata.unitCode attribute has been mapped onto the NGSI-LD unitCode property

The set of tests expectation have been amended where necessary. Additional tests added.

@jason-fox jason-fox mentioned this pull request Feb 10, 2020
Prettify tests and update tests to use ES6 and update Copyrights
@fgalan fgalan changed the base branch from master to feature/842_ngsi_ld February 13, 2020 09:00
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.
@jason-fox jason-fox changed the title Feature/time and geo Add GeoJSON and DateTime, unitCode and observedAt NGSI-LD support Feb 27, 2020
@fgalan
Copy link
Member

fgalan commented Mar 2, 2020

Once PR #841 has been merged, this should be the next one to process.

Could you upgrade this PR with telefonicaid:feature/842_ngsi_ld so the part already merged in #841 disappear from the diff, please?

@jason-fox
Copy link
Contributor Author

jason-fox commented Mar 2, 2020

Once PR #841 has been merged, this should be the next one to process.

Could you upgrade this PR with telefonicaid:feature/842_ngsi_ld so the part already merged in #841 disappear from the diff, please?

Fixed c30d072 1a5aaae

},
BadTimestamp: function(payload) {
this.name = 'BAD_TIMESTAMP';
this.message = 'Invalid ISO8601 timestamp [' + payload + ']';
Copy link
Member

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)

Copy link
Member

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?

Copy link
Member

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-LD observedAt property

The NGSI v2 metadata.unitCode attribute has been mapped onto the NGSI-LD unitCode property

Copy link
Contributor Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about documentation modifications?

Copy link
Contributor Author

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

obj[key] = json[key];
break;
case constants.TIMESTAMP_ATTRIBUTE:
/*
Copy link
Member

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?

Copy link
Contributor Author

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

jason-fox and others added 7 commits March 3, 2020 10:38
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>
Copy link
Member

@fgalan fgalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fgalan fgalan merged commit 82e1d30 into telefonicaid:feature/842_ngsi_ld Mar 4, 2020
@jason-fox jason-fox deleted the feature/time-and-geo branch March 4, 2020 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants