W3C home > Mailing lists > Public > public-linked-json@w3.org > April 2017

Re: Language maps and undefined language

From: Robert Sanderson <azaroth42@gmail.com>
Date: Thu, 13 Apr 2017 07:38:03 -0700
Message-ID: <CABevsUGo94P_49kAGx35nDkpjmA1AuQkemYXNYUPtaH76iR6Eg@mail.gmail.com>
Cc: Linked JSON <public-linked-json@w3.org>
Personally, I would be happy with "" ... I was simply relaying a previously
received objection to it.  If that isn't an actual technical hurdle, then
great!

Rob

On Thu, Apr 13, 2017 at 3:32 AM, Jakob Voß <Jakob.Voss@gbv.de> wrote:

> Hi again,
>
> Rob wrote:
>
> Note that we cannot use "", as noted, because PHP does not support
>>> empty string as the key of a dictionary... and thus we fallback to
>>> using "und”.
>>>
>>
> "" is a legal object key in JSON and PHP just happens to be one
> programming languages with full support of JSON, so why design JSON-LD with
> focus on a particular choice of implementation in PHP? The language can
> deal with "" keys in JSON data pretty well:
>
> <?php
> $json = '{"":1}';
> $data = json_decode($json, true);
> echo $data[""]; # prints '1'
> ?>
>
> If you prefer PHP objects over PHP arrays, the "" can internally be
> replaces by another special value but that's a personal choice of
> implementation and out of the scope of JSON-LD.
>
> Using "" for non-language strings looks like the cleanest and most obvious
> solution to me.
>
> Jakob
>
> --
> Jakob Voß <jakob.voss@gbv.de>
> Verbundzentrale des GBV (VZG) / Common Library Network
> Platz der Goettinger Sieben 1, 37073 Göttingen, Germany
> +49 (0)551 39-10242, http://www.gbv.de/
>



-- 
Rob Sanderson
Semantic Architect
The Getty Trust
Los Angeles, CA 90049
Received on Thursday, 13 April 2017 14:38:43 UTC

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