Re: Language maps and undefined language

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/

Received on Thursday, 13 April 2017 10:32:50 UTC