gs1 / EPCIS

Draft files being shared for EPCIS 2.0 development
Other
22 stars 7 forks source link

A few fixes in JSON-LD examples. #239

Closed shalikasingh closed 3 years ago

shalikasingh commented 3 years ago

Hi @mgh128,

Do you think that below example of digital link should be updated as per our current discussion As-is: "rawData": "https://example.org/giai/401234599999" To-be: "rawData": "https://example.org/8004/401234599999"

There are many such occurrences mostly in examples within the folder WithSensorData.

Currently, in JSON-LD examples we are assigning namespace to gs1 key twice in context once in @context array itself and other in epcis-context.jsonld file. I believe we should remove it from any one of the places.

mgh128 commented 3 years ago

Hi @shalikasingh

Yes, we probably should update those examples of GS1 Digital Link URIs to use only the numeric AIs, not the alphabetic short names such as 'gtin' or 'giai'.

I'll try to make that update later today or tomorrow.

mgh128 commented 3 years ago

Hi @shalikasingh

The CURIE namespace expansion for 'gs1' is only needed in the context resource, not needed to be repeated in any examples that reference the context resource.

shalikasingh commented 3 years ago

Hi @mgh128,

For your reference, all examples within the folder WithSensorData maps key gs1 to the namespace twice like below which needs to be rectified.

"@context": ["https://gs1.github.io/EPCIS/epcis-context.jsonld",{"example": "http://ns.example.com/epcis/"},{"gs1": "https://gs1.org/voc/"}],

shalikasingh commented 3 years ago

Hi @mgh128,

Can we please fix this before it goes unnoticed?

shalikasingh commented 3 years ago

Hi @mgh128,

The below lgtin value in the example seems to be invalid. If yes, then please rectify it there and also in other examples present within the WithSensorData folder

"epcClass":"urn:epc:class:lgtin:4023333.002000.2019-10-07"

mgh128 commented 3 years ago

Hi @mgh128,

Can we please fix this before it goes unnoticed?

@shalikasingh - Thanks for the reminder. I've now removed the duplicate declaration of the "gs1" namespace within the JSON-LD examples in https://github.com/gs1/EPCIS/tree/master/JSON/WithSensorData

mgh128 commented 3 years ago

Hi @mgh128,

The below lgtin value in the example seems to be invalid. If yes, then please rectify it there and also in other examples present within the WithSensorData folder

"epcClass":"urn:epc:class:lgtin:4023333.002000.2019-10-07"

Hi @shalikasingh

I compared the example "urn:epc:class:lgtin:4023333.002000.2019-10-07" with the syntax defined in section https://www.gs1.org/standards/epcrfid-epcis-id-keys/epc-rfid-tds/1-13

The general URI syntax for LGTIN is:

urn:epc:class:lgtin:CompanyPrefix.ItemRefAndIndicator.Lot

The first two components, CompanyPrefix and ItemRefAndIndicator should be all-numeric, totalling 13 digits (because the GTIN check digit does not appear within the EPC URN). That seems OK in this example.

The final component, Lot is permitted to use up to 20 characters from the 82-character alphabet, using percent-encoding of symbols only where necessary. "2019-10-07" is within 20 characters and only uses digits and hyphen. Hyphen is a URI-safe character that does not need to be percent-encoded. Lot is defined to be a GS3A3Component, which is defined at lines 719-720 and 726-728 of the GS1 Tag Data Standard v1.13 as follows:

OtherChar ::= “!” | “’” | “(“ | “)“ | “*” | “+” | “,” | “-” | “.” | “:” | “;” | “=” | “_” GS3A3Char ::= Digit | UpperAlpha | LowerAlpha | OtherChar | Escape GS3A3Component ::= GS3A3Char+

So because hyphen appears within OtherChar, it is permitted without percent-encoding within GS3A3Char and therefore within GS3A3Component.

I agree that using a lot value formatted as a YYYY-MM-DD date might make people question whether it is valid, but syntactically it is valid.

Did I miss something?

RalphTro commented 3 years ago

Hi @shalikasingh, Just to add to Mark's comment: the LGTIN EPC Class URI is syntactically correct.

shalikasingh commented 3 years ago

Hi @mgh128,

Thank you for such a detailed explanation. Now I get it that it's a valid representation of LGTIN.

CraigRe commented 3 years ago

@shalikasingh, where was that LGTIN failing to validate? This is what it looks like in the Workbench:

image

shalikasingh commented 3 years ago

Hi @shalikasingh

Yes, we probably should update those examples of GS1 Digital Link URIs to use only the numeric AIs, not the alphabetic short names such as 'gtin' or 'giai'.

I'll try to make that update later today or tomorrow.

Hi @mgh128 ,

Can we please make the above updates to the EPCIS Events as well?

shalikasingh commented 3 years ago

Hi @CraigRe,

It was the regular expression issue at our end. It wasn't up to the mark. Sorry for the confusion

mgh128 commented 3 years ago

Hi @shalikasingh Yes, we probably should update those examples of GS1 Digital Link URIs to use only the numeric AIs, not the alphabetic short names such as 'gtin' or 'giai'. I'll try to make that update later today or tomorrow.

Hi @mgh128 ,

Can we please make the above updates to the EPCIS Events as well?

Yes. Now done. Thanks again for the reminder.