dataModel.Transportation icon indicating copy to clipboard operation
dataModel.Transportation copied to clipboard

Cannot use the data model because of an invalid definition

Open bobeal opened this issue 1 year ago • 10 comments

Hi,

Since this morning and this commit https://github.com/smart-data-models/dataModel.Transportation/commit/3df8a11c7ec0ab5dca236f91ef6e0826ab2da304, all applications making use of this context are broken, the following error is raised: invalid type mapping: DateTime. Guess it is missing the DateTime definition.

bobeal avatar Dec 20 '23 14:12 bobeal

I don't really understand what could be the problem because it is the very same as the NGSI-LD core context https://forge.etsi.org/rep/cim/NGSI-LD/-/blob/master/coreContext/ngsi-ld-core-context.jsonld. Could you provide us with more info. The previous version you mention here simply just not have this attribute. I don't see the issue of having both definitions with the same values. Could this be the problem?

albertoabellagarcia avatar Jan 10 '24 10:01 albertoabellagarcia

I don't really understand what could be the problem because it is the very same as the NGSI-LD core context https://forge.etsi.org/rep/cim/NGSI-LD/-/blob/master/coreContext/ngsi-ld-core-context.jsonld.

As a side note, better stop using this very old core context (use at least the one from v1.3, it has breaking changes with previous versions and no breaking change, as far as I remember, since then).

Could you provide us with more info. The previous version you mention here simply just not have this attribute. I don't see the issue of having both definitions with the same values. Could this be the problem?

Think it is missing the definition of the DateTime type (like in https://forge.etsi.org/rep/cim/NGSI-LD/-/blob/master/coreContext/ngsi-ld-core-context-v1.7.jsonld#L12)

bobeal avatar Jan 10 '24 10:01 bobeal

I don't really understand what could be the problem because it is the very same as the NGSI-LD core context https://forge.etsi.org/rep/cim/NGSI-LD/-/blob/master/coreContext/ngsi-ld-core-context.jsonld.

As a side note, better stop using this very old core context (use at least the one from v1.3, it has breaking changes with previous versions and no breaking change, as far as I remember, since then).

OMG. Sorry for my mistake.

Could you provide us with more info. The previous version you mention here simply just not have this attribute. I don't see the issue of having both definitions with the same values. Could this be the problem?

Think it is missing the definition of the DateTime type (like in https://forge.etsi.org/rep/cim/NGSI-LD/-/blob/master/coreContext/ngsi-ld-core-context-v1.7.jsonld#L12) Let me explore with the new one what can be the problem.

albertoabellagarcia avatar Jan 10 '24 14:01 albertoabellagarcia

What I see is that the contexts' files you were using have not observedAt at all, and now when one of these have an entry for observedAt we got a problem. But supposedly the URI for observedAt is the same as an updated core context. Can we explore that?

albertoabellagarcia avatar Jan 10 '24 14:01 albertoabellagarcia

What I see is that the contexts' files you were using have not observedAt at all, and now when one of these have an entry for observedAt we got a problem. But supposedly the URI for observedAt is the same as an updated core context. Can we explore that?

Indeed, observedAt is part of the NGSI-LD core context so we never add it in our domain contexts. And even if we did, that will be useless since, as stated by the JSON-LD specification: "If a term is redefined within a context, all previous rules associated with the previous definition are removed" (and the NGSI-LD core context shall always be treated as it had been originally placed in the last position).

As said in https://github.com/smart-data-models/dataModel.Transportation/issues/23#issuecomment-1884575256, the problem comes from the incorrect definition of the observedAt term in the context. You can simply reproduce it if you try to use the context in the JSON-LD playground:

Screenshot 2024-01-11 at 08 05 42

bobeal avatar Jan 11 '24 07:01 bobeal

We are in the fixing process by using an extended core context version so the value of Date, Datetime, etc will be finally a URI.

albertoabellagarcia avatar Jan 22 '24 17:01 albertoabellagarcia

Did a test with this context, it works!

bobeal avatar Jan 26 '24 07:01 bobeal

ok, then we are going to do it for all DM.

albertoabellagarcia avatar Feb 15 '24 17:02 albertoabellagarcia

please be patient with the approval of this change

albertoabellagarcia avatar Jun 12 '24 09:06 albertoabellagarcia