Re: [Jsonpath] Remarks on the array slice operator described in https://jsonpath-standard.github.io/internet-draft/#name-array-selector-2

Carsten Bormann <cabo@tzi.org> Tue, 08 December 2020 11:56 UTC

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 67DF43A0603 for <jsonpath@ietfa.amsl.com>; Tue, 8 Dec 2020 03:56:26 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.919
X-Spam-Level:
X-Spam-Status: No, score=-1.919 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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 fp44uFptN4eL for <jsonpath@ietfa.amsl.com>; Tue, 8 Dec 2020 03:56:24 -0800 (PST)
Received: from gabriel-vm-2.zfn.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D8E6E3A0C57 for <jsonpath@ietf.org>; Tue, 8 Dec 2020 03:56:11 -0800 (PST)
Received: from [192.168.217.120] (p548dca87.dip0.t-ipconnect.de [84.141.202.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-vm-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4CqzCs6tL5zybr; Tue, 8 Dec 2020 12:56:09 +0100 (CET)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <FAB83C6B-C878-4ECC-B392-2261A2B70477@saxonica.com>
Date: Tue, 08 Dec 2020 12:56:09 +0100
Cc: Glyn Normington <glyn.normington.work@gmail.com>, jsonpath@ietf.org, Daniel P <danielaparker@gmail.com>
X-Mao-Original-Outgoing-Id: 629121369.424232-d41786b4d009a1a801f696b97e65f295
Content-Transfer-Encoding: quoted-printable
Message-Id: <8EAFD2CD-E980-49FB-A6F3-218E83ECABC6@tzi.org>
References: <CA+mwktL4Lio1FKD+20K0rvqb8De9GQomaJy1F+cct=pj_Ft4VQ@mail.gmail.com> <89140FFF-6B25-4ABC-8A25-92327B1313F3@gmail.com> <E59DC723-B9A9-4A03-A3A9-0036DE6F7940@gmail.com> <CANH0GbJEk-RS_QNM_ZM78KCRv+QRUcFK8=oBxQgNtbW1zLLAvA@mail.gmail.com> <FAB83C6B-C878-4ECC-B392-2261A2B70477@saxonica.com>
To: Michael Kay <mike@saxonica.com>
X-Mailer: Apple Mail (2.3608.120.23.2.4)
Archived-At: <https://mailarchive.ietf.org/arch/msg/jsonpath/daJex3fhBe3jeElt2KME-44GRBQ>
Subject: Re: [Jsonpath] Remarks on the array slice operator described in https://jsonpath-standard.github.io/internet-draft/#name-array-selector-2
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, 08 Dec 2020 11:56:26 -0000

On 2020-12-08, at 11:29, Michael Kay <mike@saxonica.com> wrote:
> 
> decide your policy on errors and then apply it consistently.

Good advice.

I would expect one component of this policy to be:

Whether a JSONPath query is valid or not does not depend on the arguments it is applied to.

I.e., you can look at the query and find out independently, without knowing any data, whether it is valid or not.

(Clearly, a query language could have an “assertion” system where it returns a special kind of failure for certain input data.  I don’t think that is anticipated in JSONPath.  Also, a query might “fail” in the sense of returning no output; that query is still a valid query.)

Grüße, Carsten