Re: JSON-LD (Was:Re: Vaccination Certificate Test Suite)

> Yes, that's strange that they're defined at the top and then re-defined.
We'd
have to ask Tobias, who wrote the context, why he chose to do that. The
Vaccination Certificate Vocabulary uses "JSON-LD Scoped Contexts", which are
an advanced feature of JSON-LD. These are "type-scoped", which basically
means
"these definitions ONLY apply when a particular type is used".

Yes you are correct to point out that these are duplicate definitions it
means you can use the terms with or without qualifying the VC's type as
VaccinationCertificate. I sourced the syntax from the citizenship vocab
<https://w3c-ccg.github.io/citizenship-vocab/contexts/citizenship-v1.jsonld>,
happy to remove it, if it is creating confusion? I expect these attributes
will be folded back into a revised VC context with the 1.1 work see here
for a PR <https://github.com/w3c/vc-data-model/pull/752>.

> The difference being XML Schema dateTime vs. date. All that said, perhaps
Tobias meant to define it as a dateTime (which means all of the tests are
wrong), or we really do want it to be a date (which means the JSON-LD
Context
is wrong)

Apologies, the IRI for this term is in-correct it should be
http://www.w3.org/2001/XMLSchema#date it will need to be updated.

Thanks,
[image: Mattr website] <https://mattr.global>
*Tobias Looker*
Mattr
+64 (0) 27 378 0461
tobias.looker@mattr.global
[image: Mattr website] <https://mattr.global> [image: Mattr on LinkedIn]
<https://www.linkedin.com/company/mattrglobal> [image: Mattr on Twitter]
<https://twitter.com/mattrglobal> [image: Mattr on Github]
<https://github.com/mattrglobal>
This communication, including any attachments, is confidential. If you are
not the intended recipient, you should not read it - please contact me
immediately, destroy it, and do not copy or use any part of this
communication or disclose anything about it. Thank you. Please note that
this communication does not designate an information system for the
purposes of the Electronic Transactions Act 2002.


On Tue, Apr 27, 2021 at 2:03 AM Manu Sporny <msporny@digitalbazaar.com>
wrote:

> On 4/26/21 8:03 AM, Nikos Fotiou wrote:
> > I will begin by apologizing for the dump questions, but I still haven't
> completely understood JSON-LD. I have two questions regarding
> https://w3c-ccg.github.io/vaccination-vocab/context/v1/index.json
>
> Nikos, no reason to apologize... these are all great questions *and* you
> found
> a few bugs in the experimental Vaccination Vocabulary JSON-LD Context,
> which
> is always of great benefit to the community -- so, thank you! :)
>
> > 1) What is the purpose of lines 7-10, i.e.,
> >         "description": "http://schema.org/description",
> >         "identifier": "http://schema.org/identifier",
> >         "name": "http://schema.org/name",
> >         "image": "http://schema.org/image"
> > and why these attributes are redefined inside VaccinationCertificate
> attribute (lines 18-21)?
>
> Yes, that's strange that they're defined at the top and then re-defined.
> We'd
> have to ask Tobias, who wrote the context, why he chose to do that. The
> Vaccination Certificate Vocabulary uses "JSON-LD Scoped Contexts", which
> are
> an advanced feature of JSON-LD. These are "type-scoped", which basically
> means
> "these definitions ONLY apply when a particular type is used".
>
> So, if you look at this line:
>
>
> https://github.com/w3c-ccg/vaccination-vocab/blob/master/context/v1/index.json#L11
>
> The definitions under VaccinationCertificate, such as "description" and
> "image" ONLY apply if the type of the object is "VaccinationCertificate".
>
> More on scoped contexts here:
>
> https://www.w3.org/TR/json-ld11/#scoped-contexts
>
> > 2)  In various places there is the following line
> > "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
> >
> > Firstly, I thought that the @type property would lead to something
> machine readable so that type checks are automated. Even if this is not the
> case, http://www.w3.org/2001/XMLSchema#dateTime contains no information
> about this type. Is there any implicit agreement that this URL corresponds
> to a "date"? The closest I found by following links was that
> > https://www.w3.org/TR/xmlschema11-2/#dateTime
> >
> > But even this, it says: "dateTime uses the date/timeSevenPropertyModel,
> with no properties except timezoneOffset permitted to be absent." Hence
> **if** this is the correct type, all the examples are not correct since
> they do not include the time part, in the `birthDate` attribute which is of
> that type.
>
> You've found a bug in the JSON-LD Context... those values should be:
>
> http://www.w3.org/2001/XMLSchema#date
>
> which is defined here:
>
> https://www.w3.org/TR/xmlschema11-2/#date
>
> JSON-LD is NOT a schema constraint language. It is not designed to do what
> JSON Schema does. Instead, it is a semantics expression language that
> attempts
> to be highly aligned with the way JSON developers use JSON out in the real
> world.
>
> So, the thing that these lines do:
>
>
> https://github.com/w3c-ccg/vaccination-vocab/blob/master/context/v1/index.json#L34-L37
>
> is basically state "If you see `dateOfVaccination`, the long form of that
> identifier is `https://w3id.org/vaccination#dateOfVaccination`
> <https://w3id.org/vaccination#dateOfVaccination>, and you should
> assume it is a date-time value as defined in XML Schema."
>
> That statement is, of course, wrong. Instead, it should be "If you see
> `dateOfVaccination`, the long form of that identifier is
> `https://w3id.org/vaccination#dateOfVaccination`
> <https://w3id.org/vaccination#dateOfVaccination>, and you should assume
> it is
> a `date` value as defined in XML Schema."
>
> The difference being XML Schema dateTime vs. date. All that said, perhaps
> Tobias meant to define it as a dateTime (which means all of the tests are
> wrong), or we really do want it to be a date (which means the JSON-LD
> Context
> is wrong).
>
> I'll wait for Tobias to chime in to provide his thought process before
> suggesting changes.
>
> -- manu
>
> --
> Manu Sporny - https://www.linkedin.com/in/manusporny/
> Founder/CEO - Digital Bazaar, Inc.
> blog: Veres One Decentralized Identifier Blockchain Launches
> https://tinyurl.com/veres-one-launches
>
>
>

-- 
This communication, including any attachments, is confidential. If you are 
not the intended recipient, you should not read it - please contact me 
immediately, destroy it, and do not copy or use any part of this 
communication or disclose anything about it. Thank you. Please note that 
this communication does not designate an information system for the 
purposes of the Electronic Transactions Act 2002.

Received on Monday, 26 April 2021 21:19:12 UTC