[Jsonpath] Early description of "selectors"

Erik Auerswald <auerswal@unix-ag.uni-kl.de> Sun, 07 May 2023 18:41 UTC

Return-Path: <auerswal@unix-ag.uni-kl.de>
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 39831C14CE54 for <jsonpath@ietfa.amsl.com>; Sun, 7 May 2023 11:41:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NfJv7AbNIRLT for <jsonpath@ietfa.amsl.com>; Sun, 7 May 2023 11:40:58 -0700 (PDT)
Received: from mailgw1.uni-kl.de (mailgw1.uni-kl.de [IPv6:2001:638:208:120::220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 48F05C14CF1A for <jsonpath@ietf.org>; Sun, 7 May 2023 11:40:57 -0700 (PDT)
Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de [IPv6:2001:638:208:ef34:0:ff:fe00:65]) by mailgw1.uni-kl.de (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id 347Ieri5005051 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <jsonpath@ietf.org>; Sun, 7 May 2023 20:40:53 +0200
Received: from sushi.unix-ag.uni-kl.de (ip6-localhost [IPv6:::1]) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id 347Ier06013042 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 7 May 2023 20:40:53 +0200
Received: (from auerswal@localhost) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Submit) id 347IeqSY013041; Sun, 7 May 2023 20:40:52 +0200
Date: Sun, 07 May 2023 20:40:52 +0200
From: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
To: jsonpath@ietf.org
Message-ID: <20230507184052.GA12421@unix-ag.uni-kl.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
Author: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
Archived-At: <https://mailarchive.ietf.org/arch/msg/jsonpath/e8UL50uitlKOk6bXAIiLLNuuQ2o>
Subject: [Jsonpath] Early description of "selectors"
X-BeenThere: jsonpath@ietf.org
X-Mailman-Version: 2.1.39
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: Sun, 07 May 2023 18:41:00 -0000

Hello JSONPath Working Group,

thanks for your work on standardizing query expressions for JSON!

I have not yet used JSONPath and looked at the current I-D to learn
about it.  While reading draft-ietf-jsonpath-base-13, I wondered for
quite some time how "selectors" fit into a JSONPath expression.

I also wondered about the meaning of early examples using selector
lists inside a segment, e.g., "$..book[0,1]", and if this only supported
index selectors.  Next came the "$.o[*,*]" example, that additionally
showed wildcard selectors.  But only section 2.5.1 "Child Segment", much
later in the document, introduced the generic "comma-separated sequence
of selectors" without restriction to one or two selector variants.

Perhaps the initial descriptions of "segments" could be expanded a bit
to already mention "selectors"?

I'd like to suggest the following small additions to the early parts of
the draft:

1. Fill the square brackets in the definition of "segment" in the
   "Terminology" section 1.1 with "<selectors>":

   OLD:

     Segment:  One of the constructs which select children ([]) or
        descendants (..[]) of an input value.

   NEW:

     Segment:  One of the constructs which select children ([<selectors>])
        or descendants (..[<selectors>]) of an input value.

2. Fill the square brackets in the description in section 1.4.2 "Segments"
   with "<selectors>":

   OLD:

      Segments select children ([]) or descendants (..[]) of an input
      value.

   NEW:

      Segments select children ([<selectors>]) or descendants
      (..[<selectors>]) of an input value.

3. Mention in section 1.4.2 "Segments" that bracket notation allows to use
   one or more selectors per segment (and supports all selector variants):

   OLD:

      A JSONPath expression may use a combination of bracket and dot
      notations.

   NEW:

      Bracket notation supports all selector variants.  It also allows to
      use more than one selector per segment (commas between selectors).

      A JSONPath expression may use a combination of bracket and dot
      notations.

Best regards,
Erik

P.S. Please keep me in Cc: of replies, since I am not subscribed to this
     mailing list.