
From nobody Tue Feb  1 10:25:27 2022
Return-Path: <glyn.normington.work@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 B20623A192E for <jsonpath@ietfa.amsl.com>; Tue,  1 Feb 2022 10:25:25 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level: 
X-Spam-Status: No, score=-2.097 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=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 z-GQZNV1j1Va for <jsonpath@ietfa.amsl.com>; Tue,  1 Feb 2022 10:25:24 -0800 (PST)
Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (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 027573A192C for <jsonpath@ietf.org>; Tue,  1 Feb 2022 10:25:23 -0800 (PST)
Received: by mail-il1-x129.google.com with SMTP id z18so6232773ilp.3 for <jsonpath@ietf.org>; Tue, 01 Feb 2022 10:25:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;  h=mime-version:from:date:message-id:subject:to; bh=iJ9DLqqHEPpPkpESVt/2y5cRz0xO/17zAx0YQeNXh2g=; b=F3zi2VXvUEg3bYdI8d9wpgCDC3w/pJuFo5IqD3Z6WiM3MYgMdTXrakHJK4rwbXY57n ekh1+7jBOhkLeiyeUMjiJjeR9RHK1bgpEUs4ATX1lFuXCxGucms1BCPZtBPbir8w9azP OiJB0Ib9LmcGl15FCyCuvrvM0ZApLo9ChV2XdczS59nYuGooPfyKzVpJSoHsu7ilItsd EHtHnRf+T0kIX+EiX1NhZP+a+bOW7NaUm0cy+Xc4xgakOwg+qRTFUvEc26xd3aG1FoGt 8JumuZ0kRqgl8PN34znDknhrcubLzNtLnWef+W5sFsICeO1XkMQSvMfBYJYksgb0WF4M UU4Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=iJ9DLqqHEPpPkpESVt/2y5cRz0xO/17zAx0YQeNXh2g=; b=dqrNcJkOP0hKJIQHDeBJbPebQHVMHIaQZvW8QeDGe+/xKUcRRhn+VT6A20s7nT4XnJ xWPHbRna3QwMuQLAjY5Me5FzrXOBKaxQC11Q2mUNTghiRrJnlSPSWwq/ClpZqyChB90k HO6fM+evokyNK0e3U3UugpEe988hPV7t9EhCBosgiQ9cHOlykLZNihY85Igv8GFqXco2 pJKhmG6FnjS5NT5mWbX4N/OMqOSeRSau+HABJ9tLuFLvdRy9cxzqH1klwjc9ZHrnnyLg GgWeBhse9qxjH/QNATWVgt7QkQdpxE3LAglKRAAyjHY7DhgnkIzA5q4Ue+H/K6nvX+W8 tt7g==
X-Gm-Message-State: AOAM530lLj/OtNOqdf+cEBjIP2qLQKOiHaiR8YbpgvhlD/jhiD8A2H4/ pPV4QtA21dr4Z4sH+eyzn0Ur5kc4CeWyHgyLtShxZYQRolQ=
X-Google-Smtp-Source: ABdhPJyTVs8aDbrc+aORclBFpKTS/pYA6kyBwFrPd+FCk7oEbjioiwxA5BGrd/YPTWpEOv7DnW+69CEpmQ7hXneVRoY=
X-Received: by 2002:a05:6e02:1449:: with SMTP id p9mr2884422ilo.289.1643739922044;  Tue, 01 Feb 2022 10:25:22 -0800 (PST)
MIME-Version: 1.0
From: Glyn Normington <glyn.normington.work@gmail.com>
Date: Tue, 1 Feb 2022 18:25:11 +0000
Message-ID: <CANH0Gb+uwG7=eWpk3Eba4YyoD8SYBUBZ0MjF0SU+NX0=PBnqVw@mail.gmail.com>
To: jsonpath@ietf.org
Content-Type: multipart/alternative; boundary="0000000000002818da05d6f90645"
Archived-At: <https://mailarchive.ietf.org/arch/msg/jsonpath/QdNH2xaDFA1onYqZhyl8pqLm7Yk>
Subject: [Jsonpath] Canonical Normalized Paths
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: Tue, 01 Feb 2022 18:25:26 -0000

--0000000000002818da05d6f90645
Content-Type: text/plain; charset="UTF-8"

 A normalized path is a JSONPath expression which identifies a specific
node in a given JSON document. The main use case is for JSONPath
implementations that return normalized paths instead of, or in addition to,
the values identified by these paths.

PR 152 has generated some discussion of normalized paths and whether to
nail these down into a canonical form.

The other extreme would be to allow a normalised path to be any JSONPath
expression which identifies a specific node in a given JSON document. This
could include expressions such as:

* $.a
* $['a']
* $["a"]
* $['\u0061']
* $["\u0061"]

all of which are equivalent, regardless of the JSON document they are used
to query. It could also include the, admittedly unlikely, expression $[-1].

Before the editors go further, I wanted to check that there is a consensus
in principle for a canonical form.

[1]
https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/pull/152/files

--0000000000002818da05d6f90645
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div> A normalized path is a JSONPath expression which ide=
ntifies a specific node in a given JSON document. The main use case is for =
JSONPath implementations that return normalized paths instead of, or in add=
ition to, the values identified by these paths.<br></div><div><br></div><di=
v>PR 152 has generated some discussion of normalized paths and whether to n=
ail these down into a canonical form.</div><div><br></div><div>The other ex=
treme would be to allow a normalised path to be any JSONPath expression whi=
ch identifies a specific node in a given JSON document. This could include =
expressions such as:</div><div><br></div><div>* $.a</div><div>* $[&#39;a&#3=
9;]</div><div>* $[&quot;a&quot;]</div><div>* $[&#39;\u0061&#39;]</div><div>=
* $[&quot;\u0061&quot;]</div><div><br></div><div>all of which are equivalen=
t, regardless of the JSON document they are used to query. It could also in=
clude the, admittedly unlikely, expression $[-1].</div><div><br></div><div>=
Before the editors go further, I wanted to check that there is a consensus =
in principle for a canonical form.<br></div><div><br></div><div>[1] <a href=
=3D"https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/pull/152/f=
iles">https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/pull/152=
/files</a></div></div>

--0000000000002818da05d6f90645--


From nobody Tue Feb  1 10:35:40 2022
Return-Path: <julian.reschke@gmx.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 AD6BB3A1979 for <jsonpath@ietfa.amsl.com>; Tue,  1 Feb 2022 10:35:37 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.611
X-Spam-Level: 
X-Spam-Status: No, score=-7.611 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.714, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=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 (1024-bit key) header.d=gmx.net
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 frWr3K1N4pmo for <jsonpath@ietfa.amsl.com>; Tue,  1 Feb 2022 10:35:35 -0800 (PST)
Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (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 0CBF53A1972 for <jsonpath@ietf.org>; Tue,  1 Feb 2022 10:35:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1643740533; bh=Zlv16i2zzTifHvoILEmpX2q3zMQ6DuxoC7DmJh3Fw+c=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=ZcS2RX5h3qG5AMgAa+w9CMraBiuVR4KIYxsSHMepOfAVCXeNiPrIK/exhv4hfqI3T ECEEz9iESMQSRNNXIIkxU5XVtOnWvwHprdFRswIkYnDenAhacPDeSaN5oGgMRCuuIU SVl/rY0XW4AGp70mupambvV1nBBpjeA3qPXg4ynU=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.178.179] ([91.61.56.94]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1McH5a-1menIv0Eou-00chWJ for <jsonpath@ietf.org>; Tue, 01 Feb 2022 19:35:33 +0100
Message-ID: <c4117877-d76f-e565-e84f-0441cab7f3fe@gmx.de>
Date: Tue, 1 Feb 2022 19:35:31 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1
To: jsonpath@ietf.org
References: <CANH0Gb+uwG7=eWpk3Eba4YyoD8SYBUBZ0MjF0SU+NX0=PBnqVw@mail.gmail.com>
From: Julian Reschke <julian.reschke@gmx.de>
In-Reply-To: <CANH0Gb+uwG7=eWpk3Eba4YyoD8SYBUBZ0MjF0SU+NX0=PBnqVw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:pcRT9uH+XLIij03vuOhQb3Gp1Vgb3Lizd/AeDdJKp4zm0b34xAA eL+tdpAZj5Zo8VtQ7lLHVQUUUjMDQfZcbb5dMod76n83za5FUeibK+ciRBjBTmSQMH/fp/R qZ56EdO63CrnstpU2LwuWKvbSPxP6cS06N0W1tXPxgUzohfcXydEWiZ/y/kvxQTMBE0mAiC LgaHBtUOr7PBL4/9KT6UQ==
X-UI-Out-Filterresults: notjunk:1;V03:K0:6CXDy+22b6E=:Ckqh+yyX/BBSenUWqztgO3 TIevXFcvi+SaOJD++GlXlsTHW1t83gLkdxzDb+qNTSeZ2Dia4NLFnWcEy4Xq/qFw1zrpC4JVj TbSzQYcK2C4/BD7JqluZ6AYsRjCOY81bHP/sfp5GUeliHQfyI1xdjmTKFMvoJ8MfEgSzgkEmE aaqqKFELdT82DD9cXANdXpuj831Pxq4IceqDVeqg68L+Umr4bhY6GR4afOj9SLM/NbI3DA0iv JwL+RW2toXKLmCwvGllxCTtUlyUVvGbBvn5HUB7Z1WUymyDRfHL/Tq+lYDSlLtxnX7PQn+O9x mrtW0hfVClc5Om2r2aIxLaF1tEJHTH/V9WFNybpedLVeVISx+ducZBk4FOBja/a+H6ARNTE61 Agn6TctK9jUhCzLpny5xV9FwFCQ5CuOMsjoM27XgVx7lEX4+t14PSVeYNUklLiOhoI5bZ+0rw CeDKWYRLEQL6h9E2YH4za0y1diNaKaYK8T1fHc73bp6U0aBf/n6wKQBIevSUBsF5dOs7irP1S OypDYS6K5/ub2YQgsyZ/UufIJG+iROBQ+yJ114ZnrKzVjWMzahKn5BswYPvFPmu+aPdX+yNg5 2blzdHNT0HeY2RlUveXH0J0jgirESXZ8sesKTBfvZbbNwa9XKA3Y9cCClvLoDB5lkg05EQMDz 58KAuS1CA2/OW9tBmOPjfQq2KrFFXIOrD7YP7Ji0NDwZeeWAIFqhqR0SwQegXnRtroX3iQaCI Us01NIA0f5WaniHUvH6aT5DA8hIQAdvyao3qRwbbGCuGPRtto4Nd//SkgNzc/CVLesFgvnKRs wbQmBpKpxoJ9NPzaX/ZSlLHBlP39hbNtZraFOUZY+fH3ePPc3bTlqUFlu0m/Ueley5nzQZLfq g6t6o+xiT3nDofh0MrNLpYCVUbZV4GYGOr3/Mu507tLuxRP00cbQhDg7Hw/WdEUjKYUqxabWY wMJJUhGRgmOywEi0ykGS/RC7a1AN0gHa3vCdQAlopqMmpt2gYWEr22P1P03cwdSX5jQD1XggZ jiCbMPcgZsiW368bVkBeG8afeaOm4wlBwYeHLeM2yJCMDc4llaABhrh/WO51kjmUNnuQw6wmS HyLnCsdbeQ7FGc=
Archived-At: <https://mailarchive.ietf.org/arch/msg/jsonpath/OHj2YmIm6eob8L36LpPtbtt7qvM>
Subject: Re: [Jsonpath] Canonical Normalized Paths
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: Tue, 01 Feb 2022 18:35:38 -0000

Am 01.02.2022 um 19:25 schrieb Glyn Normington:
> A normalized path is a JSONPath expression which identifies a specific
> node in a given JSON document. The main use case is for JSONPath
> implementations that return normalized paths instead of, or in addition
> to, the values identified by these paths.
>
> PR 152 has generated some discussion of normalized paths and whether to
> nail these down into a canonical form.
>
> The other extreme would be to allow a normalised path to be any JSONPath
> expression which identifies a specific node in a given JSON document.
 > ...

Wouldn't that mean that if a JSONPath expression identifies a single
node, a conforming implementation could just return that expression as
"normalized" path (no matter how complex it may have been)?

Best regards, Julian


From nobody Fri Feb  4 07:43:34 2022
Return-Path: <iesg-secretary@ietf.org>
X-Original-To: jsonpath@ietf.org
Delivered-To: jsonpath@ietfa.amsl.com
Received: from ietfa.amsl.com (localhost [IPv6:::1]) by ietfa.amsl.com (Postfix) with ESMTP id 426F93A195D; Fri,  4 Feb 2022 07:43:21 -0800 (PST)
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
From: IESG Secretary <iesg-secretary@ietf.org>
To: "IETF-Announce" <ietf-announce@ietf.org>
Cc: jsonpath@ietf.org
X-Test-IDTracker: no
X-IETF-IDTracker: 7.44.0
Auto-Submitted: auto-generated
Precedence: bulk
Message-ID: <164398940122.31912.772684425731061068@ietfa.amsl.com>
Date: Fri, 04 Feb 2022 07:43:21 -0800
Archived-At: <https://mailarchive.ietf.org/arch/msg/jsonpath/LGoDIzFstJkJef1MUfMAeShHUzg>
Subject: [Jsonpath] JSON Path (jsonpath) WG Virtual Meeting: 2022-03-09
X-BeenThere: jsonpath@ietf.org
X-Mailman-Version: 2.1.29
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: Fri, 04 Feb 2022 15:43:28 -0000

The JSON Path (jsonpath) WG will hold
a virtual interim meeting on 2022-03-09 from 10:00 to 12:00 UTC.

Agenda:
Agenda to follow

Information about remote participation:
https://meetings.conf.meetecho.com/interim/?short=916a396c-db97-4405-85d0-f8311802699d


From nobody Tue Feb  8 21:53:05 2022
Return-Path: <joel@brunerd.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 C45913A0D8F for <jsonpath@ietfa.amsl.com>; Tue,  8 Feb 2022 21:53:02 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.096
X-Spam-Level: 
X-Spam-Status: No, score=-2.096 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, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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 (1024-bit key) header.d=brunerd.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 g1tnhwiIr2Hy for <jsonpath@ietfa.amsl.com>; Tue,  8 Feb 2022 21:52:58 -0800 (PST)
Received: from eastern.birch.relay.mailchannels.net (eastern.birch.relay.mailchannels.net [23.83.209.55]) (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 6D6B63A0D8D for <jsonpath@ietf.org>; Tue,  8 Feb 2022 21:52:44 -0800 (PST)
X-Sender-Id: dreamhost|x-authsender|joel@brunerd.com
Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 445A020B55 for <jsonpath@ietf.org>; Wed,  9 Feb 2022 05:52:43 +0000 (UTC)
Received: from pdx1-sub0-mail-a232.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id DFC5A20B35 for <jsonpath@ietf.org>; Wed,  9 Feb 2022 05:52:42 +0000 (UTC)
X-Sender-Id: dreamhost|x-authsender|joel@brunerd.com
Received: from pdx1-sub0-mail-a232.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.112.55.234 (trex/6.4.3); Wed, 09 Feb 2022 05:52:43 +0000
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|joel@brunerd.com
X-MailChannels-Auth-Id: dreamhost
X-Zesty-Spicy: 3d241daf59a1f787_1644385963161_854073985
X-MC-Loop-Signature: 1644385963161:4149542503
X-MC-Ingress-Time: 1644385963161
Received: from smtpclient.apple (99-74-11-95.lightspeed.cicril.sbcglobal.net [99.74.11.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: joel@brunerd.com) by pdx1-sub0-mail-a232.dreamhost.com (Postfix) with ESMTPSA id 4Jtpty4VZCzZP for <jsonpath@ietf.org>; Tue,  8 Feb 2022 21:52:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=brunerd.com; s=brunerd.com; t=1644385962; bh=XkLF3lKl0oilf3sP0ld5HNle8QI=; h=From:Content-Type:Content-Transfer-Encoding:Subject:Date:To; b=c/NcbkeEJ+09BCz8FVn+gIPQB+oLH651mki4et+HC+ruSdrlk4lDCWl9E8PV06Cfn H1+7U0knw/ouetnq80ImeKpS2dqOX72j4Q8DO8N4UJ6Jdj6/auHCUI4hijTpq3LfUp WQleWc/Scx7tsHkKSgCweRL6gvzVAc5iPmH5kcxQ=
From: Joel Bruner <joel@brunerd.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\))
Message-Id: <A5E74F98-0E0D-4259-A91D-04F16B6E08A8@brunerd.com>
Date: Tue, 8 Feb 2022 23:52:41 -0600
To: jsonpath@ietf.org
X-Mailer: Apple Mail (2.3693.60.0.1.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/jsonpath/D6TD6dy9FMsfYxAnpfAoKZz76lY>
Subject: [Jsonpath] ["-"] Index Selector like JSON Pointer /-
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: Wed, 09 Feb 2022 05:53:04 -0000

Hello,
So I had a couple ideas to float in the list here. If they belong in =
GitHub let me know.

I came upon JSONPath a couple years ago when I began work on a JSON tool =
for Mac admins (https://github.com/brunerd/jpt). I really liked the =
descendant selector to find a key somewhere in a JSON document, a common =
task in admin shell scripts. The JSONPath code I used was Stefan=E2=80=99s=
 original JS code and did some additional work on it =
(https://github.com/brunerd/jsonpath)

My question: Since JSONPath is both useful for getting values and =
setting values, one should be able to specify the array element _after_  =
the last. JSONPath could specify that $["-"] symbolizes this, just as =
JSON Pointer has /- to signify this.

Section 3.5.4 "Index Selector" is where this behavior could be =
mentioned. The form ["-"] fits in the quoted member name rules and =
doesn't introduce any new syntax type. Here's how JSON Pointer RFC6901 =
describes /-
=20
	https://tools.ietf.org/pdf/rfc6901.pdf - Section 4, Evaluation
=09
	If the currently referenced value is a JSON array, the reference
	      token MUST contain either:
		=E2=80=A6

	      *  exactly the single character "-", making the new =
referenced
	         value the (nonexistent) member after the last array =
element.

=20
	Note that the use of the "-" character to index an array will =
always
	result in such an error condition because by definition it =
refers to
	a nonexistent array element.  Thus, applications of JSON Pointer =
need
	to specify how that character is to be handled, if it is to be
	useful.

As an example let=E2=80=99s add 3 to the end of the array with my jpt =
tool using both syntaxes:
% jpt -o add -v 3 -p /myArray/- <<< '{"myArray":[0,1,2]}'
{
  "myArray": [
    0,
    1,
    2,
    3
  ]
}

% jpt -o add -v 3 -p '$.myArray["-"]' <<< '{"myArray":[0,1,2]}'
{
  "myArray": [
    0,
    1,
    2,
    3
  ]
}

jpt has been a fun project to make a dependency free JSON tool for Mac =
(or any *nix with jsc installed) - thanks again Stefan G=C3=B6ssner for =
the original JS code, it was the simplest, leanest, non-sprawling, =
single file implementation I could find (sure the parser needed work but =
I made a weird regex based parser go reverse because jsc only has =
negative lookahead!). But yeah $["-"] what do folks think of that?

Thanks,
Joel


From nobody Tue Feb  8 22:04:36 2022
Return-Path: <gregsdennis@yahoo.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 9E88E3A0B0D for <jsonpath@ietfa.amsl.com>; Tue,  8 Feb 2022 22:04:32 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level: 
X-Spam-Status: No, score=-2.097 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_MSPIKE_H2=-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=yahoo.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 kYyOv2Vfm_6A for <jsonpath@ietfa.amsl.com>; Tue,  8 Feb 2022 22:04:28 -0800 (PST)
Received: from sonic312-22.consmr.mail.bf2.yahoo.com (sonic312-22.consmr.mail.bf2.yahoo.com [74.6.128.84]) (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 D8E0C3A0DDF for <jsonpath@ietf.org>; Tue,  8 Feb 2022 22:04:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1644386666; bh=63nznPf97gdX+DI6mvXykRTvS4IcHXrzwexgJwvV84I=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject:Reply-To;  b=GCVO2IUav3MFfpCDuoBbFtdYdp7/MyZoqcPiLNzKbgDn/gBXJchAuvsjE4xZ381m+FN8E/nBJJrAWxrq47UZEeb4Fr5vW093jnnAjYZ/RfIgU23fU+60qPqE/duA9BNW11CaSgiGuGVaMR/j5wjCqLcogKrgeezJsTQHnMMJG6v3iO0w8+FDe1zL7gmYOKOd92ZpqOjCNniEIdcyUf+U0DWkyoZhot1KeS1dlbkXJgWB3986+vVvQqGEkR9/uNreXg9nGXlLQNkTeY1s8xfPokuVZ7ocYmZNTE+b+rxRDF2/EnYc+u9vX1VQ2YH+/LBpCZDbQUKIml14VkTFM2I2sQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;  t=1644386666; bh=zHldZwabFCEkrtJ935HHUXDTm64m+lo8i6UEAjbqr8f=;  h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=I3NJC0mkrWpHIJbAWGcODIoFOE5C0sMqsKiYNroCmFelBjMBmdXCOG4yciTwD7Uyh1MTbhUMl6y8w3pGuqBFRzbpfb3SFoDzmUuTS2qkQPH1GQmZFr8FjpAJmW76fRhFJ+wBRK3bbK8jf2uukftBxWOa0hZ/GtTjw8DGs8xyq7FJTUnpHDJO8syPvvKqo0yCzBXGmOFWpHaI1g7pq0JBClsezpUrl1Q225IvtXP0kv9GAHKNE+Hdlxy8v1x/sJCfEl1reGlhk7KwvLXDfCqvOakvc8LoNFX+ObCsiCpQw7kYKsTZ2OP/ahq8TyNMNdR2D85RIDSjaO2Ceqd8zaGFjw==
X-YMail-OSG: l1v8LssVM1mlr3q3uHN1dkk8Sw4dg_uQo6iybfcpX.WVlR7wH5.nrPl4yEcHwvo ErS4qWjeDzoKLZhlL.AXiTqCPVI0sOCwS930tveFKJNVBjgCvMPY8m2NoqPEbI4aThty2rumkhhk xRmdXZrpl.JPOU0Wo6nr3knFhOFeEcEIZ7TIeO8zx6f0dPCkVtm2CKiQghsmWrWEup5utnvD9zZw MMIzvgLYxyGg6ILkwqVnUQk_byaQ_Wvf6YComUpEkMgRZtS0as6gO9SZ37yicpki6__ibwLL1xm_ xROFWHL6NPZ0L4HcsyS7pGpoOsWe_LogXKDafHuWcHA3mtbpG8PAIHvP7PoQC_q4KUQpVJEstScI dh_zpTcOM3a_64An5qTBNQ7haBJlFtx4aQj74aL8ur0yZJ4qzjgyMJXWxabE3I0C1_QXEvHYqIyx dxoRQlmpuVE79PW26fqR4C3eAvHCEezlId_a1TGROH2FygM2Grdl2RiANZK_SNfgZKlFV9E5orxq nIq1JtbhQehrI4dHk3qpVUCKrbdrjziST4GdGvKuXkeENbiG34KJtL9G0Vvzgp3x9YQz9y9YYF6V 8cvfDsoHs5GZRngPrFnnQryhk7UXMBjXGLxhzB1Wlis6xGh9RPM.LdEOAfUzfOXekE1UiVVmXKk5 6tbIECDMLEjDP4O.wBFuucVL_xfogxxM.FCo4Q4qSski6e9dHfS8aqq5MmTgMLvF0i1lC4SzXZII b477yxOqpVgMW_e_xPrGj1wLdamfUCN_aBX2Mfqe4i5Bcr8S3US5rSxBAMmn5PXjlojzoXzGImcq pNEFB1FitR54C3wG.bFZSjhiGAMMFclJEKgaIDUU06f_turFEpksofk3yz3kpMZxLlGh4AqWiG_L DilJT7w8GDF1n3Dnm7xu234kZuYy8T58pBRK.ZYd0Rjg3AU9VoRvEs_APcHfSBIMuZV_fydI_REa Fvix0SKm8UdhzRttMzWiGTJywPPuQIm54YOaVhac.4WgHsx5sVJfz_M14AzM12m87ula_mybkzeF E3rKEyuACRGWEvE9pEenKqWkbSKuHBXGkPvPgUNTohFwLYSiFKjDUNDOrFoMLii2D8J8gnaMgXg. r5H036.iP4Z28ndK3GBoyDstut9mIGd9cBIohBvIzDV_HmwEc7djITv.PJBldWfSxCH2CqpuZkih NJfzWZabF7X_FPRQdskGOTVpbcD9YAaglAVbEL7hO10WM5.nbGeiOKBTpE4QL1R.rKFZYZ3mm9YK LJhtyS8LxyQI1ONExqBmGRP_Z8wYYhe_zx4ZbrHRCBSGCR71FuPfhSCf_WoslMomFD3jC6MrI1df uNLyfBt1KxCqeV1fEQz_Ozwdqpplj_unScV9IwXP6UOLZTNvkp_06oUVY6sHPIZlhLiO6k47J9DP McQKmcrETk1nRjNE5WG8Gt91CgNJCBYfA9gdVTCCl87wqy1_qCFRixnmBFZUxBe6bPl.mR1HPpcQ QSbKwx4vxnSFTvw7jT0.UNQET44S3qM8iNLlxKOw8Zjcc8a4JhpSlp1Fy8Jb_A1_dUFMcqQ9EjrR ej3xaUUi.nE4y1D61Lmr6vWMiP91cKFJD2gbTj7dXVujSM1H0VYUvowE4d7VfjZFooZil8OLK6Et mX3A4h8nNk_vi.6eHH5Zb8DeJoD9OqLtjInOoEutayXToWhes4FH8J37ohN_hDRbYqdyflF5.x3Z 8R7y2CzU18BPtBJUdp6J5NRPv22ODSl.vWSmLk5bZEsLjnm9Hqccsh3yPlRUnf9ASUvdNkNJA0PM Swx8riZ2VldXGnu6._uSOapY6t48BmmXGn40NGQ0ZG1CbNOqx__IoEP85929tVUFKGkyEk7qcxcL Hblgzq28P4.in_qEviHTZNB3YrlylcLszSnwxKQzhM5BZ5JEpwb0QStLVAQccAP.B8Bc3WLIK1QG pCrPOW.kcPjAXlLDipTK_ffCsiCtrtbDN5mVHr.c1Uj67R1gfHCW6zv.GMdx8ghCIC4dmQ1qUf4e KYDwUybNU7BAU9INylR.sy4NRH0HVE1V9IeQevBP_MkahM9b0Sf_IBYyzNPL3X_Ej7ox_usNB1Lm pieVapcN2VyybGbjULaZ5aNlGIvqJmzOcnwIht17Ap_kKLLvBT7iTAiXK6zls.pdf.Iz7KVNJaLb d7psk4SUkpYjJhyWkn04C66wKmBymTCBIouu3Qt2QmZbIOwCFZWf2ZEk92FMUCMnv5QnihAlrKLi Pw5T_81i7CsYTXHsbwvNPu5KqhRBNuFDb5hBUp1saOG2oohgGC2.SC6WOHG4mrJmwgXng0a5.4yF 9rC03701p8lAymHByX.3lmRxqstQCEUU3C5Fql7_dIOSdBN_ZYA6WXv_8N042ENB00GERWVTTL41 Y0kJN5ZFLorCqBdjWtFiBdeA.BpLQ
X-Sonic-MF: <gregsdennis@yahoo.com>
Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.bf2.yahoo.com with HTTP; Wed, 9 Feb 2022 06:04:26 +0000
Date: Wed, 9 Feb 2022 06:04:18 +0000 (UTC)
From: Greg Dennis <gregsdennis@yahoo.com>
Reply-To: Greg Dennis <gregsdennis@yahoo.com>
To: joel@brunerd.com, jsonpath@ietf.org
Message-ID: <950004945.816514.1644386658138@mail.yahoo.com>
In-Reply-To: <A5E74F98-0E0D-4259-A91D-04F16B6E08A8@brunerd.com>
References: <A5E74F98-0E0D-4259-A91D-04F16B6E08A8@brunerd.com>
MIME-Version: 1.0
Content-Type: multipart/alternative;  boundary="----=_Part_816513_2128878632.1644386658135"
X-Mailer: WebService/1.1.19711 YahooMailAndroidMobile
Archived-At: <https://mailarchive.ietf.org/arch/msg/jsonpath/_fqm-EMIdoYem4T3lRSoqqWJUkM>
Subject: Re: [Jsonpath] ["-"] Index Selector like JSON Pointer /-
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: Wed, 09 Feb 2022 06:04:33 -0000

------=_Part_816513_2128878632.1644386658135
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

"Since JSONPath is both useful for getting values and setting values"
I think this is the crucial point: JSON Path is intended as only a query la=
nguage.=C2=A0 It's not intended to specify a location for days to be set/in=
serted.
That's not to say that it can't be used that way, but such usages are outsi=
de of the scope of the specification were writing.
Thanks for the idea, though. For now, I think JSON Pointer is probably a be=
tter syntax for your use case.
Greg
=20
=20
  On Wed, 9 Feb 2022 at 6:53 pm, Joel Bruner<joel@brunerd.com> wrote:   Hel=
lo,
So I had a couple ideas to float in the list here. If they belong in GitHub=
 let me know.

I came upon JSONPath a couple years ago when I began work on a JSON tool fo=
r Mac admins (https://github.com/brunerd/jpt). I really liked the descendan=
t selector to find a key somewhere in a JSON document, a common task in adm=
in shell scripts. The JSONPath code I used was Stefan=E2=80=99s original JS=
 code and did some additional work on it (https://github.com/brunerd/jsonpa=
th)

My question: Since JSONPath is both useful for getting values and setting v=
alues, one should be able to specify the array element _after_=C2=A0 the la=
st. JSONPath could specify that $["-"] symbolizes this, just as JSON Pointe=
r has /- to signify this.

Section 3.5.4 "Index Selector" is where this behavior could be mentioned. T=
he form ["-"] fits in the quoted member name rules and doesn't introduce an=
y new syntax type. Here's how JSON Pointer RFC6901 describes /-
=20
=C2=A0=C2=A0=C2=A0 https://tools.ietf.org/pdf/rfc6901.pdf - Section 4, Eval=
uation
=C2=A0=C2=A0=C2=A0=20
=C2=A0=C2=A0=C2=A0 If the currently referenced value is a JSON array, the r=
eference
=C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 token MUST contain either:
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =E2=80=A6

=C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 *=C2=A0 exactly the single characte=
r "-", making the new referenced
=C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 value the (nonexistent) memb=
er after the last array element.

=20
=C2=A0=C2=A0=C2=A0 Note that the use of the "-" character to index an array=
 will always
=C2=A0=C2=A0=C2=A0 result in such an error condition because by definition =
it refers to
=C2=A0=C2=A0=C2=A0 a nonexistent array element.=C2=A0 Thus, applications of=
 JSON Pointer need
=C2=A0=C2=A0=C2=A0 to specify how that character is to be handled, if it is=
 to be
=C2=A0=C2=A0=C2=A0 useful.

As an example let=E2=80=99s add 3 to the end of the array with my jpt tool =
using both syntaxes:
% jpt -o add -v 3 -p /myArray/- <<< '{"myArray":[0,1,2]}'
{
=C2=A0 "myArray": [
=C2=A0 =C2=A0 0,
=C2=A0 =C2=A0 1,
=C2=A0 =C2=A0 2,
=C2=A0 =C2=A0 3
=C2=A0 ]
}

% jpt -o add -v 3 -p '$.myArray["-"]' <<< '{"myArray":[0,1,2]}'
{
=C2=A0 "myArray": [
=C2=A0 =C2=A0 0,
=C2=A0 =C2=A0 1,
=C2=A0 =C2=A0 2,
=C2=A0 =C2=A0 3
=C2=A0 ]
}

jpt has been a fun project to make a dependency free JSON tool for Mac (or =
any *nix with jsc installed) - thanks again Stefan G=C3=B6ssner for the ori=
ginal JS code, it was the simplest, leanest, non-sprawling, single file imp=
lementation I could find (sure the parser needed work but I made a weird re=
gex based parser go reverse because jsc only has negative lookahead!). But =
yeah $["-"] what do folks think of that?

Thanks,
Joel

--=20
JSONpath mailing list
JSONpath@ietf.org
https://www.ietf.org/mailman/listinfo/jsonpath
 =20

------=_Part_816513_2128878632.1644386658135
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

"Since JSONPath is both useful for getting values and setting values"<div i=
d=3D"yMail_cursorElementTracker_1644386367249"><br></div><div id=3D"yMail_c=
ursorElementTracker_1644386393959">I think this is the crucial point: JSON =
Path is intended as only a query language.&nbsp; It's not intended to speci=
fy a location for days to be set/inserted.</div><div id=3D"yMail_cursorElem=
entTracker_1644386533593"><br></div><div id=3D"yMail_cursorElementTracker_1=
644386533771">That's not to say that it can't be used that way, but such us=
ages are outside of the scope of the specification were writing.</div><div =
id=3D"yMail_cursorElementTracker_1644386589044"><br></div><div id=3D"yMail_=
cursorElementTracker_1644386589206">Thanks for the idea, though. For now, I=
 think JSON Pointer is probably a better syntax for your use case.</div><di=
v id=3D"yMail_cursorElementTracker_1644386576072"><br></div><div id=3D"yMai=
l_cursorElementTracker_1644386576236">Greg</div><div id=3D"yMail_cursorElem=
entTracker_1644386367452"><br id=3D"yMail_cursorElementTracker_164438635275=
6"> <br> <blockquote style=3D"margin: 0 0 20px 0;"> <div style=3D"font-fami=
ly:Roboto, sans-serif; color:#6D00F6;"> <div>On Wed, 9 Feb 2022 at 6:53 pm,=
 Joel Bruner</div><div>&lt;joel@brunerd.com&gt; wrote:</div> </div> <div st=
yle=3D"padding: 10px 0 0 20px; margin: 10px 0 0 0; border-left: 1px solid #=
6D00F6;"> <div dir=3D"ltr">Hello,<br></div><div dir=3D"ltr">So I had a coup=
le ideas to float in the list here. If they belong in GitHub let me know.<b=
r></div><div dir=3D"ltr"><br></div><div dir=3D"ltr">I came upon JSONPath a =
couple years ago when I began work on a JSON tool for Mac admins (<a href=
=3D"https://github.com/brunerd/jpt" target=3D"_blank">https://github.com/br=
unerd/jpt</a>). I really liked the descendant selector to find a key somewh=
ere in a JSON document, a common task in admin shell scripts. The JSONPath =
code I used was Stefan=E2=80=99s original JS code and did some additional w=
ork on it (<a href=3D"https://github.com/brunerd/jsonpath" target=3D"_blank=
">https://github.com/brunerd/jsonpath</a>)<br></div><div dir=3D"ltr"><br></=
div><div dir=3D"ltr">My question: Since JSONPath is both useful for getting=
 values and setting values, one should be able to specify the array element=
 _after_&nbsp; the last. JSONPath could specify that $["-"] symbolizes this=
, just as JSON Pointer has /- to signify this.<br></div><div dir=3D"ltr"><b=
r></div><div dir=3D"ltr">Section 3.5.4 "Index Selector" is where this behav=
ior could be mentioned. The form ["-"] fits in the quoted member name rules=
 and doesn't introduce any new syntax type. Here's how JSON Pointer RFC6901=
 describes /-<br></div><div dir=3D"ltr"> <br></div><div dir=3D"ltr">&nbsp;&=
nbsp;&nbsp; <a href=3D"https://tools.ietf.org/pdf/rfc6901.pdf " target=3D"_=
blank">https://tools.ietf.org/pdf/rfc6901.pdf </a>- Section 4, Evaluation<b=
r></div><div dir=3D"ltr">&nbsp;&nbsp;&nbsp; <br></div><div dir=3D"ltr">&nbs=
p;&nbsp;&nbsp; If the currently referenced value is a JSON array, the refer=
ence<br></div><div dir=3D"ltr">&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; toke=
n MUST contain either:<br></div><div dir=3D"ltr">&nbsp;&nbsp;&nbsp; &nbsp;&=
nbsp;&nbsp; =E2=80=A6<br></div><div dir=3D"ltr"><br></div><div dir=3D"ltr">=
&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; *&nbsp; exactly the single characte=
r "-", making the new referenced<br></div><div dir=3D"ltr">&nbsp;&nbsp;&nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp;  value the (nonexistent) member after the la=
st array element.<br></div><div dir=3D"ltr"><br></div><div dir=3D"ltr"> <br=
></div><div dir=3D"ltr">&nbsp;&nbsp;&nbsp; Note that the use of the "-" cha=
racter to index an array will always<br></div><div dir=3D"ltr">&nbsp;&nbsp;=
&nbsp; result in such an error condition because by definition it refers to=
<br></div><div dir=3D"ltr">&nbsp;&nbsp;&nbsp; a nonexistent array element.&=
nbsp; Thus, applications of JSON Pointer need<br></div><div dir=3D"ltr">&nb=
sp;&nbsp;&nbsp; to specify how that character is to be handled, if it is to=
 be<br></div><div dir=3D"ltr">&nbsp;&nbsp;&nbsp; useful.<br></div><div dir=
=3D"ltr"><br></div><div dir=3D"ltr">As an example let=E2=80=99s add 3 to th=
e end of the array with my jpt tool using both syntaxes:<br></div><div dir=
=3D"ltr">% jpt -o add -v 3 -p /myArray/- &lt;&lt;&lt; '{"myArray":[0,1,2]}'=
<br></div><div dir=3D"ltr">{<br></div><div dir=3D"ltr">&nbsp; "myArray": [<=
br></div><div dir=3D"ltr">&nbsp; &nbsp; 0,<br></div><div dir=3D"ltr">&nbsp;=
 &nbsp; 1,<br></div><div dir=3D"ltr">&nbsp; &nbsp; 2,<br></div><div dir=3D"=
ltr">&nbsp; &nbsp; 3<br></div><div dir=3D"ltr">&nbsp; ]<br></div><div dir=
=3D"ltr">}<br></div><div dir=3D"ltr"><br></div><div dir=3D"ltr">% jpt -o ad=
d -v 3 -p '$.myArray["-"]' &lt;&lt;&lt; '{"myArray":[0,1,2]}'<br></div><div=
 dir=3D"ltr">{<br></div><div dir=3D"ltr">&nbsp; "myArray": [<br></div><div =
dir=3D"ltr">&nbsp; &nbsp; 0,<br></div><div dir=3D"ltr">&nbsp; &nbsp; 1,<br>=
</div><div dir=3D"ltr">&nbsp; &nbsp; 2,<br></div><div dir=3D"ltr">&nbsp; &n=
bsp; 3<br></div><div dir=3D"ltr">&nbsp; ]<br></div><div dir=3D"ltr">}<br></=
div><div dir=3D"ltr"><br></div><div dir=3D"ltr">jpt has been a fun project =
to make a dependency free JSON tool for Mac (or any *nix with jsc installed=
) - thanks again Stefan G=C3=B6ssner for the original JS code, it was the s=
implest, leanest, non-sprawling, single file implementation I could find (s=
ure the parser needed work but I made a weird regex based parser go reverse=
 because jsc only has negative lookahead!). But yeah $["-"] what do folks t=
hink of that?<br></div><div dir=3D"ltr"><br></div><div dir=3D"ltr">Thanks,<=
br></div><div dir=3D"ltr">Joel<br></div><div dir=3D"ltr"><br></div><div dir=
=3D"ltr">-- <br></div><div dir=3D"ltr">JSONpath mailing list<br></div><div =
dir=3D"ltr"><a ymailto=3D"mailto:JSONpath@ietf.org" href=3D"mailto:JSONpath=
@ietf.org">JSONpath@ietf.org</a><br></div><div dir=3D"ltr"><a href=3D"https=
://www.ietf.org/mailman/listinfo/jsonpath" target=3D"_blank">https://www.ie=
tf.org/mailman/listinfo/jsonpath</a><br></div> </div> </blockquote></div>
------=_Part_816513_2128878632.1644386658135--


From nobody Wed Feb  9 02:19:00 2022
Return-Path: <cabo@tzi.org>
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 EC46F3A1390 for <jsonpath@ietfa.amsl.com>; Wed,  9 Feb 2022 02:18:58 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level: 
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 scWP0rm7mUtS for <jsonpath@ietfa.amsl.com>; Wed,  9 Feb 2022 02:18:53 -0800 (PST)
Received: from gabriel-smtp.zfn.uni-bremen.de (gabriel-smtp.zfn.uni-bremen.de [IPv6:2001:638:708:32::15]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B28F83A138F for <jsonpath@ietf.org>; Wed,  9 Feb 2022 02:18:53 -0800 (PST)
Received: from [192.168.217.118] (p5089ad4f.dip0.t-ipconnect.de [80.137.173.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4Jtwnz4qYVzDCdS; Wed,  9 Feb 2022 11:18:47 +0100 (CET)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <A5E74F98-0E0D-4259-A91D-04F16B6E08A8@brunerd.com>
Date: Wed, 9 Feb 2022 11:18:47 +0100
Cc: jsonpath@ietf.org
X-Mao-Original-Outgoing-Id: 666094727.150614-11faa6fa990ad723f0d73b932f245409
Content-Transfer-Encoding: quoted-printable
Message-Id: <6D2F28B6-C692-43F0-9267-8FC071B16917@tzi.org>
References: <A5E74F98-0E0D-4259-A91D-04F16B6E08A8@brunerd.com>
To: Joel Bruner <joel@brunerd.com>
X-Mailer: Apple Mail (2.3608.120.23.2.7)
Archived-At: <https://mailarchive.ietf.org/arch/msg/jsonpath/K4SiXqkjbGv7eqJKuKL6xjspE9Y>
Subject: Re: [Jsonpath] ["-"] Index Selector like JSON Pointer /-
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: Wed, 09 Feb 2022 10:18:59 -0000

On 2022-02-09, at 06:52, Joel Bruner <joel@brunerd.com> wrote:
>=20
> My question: Since JSONPath is both useful for getting values and =
setting values, one should be able to specify the array element _after_  =
the last. JSONPath could specify that $["-"] symbolizes this, just as =
JSON Pointer has /- to signify this.

It is a bit nonsensical to identify something that doesn=E2=80=99t =
exist.

The JSON Pointer /foo/- (assuming that /foo is an array) is really =
useful only as an instruction to append to the array identified by /foo. =
 In JSONPath, we can identify that array as $[=E2=80=98foo=E2=80=99], =
but any append instruction needs to be out of band.

Thank you for this timely contribution:  We are in the process of adding =
text about JSON pointer in #152 [1], and we probably should say there =
what I just said (maybe in a new PR, as 152 is essentially finished).

Gr=C3=BC=C3=9Fe, Carsten

[1]: =
https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/pull/152=


From nobody Wed Feb  9 22:11:52 2022
Return-Path: <joel@brunerd.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 009B43A14AA for <jsonpath@ietfa.amsl.com>; Wed,  9 Feb 2022 22:11:50 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.096
X-Spam-Level: 
X-Spam-Status: No, score=-2.096 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, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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 (1024-bit key) header.d=brunerd.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 QFIwtRkwh11Q for <jsonpath@ietfa.amsl.com>; Wed,  9 Feb 2022 22:11:45 -0800 (PST)
Received: from cross.elm.relay.mailchannels.net (cross.elm.relay.mailchannels.net [23.83.212.46]) (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 E2A163A14AB for <jsonpath@ietf.org>; Wed,  9 Feb 2022 22:11:44 -0800 (PST)
X-Sender-Id: dreamhost|x-authsender|joel@brunerd.com
Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id ED1766C10A7 for <jsonpath@ietf.org>; Thu, 10 Feb 2022 06:11:43 +0000 (UTC)
Received: from pdx1-sub0-mail-a272.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 5F6226C0E97 for <jsonpath@ietf.org>; Thu, 10 Feb 2022 06:11:41 +0000 (UTC)
X-Sender-Id: dreamhost|x-authsender|joel@brunerd.com
Received: from pdx1-sub0-mail-a272.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.107.255.168 (trex/6.4.3); Thu, 10 Feb 2022 06:11:43 +0000
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|joel@brunerd.com
X-MailChannels-Auth-Id: dreamhost
X-Occur-Left: 594b9a5e4fa684c0_1644473503316_2151135832
X-MC-Loop-Signature: 1644473503316:4175752123
X-MC-Ingress-Time: 1644473503316
Received: from smtpclient.apple (99-74-11-95.lightspeed.cicril.sbcglobal.net [99.74.11.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: joel@brunerd.com) by pdx1-sub0-mail-a272.dreamhost.com (Postfix) with ESMTPSA id 4JvRGP0ZLfz18r for <jsonpath@ietf.org>; Wed,  9 Feb 2022 22:11:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=brunerd.com; s=brunerd.com; t=1644473501; bh=OBW4i4xK34cIB4Sl3JTA0Utcp0s=; h=From:Content-Type:Subject:Date:To; b=jRG77jHKlhjzkegg4deGnQty+toXtwxQLT3FgNdEad+VPGHFtqtlF7+/bHUQ5JYYm I6CdlPJ4/ya6bw5cChMDZkYCQrJJWRhYb+nLxafD+Ptv5C2jFoZ2dzlmNZav1wdevc V3scvJwm7FEb6SZDfWgaD9HSsz/LHlzb8y1KEgVM=
From: Joel Bruner <joel@brunerd.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_33643818-5316-4FA8-B3DC-679B35DAA328"
Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\))
Date: Thu, 10 Feb 2022 00:11:39 -0600
References: <A5E74F98-0E0D-4259-A91D-04F16B6E08A8@brunerd.com> <6D2F28B6-C692-43F0-9267-8FC071B16917@tzi.org>
To: jsonpath@ietf.org
In-Reply-To: <6D2F28B6-C692-43F0-9267-8FC071B16917@tzi.org>
Message-Id: <23400C71-9EE7-49BC-B289-5A88F0B40D4E@brunerd.com>
X-Mailer: Apple Mail (2.3693.60.0.1.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/jsonpath/VsL1OedfQGE9xe-S8E7mHSsd6hY>
Subject: Re: [Jsonpath] ["-"] Index Selector like JSON Pointer /-
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: Thu, 10 Feb 2022 06:11:51 -0000

--Apple-Mail=_33643818-5316-4FA8-B3DC-679B35DAA328
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

On Feb 9, 2022, at 4:18 AM, Carsten Bormann <cabo@tzi.org> wrote:
> It is a bit nonsensical to identify something that doesn=E2=80=99t =
exist.

You know, this is also sounds like an important life lesson :]

> Thank you for this timely contribution ...


You are welcome, I figure if you "see something, say something"
Oh and regarding intentions=E2=80=A6

> On Feb 9, 2022, at 12:04 AM, Greg Dennis <gregsdennis@yahoo.com> =
wrote:
>=20
> I think this is the crucial point: JSON Path is intended as only a =
query language.  It's not intended to specify a location for days [sic] =
to be set/inserted.
>=20
> That's not to say that it can't be used that way, but such usages are =
outside of the scope of the specification we're writing.

Like a parent may have intentions for their children, life can often =
work out much differently! David Lynch's Eraserhead surrealistically =
captures what happens when your creation mutates! (Yikes)

For example, when I started making my jpt tool in 2020 I was just =
fooling around building a function to output (what are now being called) =
"Normalized Paths" and I realized since the syntax just follows =
ECMAScript/JS rules, the normalized path could be followed by an equal =
sign and the value (JSON or single quote string). It's kinda helpful for =
visual folks [1] and it's something JSON Pointer just can't do:

jpt -L <<< '{"results":[{"result":"abc"},{"result":123}]}'=20
$=3D{}
$["results"]=3D[]
$["results"][0]=3D{}
$["results"][0]["result"]=3D"abc"
$["results"][1]=3D{}
$["results"][1]["result"]=3D123

Anyway thanks again for your responses and consideration to a comment =
from the peanut gallery :D
Joel

[1]: https://www.brunerd.com/blog/2022/02/01/jpt-see-json-differently/


--Apple-Mail=_33643818-5316-4FA8-B3DC-679B35DAA328
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D"">On =
Feb 9, 2022, at 4:18 AM, Carsten Bormann &lt;<a =
href=3D"mailto:cabo@tzi.org" class=3D"">cabo@tzi.org</a>&gt; =
wrote:<div><blockquote type=3D"cite" class=3D""><div class=3D""><div =
class=3D"">It is a bit nonsensical to identify something that doesn=E2=80=99=
t exist.<br class=3D""></div></div></blockquote><div><br =
class=3D""></div><div>You know, this is also sounds like an important =
life lesson :]</div><br class=3D""><blockquote type=3D"cite" =
class=3D""><div class=3D""><div class=3D"">Thank you for this timely =
contribution ...</div></div></blockquote></div><div><br =
class=3D""></div><div>You are welcome, I figure if you "see something, =
say something"</div><div>Oh and regarding intentions=E2=80=A6</div><div><b=
r class=3D""></div><div><blockquote type=3D"cite" class=3D""><div =
class=3D"">On Feb 9, 2022, at 12:04 AM, Greg Dennis &lt;<a =
href=3D"mailto:gregsdennis@yahoo.com" =
class=3D"">gregsdennis@yahoo.com</a>&gt; wrote:</div><div class=3D""><div =
id=3D"yMail_cursorElementTracker_1644386367249" class=3D""><br =
class=3D""></div><div id=3D"yMail_cursorElementTracker_1644386393959" =
class=3D"">I think this is the crucial point: JSON Path is intended as =
only a query language.&nbsp; It's not intended to specify a location for =
days [sic] to be set/inserted.</div><div =
id=3D"yMail_cursorElementTracker_1644386533593" class=3D""><br =
class=3D""></div><div id=3D"yMail_cursorElementTracker_1644386533771" =
class=3D"">That's not to say that it can't be used that way, but such =
usages are outside of the scope of the specification we're =
writing.</div></div></blockquote><div><br class=3D""></div>Like a parent =
may have intentions for their children, life can often work out much =
differently! David Lynch's Eraserhead surrealistically captures what =
happens when your creation mutates! (Yikes)</div><div><br =
class=3D""></div><div>For example, when I started making my jpt tool in =
2020 I was just fooling around building a function to output (what are =
now being called) "Normalized Paths" and I realized since the syntax =
just follows ECMAScript/JS rules, the normalized path could be followed =
by an equal sign and the value (JSON or single quote string). It's kinda =
helpful for visual folks [1] and it's something JSON Pointer just can't =
do:</div><div><br class=3D""></div><blockquote style=3D"margin: 0 0 0 =
40px; border: none; padding: 0px;" class=3D""><div>jpt -L &lt;&lt;&lt; =
'{"results":[{"result":"abc"},{"result":123}]}'&nbsp;</div><div>$=3D{}</di=
v><div>$["results"]=3D[]</div><div>$["results"][0]=3D{}</div><div>$["resul=
ts"][0]["result"]=3D"abc"</div><div>$["results"][1]=3D{}</div><div>$["resu=
lts"][1]["result"]=3D123</div></blockquote><div><br =
class=3D""></div><div>Anyway thanks again for your responses and =
consideration to a comment from the peanut gallery =
:D</div><div>Joel</div><div><br class=3D""></div><div>[1]: <a =
href=3D"https://www.brunerd.com/blog/2022/02/01/jpt-see-json-differently/"=
 =
class=3D"">https://www.brunerd.com/blog/2022/02/01/jpt-see-json-differentl=
y/</a><br class=3D""><div class=3D""><div class=3D""><div class=3D""><br =
class=3D""></div></div></div></div></body></html>=

--Apple-Mail=_33643818-5316-4FA8-B3DC-679B35DAA328--


From nobody Thu Feb 10 09:17:39 2022
Return-Path: <glyn.normington.work@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 CA1D53A0659 for <jsonpath@ietfa.amsl.com>; Thu, 10 Feb 2022 09:17:36 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level: 
X-Spam-Status: No, score=-2.097 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, 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=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 M8ZrNdkIy1RX for <jsonpath@ietfa.amsl.com>; Thu, 10 Feb 2022 09:17:31 -0800 (PST)
Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) (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 7C53C3A0736 for <jsonpath@ietf.org>; Thu, 10 Feb 2022 09:17:31 -0800 (PST)
Received: by mail-lj1-x22c.google.com with SMTP id o9so4147836ljq.4 for <jsonpath@ietf.org>; Thu, 10 Feb 2022 09:17:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;  h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iS8LzvKwEmuMx/GUI8TlF0b/h+6Q+sb98NLTpbDTEhI=; b=ItHOWDJZyPtiS28eGFjJHNxW/cQkSkstsA69tAQx6qweN7AI6HSp0GICAIiOW1XM2F xHxLN7sErLAh8auSpv2TQBuTMP51cT4xMmOgEgnUgtBWVsfPfuJgxc6Zb7nD8W5pTMiv OKm4JmFlhS3PlfqbGMp9PElm3mKd5cQICNWLn3gTYQ20k6HSXxhDvYxupob1gT2SBagR /XNchMrVetLSiCGUjLiQwQSRBpcEQXajvjyEcl5XoQvqzxX1yevJfWI2ryrUksaSKiFK UeYHS6Ko3uOwBSN0VFtCvhOYecrhcyoKiUtp+uzkmi/D6zLK2sUXp4ekL10eTOUtdguK jOaw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iS8LzvKwEmuMx/GUI8TlF0b/h+6Q+sb98NLTpbDTEhI=; b=KmQ6o7LKVY5VIa14PXCSXi+xQcdy9s9qv2TJWlMbRXWrFEoHXaw/qse6nIzilzLX11 f1ywwLcAcAmxgofhLdpEThYgXTMs9F5DbdU/3VvGq2dx39SByf9MSG7UrbSMgXf9G3kH 9vfpuOhTYQHX/FROUq2aip1o2Ycqph9I8UNWUm5KgxYi1UkRJU/mcpZUoUfwjZ3PdEnH kMiYbjRCtffeQ7jZugnPL9QswfIPqKZCSUhNspka5gZT2kEJmwvX2G7l+vzEQdQ0gS48 H9MDoC6TnANl4bYeim1cG1LSbB8YEwutd+Dc38XEzY9Qw4cz3fazFWy6cn7OIHIIwjG+ CCQQ==
X-Gm-Message-State: AOAM5328OHT8dfLBKQUhMXcKTJCaFH7/wdHK1YMMyrkhgyoRxXudsrnz Jr72A5I3dlLQS4iWyB/Lxt04+uVW/n84bTbQy+nHVWEQUQQ=
X-Google-Smtp-Source: ABdhPJxa0AluKHlWj9A/vd/V+tqrouGMoGTUDAVvZ9j1GX0qa0JGGDXUH57aW32CtRm7FsufKYrEMD7sby7N1tkTyLk=
X-Received: by 2002:a2e:908f:: with SMTP id l15mr4446564ljg.346.1644513448520;  Thu, 10 Feb 2022 09:17:28 -0800 (PST)
MIME-Version: 1.0
References: <A5E74F98-0E0D-4259-A91D-04F16B6E08A8@brunerd.com> <6D2F28B6-C692-43F0-9267-8FC071B16917@tzi.org> <23400C71-9EE7-49BC-B289-5A88F0B40D4E@brunerd.com>
In-Reply-To: <23400C71-9EE7-49BC-B289-5A88F0B40D4E@brunerd.com>
From: Glyn Normington <glyn.normington.work@gmail.com>
Date: Thu, 10 Feb 2022 17:17:17 +0000
Message-ID: <CANH0Gb+BDH7_0LWVW8yhyPqjRLJm9Hq_c2U_FV_MbDHUq3iNWw@mail.gmail.com>
To: Joel Bruner <joel@brunerd.com>
Cc: jsonpath@ietf.org
Content-Type: multipart/alternative; boundary="000000000000ed70c905d7ad1fea"
Archived-At: <https://mailarchive.ietf.org/arch/msg/jsonpath/yKmk-pSGK3iH9QwCu7h5dTq2FCA>
Subject: Re: [Jsonpath] ["-"] Index Selector like JSON Pointer /-
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: Thu, 10 Feb 2022 17:17:37 -0000

--000000000000ed70c905d7ad1fea
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thanks for taking this philosophically, Joel.

FYI my implementation ([2]) of JSONPath also accommodates updating the
nodes of a document selected by a JSONPath, but it does so by returning
pointers to nodes, so is somewhat lower-level than your approach.

[2] https://github.com/vmware-labs/yaml-jsonpath/

On Thu, 10 Feb 2022 at 06:11, Joel Bruner <joel@brunerd.com> wrote:

> On Feb 9, 2022, at 4:18 AM, Carsten Bormann <cabo@tzi.org> wrote:
>
> It is a bit nonsensical to identify something that doesn=E2=80=99t exist.
>
>
> You know, this is also sounds like an important life lesson :]
>
> Thank you for this timely contribution ...
>
>
> You are welcome, I figure if you "see something, say something"
> Oh and regarding intentions=E2=80=A6
>
> On Feb 9, 2022, at 12:04 AM, Greg Dennis <gregsdennis@yahoo.com> wrote:
>
> I think this is the crucial point: JSON Path is intended as only a query
> language.  It's not intended to specify a location for days [sic] to be
> set/inserted.
>
> That's not to say that it can't be used that way, but such usages are
> outside of the scope of the specification we're writing.
>
>
> Like a parent may have intentions for their children, life can often work
> out much differently! David Lynch's Eraserhead surrealistically captures
> what happens when your creation mutates! (Yikes)
>
> For example, when I started making my jpt tool in 2020 I was just fooling
> around building a function to output (what are now being called)
> "Normalized Paths" and I realized since the syntax just follows
> ECMAScript/JS rules, the normalized path could be followed by an equal si=
gn
> and the value (JSON or single quote string). It's kinda helpful for visua=
l
> folks [1] and it's something JSON Pointer just can't do:
>
> jpt -L <<< '{"results":[{"result":"abc"},{"result":123}]}'
> $=3D{}
> $["results"]=3D[]
> $["results"][0]=3D{}
> $["results"][0]["result"]=3D"abc"
> $["results"][1]=3D{}
> $["results"][1]["result"]=3D123
>
>
> Anyway thanks again for your responses and consideration to a comment fro=
m
> the peanut gallery :D
> Joel
>
> [1]: https://www.brunerd.com/blog/2022/02/01/jpt-see-json-differently/
>
> --
> JSONpath mailing list
> JSONpath@ietf.org
> https://www.ietf.org/mailman/listinfo/jsonpath
>

--000000000000ed70c905d7ad1fea
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Thanks for taking this philosophically, Joel.</div><d=
iv><br></div><div>FYI my implementation ([2]) of JSONPath also accommodates=
 updating the nodes of a document selected by a JSONPath, but it does so by=
 returning pointers to nodes, so is somewhat lower-level than your approach=
.<br></div><div><br></div><div>[2] <a href=3D"https://github.com/vmware-lab=
s/yaml-jsonpath/">https://github.com/vmware-labs/yaml-jsonpath/</a></div></=
div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On=
 Thu, 10 Feb 2022 at 06:11, Joel Bruner &lt;<a href=3D"mailto:joel@brunerd.=
com">joel@brunerd.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex"><div style=3D"overflow-wrap: break-word;">On Feb 9, 20=
22, at 4:18 AM, Carsten Bormann &lt;<a href=3D"mailto:cabo@tzi.org" target=
=3D"_blank">cabo@tzi.org</a>&gt; wrote:<div><blockquote type=3D"cite"><div>=
<div>It is a bit nonsensical to identify something that doesn=E2=80=99t exi=
st.<br></div></div></blockquote><div><br></div><div>You know, this is also =
sounds like an important life lesson :]</div><br><blockquote type=3D"cite">=
<div><div>Thank you for this timely contribution ...</div></div></blockquot=
e></div><div><br></div><div>You are welcome, I figure if you &quot;see some=
thing, say something&quot;</div><div>Oh and regarding intentions=E2=80=A6</=
div><div><br></div><div><blockquote type=3D"cite"><div>On Feb 9, 2022, at 1=
2:04 AM, Greg Dennis &lt;<a href=3D"mailto:gregsdennis@yahoo.com" target=3D=
"_blank">gregsdennis@yahoo.com</a>&gt; wrote:</div><div><div id=3D"gmail-m_=
5709901773920749621yMail_cursorElementTracker_1644386367249"><br></div><div=
 id=3D"gmail-m_5709901773920749621yMail_cursorElementTracker_1644386393959"=
>I think this is the crucial point: JSON Path is intended as only a query l=
anguage.=C2=A0 It&#39;s not intended to specify a location for days [sic] t=
o be set/inserted.</div><div id=3D"gmail-m_5709901773920749621yMail_cursorE=
lementTracker_1644386533593"><br></div><div id=3D"gmail-m_57099017739207496=
21yMail_cursorElementTracker_1644386533771">That&#39;s not to say that it c=
an&#39;t be used that way, but such usages are outside of the scope of the =
specification we&#39;re writing.</div></div></blockquote><div><br></div>Lik=
e a parent may have intentions for their children, life can often work out =
much differently! David Lynch&#39;s Eraserhead surrealistically captures wh=
at happens when your creation mutates! (Yikes)</div><div><br></div><div>For=
 example, when I started making my jpt tool in 2020 I was just fooling arou=
nd building a function to output (what are now being called) &quot;Normaliz=
ed Paths&quot; and I realized since the syntax just follows ECMAScript/JS r=
ules, the normalized path could be followed by an equal sign and the value =
(JSON or single quote string). It&#39;s kinda helpful for visual folks [1] =
and it&#39;s something JSON Pointer just can&#39;t do:</div><div><br></div>=
<blockquote style=3D"margin:0px 0px 0px 40px;border:medium none;padding:0px=
"><div>jpt -L &lt;&lt;&lt; &#39;{&quot;results&quot;:[{&quot;result&quot;:&=
quot;abc&quot;},{&quot;result&quot;:123}]}&#39;=C2=A0</div><div>$=3D{}</div=
><div>$[&quot;results&quot;]=3D[]</div><div>$[&quot;results&quot;][0]=3D{}<=
/div><div>$[&quot;results&quot;][0][&quot;result&quot;]=3D&quot;abc&quot;</=
div><div>$[&quot;results&quot;][1]=3D{}</div><div>$[&quot;results&quot;][1]=
[&quot;result&quot;]=3D123</div></blockquote><div><br></div><div>Anyway tha=
nks again for your responses and consideration to a comment from the peanut=
 gallery :D</div><div>Joel</div><div><br></div><div>[1]: <a href=3D"https:/=
/www.brunerd.com/blog/2022/02/01/jpt-see-json-differently/" target=3D"_blan=
k">https://www.brunerd.com/blog/2022/02/01/jpt-see-json-differently/</a><br=
><div><div><div><br></div></div></div></div></div>-- <br>
JSONpath mailing list<br>
<a href=3D"mailto:JSONpath@ietf.org" target=3D"_blank">JSONpath@ietf.org</a=
><br>
<a href=3D"https://www.ietf.org/mailman/listinfo/jsonpath" rel=3D"noreferre=
r" target=3D"_blank">https://www.ietf.org/mailman/listinfo/jsonpath</a><br>
</blockquote></div>

--000000000000ed70c905d7ad1fea--


From nobody Sat Feb 12 16:54:49 2022
Return-Path: <joel@brunerd.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 2AF6C3A0ADC for <jsonpath@ietfa.amsl.com>; Sat, 12 Feb 2022 16:54:46 -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, RCVD_IN_DNSWL_BLOCKED=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 (1024-bit key) header.d=brunerd.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 UfyJaNnd-Ell for <jsonpath@ietfa.amsl.com>; Sat, 12 Feb 2022 16:54:41 -0800 (PST)
Received: from cow.ash.relay.mailchannels.net (cow.ash.relay.mailchannels.net [23.83.222.41]) (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 15F2B3A0ABA for <jsonpath@ietf.org>; Sat, 12 Feb 2022 16:54:39 -0800 (PST)
X-Sender-Id: dreamhost|x-authsender|joel@brunerd.com
Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id ADFA0462098 for <jsonpath@ietf.org>; Sun, 13 Feb 2022 00:54:35 +0000 (UTC)
Received: from pdx1-sub0-mail-a224.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 3DA4D46203A for <jsonpath@ietf.org>; Sun, 13 Feb 2022 00:54:35 +0000 (UTC)
X-Sender-Id: dreamhost|x-authsender|joel@brunerd.com
Received: from pdx1-sub0-mail-a224.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.126.0.9 (trex/6.5.3); Sun, 13 Feb 2022 00:54:35 +0000
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|joel@brunerd.com
X-MailChannels-Auth-Id: dreamhost
X-Snatch-Daffy: 6726be8a54c94faa_1644713675474_3273232361
X-MC-Loop-Signature: 1644713675474:3426664641
X-MC-Ingress-Time: 1644713675473
Received: from smtpclient.apple (99-74-11-95.lightspeed.cicril.sbcglobal.net [99.74.11.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: joel@brunerd.com) by pdx1-sub0-mail-a224.dreamhost.com (Postfix) with ESMTPSA id 4Jx8566ttcz1R8 for <jsonpath@ietf.org>; Sat, 12 Feb 2022 16:54:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=brunerd.com; s=brunerd.com; t=1644713675; bh=PFTSZewdTqMY5bKlMX0un0qZWPI=; h=From:Content-Type:Content-Transfer-Encoding:Subject:Date:To; b=AcMNIyDDqg282Ijzh807yAevQtCpQQC1/oucz1nUhQpTQ6VhHL8SZDGrtFrsPqpcp 6TO2By5X85HECCbZaLkykzeZE9nGplWnIUObc5HBTRuiHft4dObWiyz6pr3jpQeVt5 1pATQIm7YizTIsYP65jskpydoSHQXeeI96hdF9mA=
From: Joel Bruner <joel@brunerd.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\))
Message-Id: <EEF0E920-C760-4C63-A06F-4A439FDD4066@brunerd.com>
Date: Sat, 12 Feb 2022 18:54:34 -0600
To: jsonpath@ietf.org
X-Mailer: Apple Mail (2.3693.60.0.1.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/jsonpath/MT_WROl1XpUWYOGy69HMAR2DVVI>
Subject: [Jsonpath] Filter Selector: index() the evolution of @name?
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: Sun, 13 Feb 2022 00:54:46 -0000

I wanted to ask about the Filter Selector 3.5.9 and the new index() =
"function" (ne=C3=A9 @name?)

In the original Goessner code is a bit of an easter egg by the name of =
@name [1] (hidden as _vname before substitution) This allows for the =
property name of an object or an array index to figure into the the =
filter. The syntax was admittedly weird but useful for cases where an =
exact key name is either unknown or where multiple keys can be matched =
with regex. [2]

In Table 6 of 3.5.9 there's a new function-like thing called index() =
which seems to be the successor to @name? This is good news that this =
functionality is stepping out of the shadows and getting better syntax =
but there doesn't seem there's any more info in the draft on index()? =
I'm very curious and encouraged that @name lives on in a new form.

Somewhat related, since the .length syntax "needs to be addressed" [3] =
will it go the way of the index() style? (I suppose the new style has =
yet to be accepted?) And will length() work on objects by counting =
members? If I missed this in a GH issue convo pardon :]

Thanks,
Joel

[1]: jsonpath-0.8.0.js.txt, line 76 - "eval: function(x, _v, _vname)"... =
https://storage.googleapis.com/google-code-archive-downloads/v2/code.googl=
e.com/jsonpath/jsonpath-0.8.0.js.txt

[2] jpt (https://github.com/brunerd/jpt) example of @name usage:
	% jpt -i0 '$[?(@name =3D=3D=3D 0 || @name > 3)]' <<< =
'[0,1,2,3,4,5,6,7]'
	[0,4,5,6,7]

	% jpt -i0 '$[?(@name =3D~ /key.*/)]' <<< =
{"key_a":1,"key_b":2,"keep":3} =20
	[1,2]

[3] ".length needs to be addressed" -=20
https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/issues/154


From nobody Wed Feb 16 07:55:27 2022
Return-Path: <stefan@goessner.net>
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 4E59F3A0D43 for <jsonpath@ietfa.amsl.com>; Wed, 16 Feb 2022 07:55:24 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.727
X-Spam-Level: 
X-Spam-Status: No, score=0.727 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.714, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=no autolearn_force=no
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 76q_65qWW__f for <jsonpath@ietfa.amsl.com>; Wed, 16 Feb 2022 07:55:22 -0800 (PST)
Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) (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 C013D3A0D48 for <jsonpath@ietf.org>; Wed, 16 Feb 2022 07:55:21 -0800 (PST)
Received: from [192.168.178.38] ([88.130.50.160]) by mrelayeu.kundenserver.de (mreue010 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MsZBb-1o9Qtw1xn9-00txSF for <jsonpath@ietf.org>; Wed, 16 Feb 2022 16:55:19 +0100
Content-Type: multipart/alternative; boundary="------------V53oapAH0glSM0LC8cOn7dwd"
Message-ID: <77314186-e732-dd10-336f-751b0fb8757e@goessner.net>
Date: Wed, 16 Feb 2022 16:55:19 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0
To: jsonpath@ietf.org
References: <EEF0E920-C760-4C63-A06F-4A439FDD4066@brunerd.com>
From: =?UTF-8?Q?Stefan_G=c3=b6ssner?= <stefan@goessner.net>
In-Reply-To: <EEF0E920-C760-4C63-A06F-4A439FDD4066@brunerd.com>
X-Provags-ID: V03:K1:KHYXp8SBBMtRmxDPu8jQQU4F/LKvg93M5D2XKMLcqEx2j37Xy7c IrNbUlUM8TjHjcjb9Ya3Yt2SaSahhUBRpvJrqRScnu7QD+mAXIINmwE0aZL+IdguJ3kHPdg ughCKnXFyTBi7WY53iSciI/8VrnLJ3RBCYliLpvLxE/aE/FoQ3hB6wXhKbleXGJ+G+eYR8K b7wmFSdR6iZh9Xwfjpdew==
X-UI-Out-Filterresults: notjunk:1;V03:K0:GOXwzD5a9XE=:fodlnArauEXI4vrurgyjhl Mwa3Xu1tlbSW0NvvcUtzXgQobbTmgtxC+4p+KFvGCc3wt6iby579SSevXrMifMnGnrmzNe5Ho 8krQefuQ6pE6zmtyvb9NxBE2x7pHnQl6x4RN9eRXz56r1ZeYih6Qy24T3cRSVwpCXCt8IiIpA LVcYD8sKINQP5RMCDG514cRBW36XUKVb1SLhVTJxcdE+u7u5UQMbTlUD/ZMmW+glJ4Gwrnm5h MRWfOKJKEo6CcEGXcETApoLOABjsBZjyyQC2mbVRpy3dVQWAt9dK1D2sLvCoV1H9JubQEh7FZ o4aJTX3AyEvLH03vMsU1FmpWjQMqAe0osb/uFsKq+cGNugEpkH7dXIazyt7ogtQuW8ME49Cys wIPRzH9kjOz/irKbO0T1BuGlkAcaUa9W9tEqFdNu/KmyzWbHyZOm5GzKXW8d/9YtzamWSO75C tdHbgNHy3vohSQlCh5TxCIWtBE+3KwLwXu16XtZxTc5G9JzjV5mxxHohLKu+WA0tmbMJib6h8 DtmLzx48GuEetz0mMyD/lol5ohScXAjOfAEkoexrJDJl4h+t05jYspek6Bf3EUJ2YlJ6upSWM 7jlgYk3K5ezu3EzV3dFpLjifxk4ksHwKBerYohoq35iPYUhNyuMuB7eljN43QSmvF1tF2Lq6C lSMcbT+IxAeMLZ1s//2LXIigjSNrah0lL7Qlm4T7/qCPXB9NDcoz2Ns84BJwZE6v8sWCOYy4n NWeZ/KkbUh45pGb+RZNzHY28x8gwj1uhu2TBFA==
Archived-At: <https://mailarchive.ietf.org/arch/msg/jsonpath/zeIu-Hx_ZzhZMbSUnFFRUPa8Ymo>
Subject: Re: [Jsonpath] Filter Selector: index() the evolution of @name?
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: Wed, 16 Feb 2022 15:55:24 -0000

This is a multi-part message in MIME format.
--------------V53oapAH0glSM0LC8cOn7dwd
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

I didn't implement any easter eggs in my initial implementation ... at 
least not consciously :)
You finally managed, that I inspected my former code in more detail 
again after that time.

IIRC, I implemented that feature just for testing and obviously finally 
failed to document it. It was discussed here recently in depth.

https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/issues/109

In short ... for

{ "a":1, "b":2, "c":3 }

the query '$[?@]' will return values only, but if we want to have access 
to the corresponding names (name/value pairs) for some reason, we are lost.

This is, what '@name' ($[?@name != 'c']) in my original implementation 
and recently 'index' (index/value pairs) was meant for.

Two proposals were discussed in issue 109:

1) 'index(@)'  functional approach
2) '@index'    accessor approach

Shortcomings of 1) are ...

* what kind of arguments were accepted here apart from '@' ?
* how correlates 'index' to current member/element '@' then ?
* why not allow 'my_favourite_function_name(@,x,y,z)' then ?

Proposal 2) seems to be superior here, as it rigidly connects 'index' to 
current member/element '@'.

btw: 'length' could be resolved the same way.
--
sg


Am 13.02.2022 um 01:54 schrieb Joel Bruner:
> I wanted to ask about the Filter Selector 3.5.9 and the new index() "function" (neé @name?)
>
> In the original Goessner code is a bit of an easter egg by the name of @name [1] (hidden as _vname before substitution) This allows for the property name of an object or an array index to figure into the the filter. The syntax was admittedly weird but useful for cases where an exact key name is either unknown or where multiple keys can be matched with regex. [2]
>
> In Table 6 of 3.5.9 there's a new function-like thing called index() which seems to be the successor to @name? This is good news that this functionality is stepping out of the shadows and getting better syntax but there doesn't seem there's any more info in the draft on index()? I'm very curious and encouraged that @name lives on in a new form.
>
> Somewhat related, since the .length syntax "needs to be addressed" [3] will it go the way of the index() style? (I suppose the new style has yet to be accepted?) And will length() work on objects by counting members? If I missed this in a GH issue convo pardon :]
>
> Thanks,
> Joel
>
> [1]: jsonpath-0.8.0.js.txt, line 76 - "eval: function(x, _v, _vname)"...https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/jsonpath/jsonpath-0.8.0.js.txt
>
> [2] jpt (https://github.com/brunerd/jpt) example of @name usage:
> 	% jpt -i0 '$[?(@name === 0 || @name > 3)]' <<< '[0,1,2,3,4,5,6,7]'
> 	[0,4,5,6,7]
>
> 	% jpt -i0 '$[?(@name =~ /key.*/)]' <<< {"key_a":1,"key_b":2,"keep":3}
> 	[1,2]
>
> [3] ".length needs to be addressed" -
> https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/issues/154
>

--------------V53oapAH0glSM0LC8cOn7dwd
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <font size="2"><font face="Courier New, Courier, monospace">I didn't
        implement any easter eggs in my initial implementation ... at
        least not consciously :)<br>
        You finally managed, that I inspected my former code in more
        detail again after that time.<br>
        <br>
        IIRC, I implemented that feature just for testing and obviously
        finally failed to document it. It was discussed here recently in
        depth.<br>
        <br>
<a class="moz-txt-link-freetext" href="https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/issues/109">https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/issues/109</a><br>
        <br>
        In short ... for <br>
        <br>
        { "a":1, "b":2, "c":3 }<br>
        <br>
        the query '$[?@]' will return values only, but if we want to
        have access to the corresponding names (name/value pairs) for
        some reason, we are lost.<br>
        <br>
        This is, what '@name' ($[?@name != 'c']) in my original
        implementation and recently 'index' (index/value pairs) was
        meant for.<br>
        <br>
        Two proposals were discussed in issue 109:<br>
        <br>
        1) 'index(@)'  functional approach<br>
        2) '@index'    accessor approach<br>
        <br>
        Shortcomings of 1) are ...<br>
        <br>
        * what kind of arguments were accepted here apart from '@' ?<br>
        * how correlates 'index' to current member/element '@' then ?<br>
        * why not allow 'my_favourite_function_name(@,x,y,z)' then ?<br>
        <br>
        Proposal 2) seems to be superior here, as it </font></font><font
      size="2"><font face="Courier New, Courier, monospace"><font
          size="2"><font face="Courier New, Courier, monospace">rigidly
            connects 'index' to current member/element '@'.<br>
            <br>
            btw: 'length' could be resolved the same way.<br>
          </font></font>--<br>
        sg<br>
        <br>
      </font></font><br>
    <div class="moz-cite-prefix">Am 13.02.2022 um 01:54 schrieb Joel
      Bruner:<br>
    </div>
    <blockquote type="cite"
      cite="mid:EEF0E920-C760-4C63-A06F-4A439FDD4066@brunerd.com">
      <pre class="moz-quote-pre" wrap="">I wanted to ask about the Filter Selector 3.5.9 and the new index() "function" (neé @name?)

In the original Goessner code is a bit of an easter egg by the name of @name [1] (hidden as _vname before substitution) This allows for the property name of an object or an array index to figure into the the filter. The syntax was admittedly weird but useful for cases where an exact key name is either unknown or where multiple keys can be matched with regex. [2]

In Table 6 of 3.5.9 there's a new function-like thing called index() which seems to be the successor to @name? This is good news that this functionality is stepping out of the shadows and getting better syntax but there doesn't seem there's any more info in the draft on index()? I'm very curious and encouraged that @name lives on in a new form.

Somewhat related, since the .length syntax "needs to be addressed" [3] will it go the way of the index() style? (I suppose the new style has yet to be accepted?) And will length() work on objects by counting members? If I missed this in a GH issue convo pardon :]

Thanks,
Joel

[1]: jsonpath-0.8.0.js.txt, line 76 - "eval: function(x, _v, _vname)"... <a class="moz-txt-link-freetext" href="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/jsonpath/jsonpath-0.8.0.js.txt">https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/jsonpath/jsonpath-0.8.0.js.txt</a>

[2] jpt (<a class="moz-txt-link-freetext" href="https://github.com/brunerd/jpt">https://github.com/brunerd/jpt</a>) example of @name usage:
	% jpt -i0 '$[?(@name === 0 || @name &gt; 3)]' &lt;&lt;&lt; '[0,1,2,3,4,5,6,7]'
	[0,4,5,6,7]

	% jpt -i0 '$[?(@name =~ /key.*/)]' &lt;&lt;&lt; {"key_a":1,"key_b":2,"keep":3}  
	[1,2]

[3] ".length needs to be addressed" - 
<a class="moz-txt-link-freetext" href="https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/issues/154">https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/issues/154</a>

</pre>
    </blockquote>
    <br>
  </body>
</html>

--------------V53oapAH0glSM0LC8cOn7dwd--

