Re: [Json] About JSON equality

"Joe Hildebrand (jhildebr)" <jhildebr@cisco.com> Tue, 19 February 2013 23:10 UTC

Return-Path: <jhildebr@cisco.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1622A21F89B2 for <json@ietfa.amsl.com>; Tue, 19 Feb 2013 15:10:20 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.599
X-Spam-Level:
X-Spam-Status: No, score=-10.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W0QWCMC+DABC for <json@ietfa.amsl.com>; Tue, 19 Feb 2013 15:10:18 -0800 (PST)
Received: from rcdn-iport-2.cisco.com (rcdn-iport-2.cisco.com [173.37.86.73]) by ietfa.amsl.com (Postfix) with ESMTP id 975B221F8A33 for <json@ietf.org>; Tue, 19 Feb 2013 15:10:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2708; q=dns/txt; s=iport; t=1361315418; x=1362525018; h=from:to:subject:date:message-id:in-reply-to:content-id: content-transfer-encoding:mime-version; bh=vHshpDFXWPo6QZlr+d6InoDPDpB17cYOuJl1GIQq51g=; b=DsUavTmSHpNbTkiwJxq6pKUNwytN2z3P7kkoD7qnjmYVgLwFAjVS4HfC pbSy52VHcTBhL++v8QgtfVGWdD6s1VJwqiQzxSfZRONh5xwCF9VZhnumo HDInc85YeEuv5fnYlxqJ6aJ9Oiz+7ySPP8CeGUJaQR8L3k/qtD5lwGGAB I=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AgAFAPwEJFGtJXG9/2dsb2JhbABFwESBDRZzgiEBBAEBATc0HQEIDhQUMQYLJQIEARIIh3gDDwywLoZADYlajDeCJjiCX2EDlFCCeIomhRWDB4FrJBg
X-IronPort-AV: E=Sophos;i="4.84,698,1355097600"; d="scan'208";a="178900143"
Received: from rcdn-core2-2.cisco.com ([173.37.113.189]) by rcdn-iport-2.cisco.com with ESMTP; 19 Feb 2013 23:10:15 +0000
Received: from xhc-aln-x14.cisco.com (xhc-aln-x14.cisco.com [173.36.12.88]) by rcdn-core2-2.cisco.com (8.14.5/8.14.5) with ESMTP id r1JNAFbN016589 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 19 Feb 2013 23:10:15 GMT
Received: from xmb-rcd-x10.cisco.com ([169.254.15.195]) by xhc-aln-x14.cisco.com ([173.36.12.88]) with mapi id 14.02.0318.004; Tue, 19 Feb 2013 17:10:15 -0600
From: "Joe Hildebrand (jhildebr)" <jhildebr@cisco.com>
To: Francis Galiegue <fgaliegue@gmail.com>, "json@ietf.org" <json@ietf.org>
Thread-Topic: [Json] About JSON equality
Thread-Index: AQHODvQ9KLrAMZlmKEWR9MVVfm4fnJiBvd6A
Date: Tue, 19 Feb 2013 23:10:14 +0000
Message-ID: <A723FC6ECC552A4D8C8249D9E07425A70F8980FE@xmb-rcd-x10.cisco.com>
In-Reply-To: <CALcybBAqONQ+UAzcnJFkphsQk=qSpLwdEoYR-6YETY2GP_EN6w@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/14.3.1.130117
x-originating-ip: [10.129.24.68]
Content-Type: text/plain; charset="us-ascii"
Content-ID: <24CE2E45CED9124B9D3C150CBFFBD3E8@cisco.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [Json] About JSON equality
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "Discussion related to JavaScript Object Notation \(JSON\)." <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Feb 2013 23:10:20 -0000

Are you proposing that this be added to 4627bis, or that it be in a
separate document?

Adding it to the existing spec expands that document's scope somewhat,
which we may want to avoid for a variety of reasons.

On 2/19/13 3:55 PM, "Francis Galiegue" <fgaliegue@gmail.com> wrote:

>The subject has been brought, even though somewhat indirectly, in
>another thread on this list, so here I will give a digest of what JSON
>Schema came up with.
>
>The definition of JSON value equality, as defined by the core
>specification, is as such (link:
>http://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.6):
>
>----
>Two JSON values are said to be equal if and only if:
>
>      both are nulls; or
>
>      both are booleans, and have the same value; or
>
>      both are strings, and have the same value; or
>
>      both are numbers, and have the same mathematical value; or
>
>      both are arrays, and:
>
>         have the same number of items; and
>
>         items at the same index are equal according to this definition;
>         or
>
>      both are objects, and:
>
>         have the same set of property names; and
>
>         values for a same property name are equal according to this
>         definition.
>----
>
>This definition is only lacking for strings. On some other draft which
>I cannot remember off the top of my head, two JSON String values are
>to be considered equal if, position wise, their Unicode code points
>are the same (and THAT INCLUDES \u0000).
>
>Now, what is the value of defining equality of two JSON values in the
>general case (see also my mail about why having to restrict JSON
>representations to container instances)?
>
>Of course, there is also the problem that for numeric instances, some
>programming languages/parsers cannot guarantee that, since they cannot
>reliably represent said instances in a reliable manner, but then this
>is why the validation spec explicitly mentions this:
>http://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-3.2
>
>About strings and the famous "zero character", this same specification
>also says: 
>http://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-3.1
>
>Yes, nothing forbids "\u0000" in a JSON string.
>
>All this to say, should an equality definition find its place in a
>potentially revised JSON RFC? Personally, I'm not so sure...
>
>--
>Francis Galiegue, fgaliegue@gmail.com
>Try out your JSON Schemas: http://json-schema-validator.herokuapp.com
>_______________________________________________
>json mailing list
>json@ietf.org
>https://www.ietf.org/mailman/listinfo/json
>



-- 
Joe Hildebrand