smart-data-models / data-models

Data Models in common use based on real world use-cases. These definitions underpin a digital market of interoperable and replicable smart solutions.
https://smartdatamodels.org/
115 stars 56 forks source link

Date related issues #24

Closed dpatil-fw closed 3 years ago

dpatil-fw commented 3 years ago

The guidelines here https://github.com/smart-data-models/data-models/blob/master/guidelines.md state that:

    "DateYearLess": {
      "type": "string",
      "pattern": "^--((0[13578]|1[02])-31|(0[1,3-9]|1[0-2])-30|(0\\d|1[0-2])-([0-2]\\d))$"
    },

Should 'DateYearLess' be defined as 'dateYearLess'?

At the same guidelines link, https://github.com/smart-data-models/data-models/blob/master/guidelines.md it is stated that:

dateCreated in NGSIv2 (createdAt in NGSI-LD) must not be used as long as they are internal attributes of the NGSI specification. dateModified in NGSIv2 (modifiedAt in NGSI-LD) must not be used as long as they are internal attributes of the NGSI specification.

        "dateCreated": {
          "type": "string",
          "format": "date-time",
          "description": "Property. Entity creation timestamp. This will usually be allocated by the storage platform."
        },
        "dateModified": {
          "type": "string",
          "format": "date-time",
          "description": "Property. Timestamp of the last modification of the entity. This will usually be allocated by the storage platform."
        },

Should dateCreated and dateModified be in common-schema.json? If so, how will the name difference(createdAt and modifiedAt) with NGSI-LD be handled?

albertoabellagarcia commented 3 years ago

There is a relevant difference between dateCreated and dateModified compared with createdAt and modifiedAt. The first two can, unfortunately, be modified. From our point of view, this is a flaw of this version but it is also true that if you know what you are doing it could some cases be useful. This is not the case for createdAt and modifiedAt which are real internal parameters and cannot be modified by the user. So NGSI-LD is more 'consistent' than NGSI-v2 but the users who are the ones to find it useful or not. Having said that, dateCreated and dateModified are also there because of compatibility with the GSMA approach in the very first days of the initiative.