Re: [Json] Proposed minimal change for duplicate names in objects

Stefan Drees <> Thu, 04 July 2013 05:38 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id AC42821F9EF5 for <>; Wed, 3 Jul 2013 22:38:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.799
X-Spam-Status: No, score=-1.799 tagged_above=-999 required=5 tests=[AWL=0.450, BAYES_00=-2.599, HELO_EQ_DE=0.35]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 81XS9VU040bi for <>; Wed, 3 Jul 2013 22:38:24 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id A8FBB21F9EF0 for <>; Wed, 3 Jul 2013 22:38:22 -0700 (PDT)
Received: from ([]) by (mrweb004) with ESMTPSA (Nemesis) id 0LyOuM-1U7vgP3WMw-015uHv; Thu, 04 Jul 2013 07:38:17 +0200
Message-ID: <>
Date: Thu, 04 Jul 2013 07:38:14 +0200
From: Stefan Drees <>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7
MIME-Version: 1.0
To: John Cowan <>
References: <> <> <> <> <> <>
In-Reply-To: <>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:vovpNk7jDt3rFQcH1LhLOU0kOBBsPX8wUt100jnhtR2QKaVsfD9 B9fxRAUMTJZN9S3iR0oA2ONm18Zb/gVH5N57m1iR8Tp91b9Jg9ms5NRGWl/v4glI07w3T9a blxcFtlhis6Pl703jcAfdsabZm1ZIWRsOzyA/NpUvErj2YOQuxIIsPM9IJo7XDugnQJXtqX iphD+Kd3sBp1TWPC1oCvQ==
Cc: Nico Williams <>, Paul Hoffman <>, Eliot Lear <>, " WG" <>
Subject: Re: [Json] Proposed minimal change for duplicate names in objects
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 04 Jul 2013 05:38:29 -0000

On 2013-07-03 18:58 +02:00, John Cowan wrote:
> Stefan Drees scripsit:
>> JSON in the role of data interchange format allows at that point the
>> multiset use case. Bad behaviour IMO is when misusing this.
>> The expectation, that the unordered list of names in a single object
>> must form a set and not a multiset is questionable.
> Nevertheless, anyone who generates JSON with duplicate names in order to
> represent a multimap deserves to lose, because many, many JSON parsers
> will simply throw away all but the last as an unintended consequence of
> their implementation strategies.

"lose" what? If this "anyone" (it) wants a self-describing robust form 
to interchange data, it will annotate it with metadata accordingly, 
publish the dictionary, or choose microxml or the like.

We might share the view, that many applications exchanging data do also 
share information that is not inside the data. It may well be a one to 
one communication, not necessarily a one to many.

A say sensor automat observing some features, serializing the extracted 
info into JSON and pushing this to another collecting automat first 
finds some name for the subject ("Stefan") than estimates from 
processing further, that this should be tagged with attribute A 
("male"), starts a json object (to wrap it), enters the first member 
"Stefan":"male", eventualy pushes the json text part upstream, processes 
next observation B "native German", notes it linked to the same subject 
as member "Stefan": "native German" and pushes ...

Why not leave this possibility open, more human like bots might act this 
way very conveniently, mixing some serial processing somewhere along the 

Even I sometimes overwrite observations on other people in my personal 
storage ...

> I assume you mean a multimap rather than a multiset: a multiset would be
> most naturally represented as a JSON object whose values are integers
> representing the number of occurrences of a particular object in the
> multiset.  By the same token, the natural representation of a multiset
> is a JSON object whose values are arrays. whose order is semantically
> irrelevant.

hm, no, I wanted to focus on the "no-keyspace" not on what is associated 
with the names. Often a boundary condition enforces wrapping inside an 
object. It is often natural for me (as a person) to express my thoughts 
and feelings, but in some situation I better do not do it naturally.

>> {"Stefan":"male","Stefan":"native German","could not resist":true}
> {
>    "given name" : "John",
>    "gender" : "male",
>    "citizenship" : {"country" : "US", "source" : "jus soli"},
>    "ethnicity" : ["German", "Irish"],
>    "annotations" : {
>      "verbose" : true,
>      "machine-processable" : true
>    }
> }

That's very nice, John, thanks. But you gave it some thought, 
backtracked mayb, edited and it is very deep nested for a record missing 
the family name ;-) That could be some digested output of the receiving 
end in my "HumBotTalk" scenario above.

My "signature" was adhoc, expecting the JSON "reader" to strip the 
"last" member. The use case (described in more detail above) is more of 
the kind: Tag with a variable whatever (sha256 of an image?), associate 
predefined attributes with this "whatever" and push upstream as the 
analyzer detects.