gs1 / WebVoc

GS1 Web vocabulary development site
Apache License 2.0
30 stars 6 forks source link

ai2voc.html comments #33

Open VladimirAlexiev opened 2 years ago

VladimirAlexiev commented 2 years ago

Hi @philarcher , @mgh128 pointed me to https://philarcher.org/gs1/files/2021-04/ai2voc.html as part of EPCIS Community Review.

His thoughtful remarks:

The EPCIS UML class diagram mentions a class ( gs1:IndividualObject ) that is not yet defined within the GS1 Web vocabulary. https://github.com/gs1/EPCIS/issues/224 mentions the need to define some additional classes within the GS1 Web vocabulary. gs1:IndividualObject is intended to include the classes of individual things whose instance-level identifiers could appear within the epcList field, for example.

  • Issue 224 refers to this object hierarchy gsheet
  • There's also a proposed mapping of EPC kinds and AIs to gs1 clases
  • Meanwhile, as part of the work for GS1 Digital Link Semantics, Phil Archer has developed this: https://philarcher.org/gs1/files/2021-04/ai2voc.html Proposed solution: The group (or a sub-team) should compare the object hierarchy proposed by Vladimir and the classes proposed by Phil, reach consensus then submit a work request to ask for those classes to be added to the GS1 Web vocabulary. At a minimum, it appears that we need gs1:IndividualObject to be added. schema.org already has https://schema.org/IndividualProduct (which would correspond to product instances identified by an SGTIN) but gs1:IndividualObject is broader because it would include a gs1:LogisticUnit identified by an SSCC or in individual asset identified by a GIAI.

Your table is great and I'm looking forward to harmonization, because we need these new classes and props for the Linked Data demo we're developing for GS1 Global Summit (Feb 2022).

Suggestions for improvement:

mgh128 commented 2 years ago

Hi @VladimirAlexiev , @philarcher

The GS1 Web vocabulary does already use xsd:date (or sometimes xsd:dateTime where appropriate) for properties having a rdfs:range of date / date-time - see for example https://www.gs1.org/voc/expirationDate . The YYMMDD within Phil's table is probably reflecting the format used within many GS1 Application Identifiers (please see https://www.gs1.org/standards/barcodes/application-identifiers?lang=en and click on the 'Advanced' view) and the GS1 Digital Link Semantics chapter explains how to do those conversions from YYMMDD to the appropriate YYYY-MM-DD xsd:date format - and likewise for various other AI date formats that sometimes include hours, minutes, seconds or express a start date and end date for a harvest date range within a 12-digit string.

So, the GS1 Digital Link URI examples that include query strings such as ?17=211110 are correct - but when these are translated into Linked Data, they're expressed as "gs1:expirationDate" : "2021-11-10"^^xsd:date

I'll try to do a more detailed comparison of both your efforts and suggest how we can merge these. I have already submitted a public review comment for EPCIS/CBV 2.0 to ensure that we can do this alignment work even after public review closes tomorrow evening at 10pm UK time. It will require submission of a separate work request to add extra classes and properties to the GS1 Web vocabulary, something which would probably have been done already if GS1 Digital Link v1.2 : Semantics had already been ratified promptly - but it's still worth doing anyway because (with the exception of a very small number of GS1 Application Identifiers such as (90) and (91)-(99) ) it should always be possible to translate an element string (GS1 Application Identifiers and their values) or a GS1 Digital Link URI into a block of Linked Data using terms within the GS1 Web vocabulary (and schema.org) - and we have attempted to support this in an open source JavaScript toolkit for GS1 Digital Link - see the final section of the demo page at https://gs1.github.io/GS1DigitalLinkCompressionPrototype/ - though this does require some further updates and improvement - and the alignment work between Phil's efforts, yours and my drafts for GS1 Digital Link Semantics is fundamental to making this improvement.

philarcher commented 2 years ago

Hi @VladimirAlexiev,

I have added the header rows to the tables. I had tried to do this originally but I see that I need to clone the nodes before I can insert them more than once - now taken care of.

As Mark says, the 6 digit date format only applies in GS1 syntaxes. The datatypes are indeed xsd:date and xsd:dateTime.

I have another tool in this vein that I need to update as well, see https://philarcher.org/gs1/2021/webvocdiff/.

If these are helpful, then I will put them in a repo so its easy for anyone to update as needed. They are, I'm afraid, rather brittle. I'm just parsing the JSON, not running SPARQL queries, but they do the job. The voc is getting bigger all the time so some sort of tooling is becoming more and more necessary.

VladimirAlexiev commented 2 years ago

@philarcher

datatypes are indeed xsd:date and xsd:dateTime

Then please change the hints to "YYYY-MM-DD".

great idea to introduce datatype gs1:AI for marking GS1 identifiers

As @mgh128 explained in another thread, this should only be used for skos:notation of props. But the range of identifier props should be mere xsd:string, eg

gs1:hasSerialNumber a owl:DatatypeProperty;
  skos:notation "21"^^gs1:AI;
  rdfs:domain gs1:IndividualProduct;
  rdfs:range xsd:string.