W3C home > Mailing lists > Public > public-linked-json@w3.org > August 2018

Re: Why is the value of @version a number?

From: Gregg Kellogg <gregg@greggkellogg.net>
Date: Fri, 17 Aug 2018 15:01:49 -0700
Cc: public-linked-json@w3.org
Message-Id: <6E0C7663-BC1A-4DD8-8A5F-A6D8B9D618B4@greggkellogg.net>
To: Lutz Helm <helm@ub.uni-leipzig.de>
> On Aug 17, 2018, at 6:52 AM, Lutz Helm <helm@ub.uni-leipzig.de> wrote:
> 
> Hi,
> 
> I just stumbled upon the fact that @version has to be a number in json-ld 1.1 contexts. Is there any reason why this is not a string?
> I guess it shouldn't ever happen that a spec is released as patch version, and there will probably not be more than eight more versions with nonbreaking changes to the spec, so a decimal number might suffice, but I'm still a little bit puzzled.

The reason @verion is a number, specifically 1.1, is so that a 1.0 processor not prepared for it will through an error, as every other value must either be a string, null, or an object. We want a 1.0 processor to stop processing so that it does not interpret the context and associated JSON-LD in a way which is different than a 1.1 processor would, so we make sure it will raise an exception.

Gregg

> Best regards,
> Lutz
> 
> -- 
> Lutz Helm
> Bereich Digitale Dienste
> AG Anwendungsentwicklung
> 
> Universit├Ątsbibliothek Leipzig
> Beethovenstra├če 6, 04107 Leipzig
> 
> T: +49 341 97 30566
> 
> helm@ub.uni-leipzig.de
> https://www.ub.uni-leipzig.de/
> 
> 
Received on Friday, 17 August 2018 22:02:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:18:52 UTC