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

Rationale for including pieces of the NGSI-LD core context in data models #32

Closed bobeal closed 2 years ago

bobeal commented 2 years ago

Hi,

I've noticed that many (all?) data models include pieces of the NGSI-LD core context.

For instance, in https://raw.githubusercontent.com/smart-data-models/dataModel.WasteWater/master/context.jsonld, we can find id, ngsi-ld and type. And same in https://raw.githubusercontent.com/smart-data-models/dataModel.Weather/master/context.jsonld.

What is the rationale behind this? Why for instance not just linking the core context?

albertoabellagarcia commented 2 years ago

There is a process checking the presence of every attribute defined in the NGSI core context. This was the case, then it is mapped in the local context and therefore appears there. So id and type would always present, and potentially others. Could they be omitted? Certainly. But bear in mind that they are using the core context, therefore we guess it shouldn't be conflicts, isn't it? Please let us know if we are not right. The link to the core context, although certainly possible, is not necessary as long as every broker is already loading it and it prevails over any other context used in the payloads. Best

bobeal commented 2 years ago

Indeed, I think it does not conflict, but it creates some duplication and clutter.

For the link to the core context, yes, it has to be put at last position and added by a context broker if not present. So better not put it here in case you use more than one smart data model in your request.