uncefact / spec-jsonld

Exposing the UN/CEFACT vocabulary as web semantics
https://service.unece.org/trade/uncefact/vocabulary/uncefact/
13 stars 5 forks source link

LD Context: `@vocab` incorrect #143

Closed jmcanterafonseca-iota closed 1 year ago

jmcanterafonseca-iota commented 1 year ago

with regards to

The LD Context is including, "@vocab": "https://vocabulary.uncefact.org/" but that is essentially a bad idea as it would mean any term included by a JSON-LD document that does not have a mapping it will be end up being trapped under "https://vocabulary.uncefact.org/" and that is incorrect. That was a long discussion in EPCIS 2.0, and we removed it, @vocab it can lead to undesired effects like this, see for instance the expanded tuples resulting from

{
  "@context": "https://vocabulary.uncefact.org/unece-context.jsonld",
  "@type": "Consignment",
  "destinationCountry": "ES",
  "myRandomProp": "5671230"
}

myRandomProp would be incorrectly mapped to the UN/CEFACT Vocabulary incorrectly.

The @vocab keyword leads users to bad mappings of unknown / mispelled properties and probably to undesirable effects.

For example if someone mistypes a vocabulary term, for instance because it uses a similar word with the same meaning or misspells it such a but not present in the vocabulary he won't be able to detect the mistake, example

{
    "@context": "https://vocabulary.uncefact.org/unece-context.jsonld",
   "@type": "Acreditation"
}
nissimsan commented 1 year ago

https://schema.org/docs/jsonldcontext.json does include @vocab. But indeed https://www.gs1.org/docs/gs1-smartsearch/gs1Voc_v1_7.jsonld does not.

I can argue both ways. Let's go with the GS1 approach and remove.

nissimsan commented 1 year ago

We did this.