RalphTro / epcis-event-hash-generator

ALGORITHM and SOFTWARE PROTOTYPE to uniquely identify/validate the integrity of any EPCIS event through a common, syntax-agnostic approach based on hashing. Takes an EPCIS Document (formatted in either XML or JSON-LD) and returns the corresponding hash value(s).
MIT License
8 stars 4 forks source link

GS1 Web Voc Canonicalisation of standard voc elements #32

Closed RalphTro closed 3 years ago

RalphTro commented 3 years ago

See # 14: If present, any URN-based standard vocabulary value (starting with ‘urn:epcglobal:cbv’) SHALL be expressed in its corresponding GS1 Web Vocabulary URI equivalent (starting with ‘https://ns.gs1.org’). Example: ‘urn:epcglobal:cbv:bizstep:receiving’ --> ‘https://ns.gs1.org/cbv/BizStep-receiving

Echsecutor commented 3 years ago

The following need to be replaced:

return (inputStr.replace('urn:epcglobal:cbv:bizstep:', 'https://gs1.org/voc/Bizstep-').replace('urn:epcglobal:cbv:disp:', 'https://gs1.org/voc/Disp-').replace('urn:epcglobal:cbv:btt:', 'https://gs1.org/voc/BTT-').replace('urn:epcglobal:cbv:sdt:', 'https://gs1.org/voc/SDT-').replace('urn:epcglobal:cbv:er:', 'https://gs1.org/voc/ER-'))

where the url needs to be ns.gs1....