[Jsonpath] The draft: ambiguous language

Daniel P <danielaparker@gmail.com> Mon, 07 December 2020 20:38 UTC

Return-Path: <danielaparker@gmail.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 24BC63A0A0B for <jsonpath@ietfa.amsl.com>; Mon, 7 Dec 2020 12:38:47 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 RNULvcNBlvNs for <jsonpath@ietfa.amsl.com>; Mon, 7 Dec 2020 12:38:45 -0800 (PST)
Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (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 8EBBD3A09C5 for <jsonpath@ietf.org>; Mon, 7 Dec 2020 12:38:45 -0800 (PST)
Received: by mail-wr1-x42b.google.com with SMTP id y17so4665222wrr.10 for <jsonpath@ietf.org>; Mon, 07 Dec 2020 12:38:45 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Ol9hdAMiV9soOcW+nXrahrQSYllIjgZWznoe5JZN4uQ=; b=vLm3mSk9g6d+3bJEXEQkh5qyyPbF1VHQscjBC1/T7WBYjNrIvbboHDH25F80vbDP1d vSZKFRWb+pmnz194HwTywqS3sz7uxHlsuVoADdk6J3/d95kTIGumN/iegtoVrNyEMv1g eYn4G4mHJiP2EeNaoePaDOl2EJ/aI2etd3doBfqCGSswZ+/8oyNpXsRBtXCTUZS+fRLj px1f+HQFNVo0OkefM6g/5cQzRXKFNx9zjpob1nlLOromvTt7yCntq7TkQWOq2KM4vc2C iFJn8U2nNq7oWso3lYzW231qOkLUcOhS8Sm2B2ich+0/mGXIJnwNEZqREajigQm32Cny q6SA==
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; bh=Ol9hdAMiV9soOcW+nXrahrQSYllIjgZWznoe5JZN4uQ=; b=D7S38LAFXoKOmHFGGRCN2QR5MLu34iemltDsjE2tVLNMYp9UWf2hTkrzDdxcyqIIDW VSH9DErAKod/x9VYGNBbOOMkIJ/5c5pGXzJZDgGzhVQL8jgwicdjf5PzHqTe5j1Hqh5z 7Duoa78nlKqqqKYXhqwdpF7jEu+EIAWxRBzHDh95c+aT+jBmw4Cy/dR3UhWayyT5YlVB bHvKTreBRuH4Qz7JI+UkiSuVfLs0507fSmz4Ce5Cb60hhi7CUgHQbkhPLewkPeEaFKw4 V/tc84wnrhQigkt2lQBZJrT+WKkPhXP78LRWUTxzFpxklY/JScpSCbFhz5MvOmjLlnn+ tMiA==
X-Gm-Message-State: AOAM530REoKmy4WIze/tbyFU1bkrXHZIsWfHYarSJxO7UjISOWaKphLY ch2oGkEdpQJD1CsduKkKOObw84TNUmbrI9FLyI6znJfvxJ4jiQ==
X-Google-Smtp-Source: ABdhPJy/tgzjHXWwyyyRknSqRiWvysLFSwYNPs1Ii2wu8yk29AxtddEn/VBLcI9DZv4Gr3cc1AbpynWrKmJArlphYBk=
X-Received: by 2002:adf:fd06:: with SMTP id e6mr21018182wrr.206.1607373523570; Mon, 07 Dec 2020 12:38:43 -0800 (PST)
MIME-Version: 1.0
References: <mailman.2754.1607359255.8352.jsonpath@ietf.org>
In-Reply-To: <mailman.2754.1607359255.8352.jsonpath@ietf.org>
From: Daniel P <danielaparker@gmail.com>
Date: Mon, 07 Dec 2020 15:38:31 -0500
Message-ID: <CA+mwktLNdF+Hw+Dwfe=r8pSL0T+BuebrRXZ3iqd2=ESZxSDi3w@mail.gmail.com>
To: jsonpath@ietf.org
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/jsonpath/daZQ403OYtk_JEA-JZ1kUFKBoPQ>
Subject: [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:38:47 -0000

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