Re: [Jsonpath] The draft: ambiguous language

Tim Bray <tbray@textuality.com> Mon, 07 December 2020 20:45 UTC

Return-Path: <tbray@textuality.com>
X-Original-To: jsonpath@ietfa.amsl.com
Delivered-To: jsonpath@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 600F43A0983 for <jsonpath@ietfa.amsl.com>; Mon, 7 Dec 2020 12:45:14 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=textuality-com.20150623.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qpA_WvW_8svB for <jsonpath@ietfa.amsl.com>; Mon, 7 Dec 2020 12:45:12 -0800 (PST)
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3CA203A097C for <jsonpath@ietf.org>; Mon, 7 Dec 2020 12:45:12 -0800 (PST)
Received: by mail-lf1-x12f.google.com with SMTP id b4so12404564lfo.6 for <jsonpath@ietf.org>; Mon, 07 Dec 2020 12:45:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=textuality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nMn1AYRx3jB+gVuI1JsnNDrF4306ewutkhX4m3t03sA=; b=ELgB1p1KSL2UaHjKGMuq7vOX24c0rpzPM8l7fivrpZMOeCgygLyGLatqHZRDhVhntX BdUhfxSup7YVcNDZ2twrzjGZ2cocFmQBPQCY+/mAXvSwqiKXJsQZ+9ePHrsnRzjIbBKH otGL1pU5NfX0zB3nXe2Iq0OAe4lgl5o/C0d/RhU0+/1Qaj/Zocvrb6RTOyAdmFGZUTu9 mtZSmfGkdo+Ob9PylFMeVrQLVKEaN67txzFYfYqwHk91LEazejkPkHupa4nAB11pjIg7 jx6I9xDntgOQQ4hWL1bhqpztwATPjQ94G8GyQcr8CJFGYebyHX3R69VpGbjqlaZ8ClrX 2ybQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nMn1AYRx3jB+gVuI1JsnNDrF4306ewutkhX4m3t03sA=; b=lhwO1tvuCXocFpVDLbyKcBqa/T/yKulqwkqoaT2omR1mwweci6y/ExQt8A3I3cJLry VPeQec0fUS9yE676YRz6FKfxge6LuU/+cqGxQvHVHuaL2LtrtlfnBzR/zhm3Br6vDB0M /KODhUBdVVc0/LtnbCZaueL257QiPIvERTKzQ+ssGvJrEPMWN+59eoceBeIUhYgIh8hf xK2QL5BJzHUgZ1FbwZfyVrni/JfDu6x5PWwAypLPFfgpk3PPCm4URYoAsBfwUhUOfYSF ZH64DmVF7XELfItDghg+8CPbqW58LVwfgmnVuSKvfwzQlIIN7Yw2iyV8Wkna7UMxB7NG LNXA==
X-Gm-Message-State: AOAM531yAbdpg+MYLR4n9s5gTKTGi/wJwTo71Dy4sx/WWS4+XJvZXup8 aBhd60HS+pvPvnulb0NniO22KMFX03fMJvDlwaEP5RyRfqJCPA==
X-Google-Smtp-Source: ABdhPJy0Ro8ZggWq5DHgNvbGuH7dm9kCvRggi8DYp/4aRKmGdNAiuRqexEtvf81+XJseYQ+inUIpug3Qa4hUYDA3FH8=
X-Received: by 2002:a19:40d6:: with SMTP id n205mr2719248lfa.24.1607373910344; Mon, 07 Dec 2020 12:45:10 -0800 (PST)
MIME-Version: 1.0
References: <mailman.2754.1607359255.8352.jsonpath@ietf.org> <CA+mwktLNdF+Hw+Dwfe=r8pSL0T+BuebrRXZ3iqd2=ESZxSDi3w@mail.gmail.com>
In-Reply-To: <CA+mwktLNdF+Hw+Dwfe=r8pSL0T+BuebrRXZ3iqd2=ESZxSDi3w@mail.gmail.com>
From: Tim Bray <tbray@textuality.com>
Date: Mon, 07 Dec 2020 12:44:59 -0800
Message-ID: <CAHBU6iuQ_=PWVxHV_T8YgiYVYwNdWGK5ERYt7ugLjic8sbu1Dg@mail.gmail.com>
To: Daniel P <danielaparker@gmail.com>
Cc: jsonpath@ietf.org
Content-Type: multipart/alternative; boundary="000000000000f29c6005b5e5e648"
Archived-At: <https://mailarchive.ietf.org/arch/msg/jsonpath/W8HnQcbxB6bdb3aeR1-LAVbivTE>
Subject: Re: [Jsonpath] The draft: ambiguous language
X-BeenThere: jsonpath@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: A summary description of the list to be included in the table on this page <jsonpath.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jsonpath>, <mailto:jsonpath-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jsonpath/>
List-Post: <mailto:jsonpath@ietf.org>
List-Help: <mailto:jsonpath-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jsonpath>, <mailto:jsonpath-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 07 Dec 2020 20:45:14 -0000

All those points granted, I think we should proceed and as a WG adopt the
draft, then you can turn all those issues you just raised into WG issues
and we can proceed to work through them in an orderly way.

On Mon, Dec 7, 2020 at 12:38 PM Daniel P <danielaparker@gmail.com> wrote:

> My general comment is that there is a lot of ambiguous language in the
> draft, and ambiguous language is the bane of implementers. Some
> examples below:
>
> One. "Data Item: A structure complying to the generic data model of
> JSON, i.e., composed of containers such as arrays and maps (JSON
> objects), and of atomic data such as null, true, false, numbers, and
> text strings."
>
> Why introduce the term "map" as the preferred (unparenthized) term?
> RFC 8259 doesn't mention "map", it uses JSON object.  By following
> "arrays and maps" with "(JSON objects)", it could be read that "arrays
> and maps" will collectively be referred to as "JSON objects". Later in
> the draft we read "the root object" ($) and "the current object" (@),
> which almost suggest that that is the intended meaning.
>
> My own view is that the terminology should stay consistent with RFC
> 8259, and that the word "object" should not be used for items that are
> not JSON objects in the sense of RFC 8259.
>
> What is the purpose of "such as" in the sentence? Aren't the
> itemizations exclusive?
>
> Two. "Since a JSON data item is usually anonymous and doesn't
> necessarily have a "root member object", JSONPath used the abstract
> name $ to refer to the top level object of the data item."
>
> I realize this sentence is mostly copied from Goessner, but I didn't
> understand it there either. Regarding "doesn't necessarily" have a
> "root member object", what is that supposed to mean? It seems to me
> that the root is _always_ going to be an anonymous JSON value, which,
> when Goessner was writing, could be a JSON array or object, and since
> RFC 8259, any JSON value.
>
> Three.  "Where a JSONPath processor uses JSONPath expressions as
> output paths, these will always be converted to the more general
> bracket-notation."
>
> For output paths, Goessner uses the term "normalized path
> expressions", which should be unambiguously defined. For uniqueness,
> in addition to avoiding dot-notation, there would need to be other
> restrictions, including avoiding the descendant operator .., and
> filters.
>
> Four. "The symbol @ is used for the current object."
>
> Only if you interpret "object" to mean _any_ JSON value. In the
> example above this sentence,
>
> $.store.book[(@.length-1)].title
>
> the symbol @ refers to a JSON array, with a JavaScript like property
> "length".
>
> That arrays must support a JavaScript like property length is not
> explicitly stated in the draft, but is implied in two examples. This
> should be clarified. Not all implementations do, for example,
> implementations that support functions that can be invoked at the tail
> end of a path typically support a function call length() instead.
>
> I also think the @ notation could be better explained, this particular
> reader struggled to understand what was meant by "current object" in
> original Goessner, and had to figure it out from examples.
>
> Daniel
>
> --
> Jsonpath mailing list
> Jsonpath@ietf.org
> https://www.ietf.org/mailman/listinfo/jsonpath
>