Re: [dispatch] JSONPath or JMESPath?

Mark Nottingham <mnot@mnot.net> Tue, 04 August 2020 23:16 UTC

Return-Path: <mnot@mnot.net>
X-Original-To: dispatch@ietfa.amsl.com
Delivered-To: dispatch@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id CA2E73A1229 for <dispatch@ietfa.amsl.com>; Tue, 4 Aug 2020 16:16:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 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_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=mnot.net header.b=ZCbLcOTu; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=TfEIvAgV
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 30753cVLu5G2 for <dispatch@ietfa.amsl.com>; Tue, 4 Aug 2020 16:16:43 -0700 (PDT)
Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D51783A1228 for <dispatch@ietf.org>; Tue, 4 Aug 2020 16:16:42 -0700 (PDT)
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id E0E45BA1; Tue, 4 Aug 2020 19:16:41 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 04 Aug 2020 19:16:42 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mnot.net; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm3; bh=Y /OnNYqkFUaw8pUlKZrTLFo1myCA6ZJTJ2oilwWuQsA=; b=ZCbLcOTu4rYmraR2w TJixCRj+k1mr87bYdp8bOjBD28da8xabUUvQ0S59z52FwpNjeOb/s7WYWmEMDu6Y Vb/R1Vy7sq7qgic58/5Z+nOekfWNft6fqu/mMsCRPsPPsfYgISlue9+dAcNun9GV RxCyhYfldWaKIRz7H+E4lQRjcdftvA7eMqsIIkBm7GmINfwyEMvNGC8JZuidk6bU PTMn9R6uRKNiVrUBJimAozz2aE93uApZXyqsaCtmsbKmQe8LiGl+oW2PjTlMMcoB WZgoXBLOwtCYw19IOAm+Xjrglpme5nItrXaFiYupei0Faurv6G5ji+AWeIw/d261 UFhkQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=Y/OnNYqkFUaw8pUlKZrTLFo1myCA6ZJTJ2oilwWuQ sA=; b=TfEIvAgV6hFe/svLMJtEE2kIZpOKNR5SseV0OlLbm6kLawOxJDCSMIfj/ d6pbO7iaw3VsdQuBYTmvN11N+NwIGfFmsQVyaP2Ha/5UC0kF083RaafUFWDtUFYE CbqnWpH9aKESjvUwU2Y1NjOti6jyU1jDhDzuT/OB6VAtNi03/8yD5nA512a4sOgd f8ANJfUA+hyDpx5pc4rk9dNYlwo37oLW0GBX0vj6HYnYUUGLbgwBUPfuuSu8JEKC w6gd1Q5bcDy4Ao7UIbM6fopEB7agNA38WCCJmG9HeM+Yy6nXS94SLcH4uEKYAP+i WBUh5Ev/gYOXChMVrNOtlTq2FsAqw==
X-ME-Sender: <xms:WOwpX1lS1zRuTJhOXKzRGshfEzqomR65j9bX_frm7tSou5gKq-SiIw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrjeejgddvtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpegtggfuhfgjfffgkfhfvffosehtqhhmtdhhtdejnecuhfhrohhmpeforghrkhcu pfhothhtihhnghhhrghmuceomhhnohhtsehmnhhothdrnhgvtheqnecuggftrfgrthhtvg hrnhepjeevheelieekueeutddthfekgfeuvdehvedtuefhfffflefgjeeljeeggedufeeh necuffhomhgrihhnpehkuhgsvghrnhgvthgvshdrihhopdhorhgrtghlvgdrtghomhdpjh hmvghsphgrthhhrdhorhhgpdgrmhgriihonhdrtghomhdpmhhitghrohhsohhfthdrtgho mhdpihgvthhfrdhorhhgpdhmnhhothdrnhgvthenucfkphepudduledrudejrdduheekrd dvhedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep mhhnohhtsehmnhhothdrnhgvth
X-ME-Proxy: <xmx:WOwpXw0irFMnDMpwolaM0INXKzYHPbfxwKjxwJ0lrx0hKHbwKDi5mA> <xmx:WOwpX7qFPujyiPGHBE31Q5yVrLIGrDWFiR39dREAEfhmqe4l9NU-hw> <xmx:WOwpX1l4H-cC9XIpEKadhplXaOvkmJKUGTlGbGuIdSjGvhWPxUxTGA> <xmx:WewpXxDwXsuU5rEP-oHpX-IPtXaOYaDj_QF0URKNHoFOVmfT5fBlCQ>
Received: from marks-air.mnot.net (119-17-158-251.77119e.mel.static.aussiebb.net [119.17.158.251]) by mail.messagingengine.com (Postfix) with ESMTPA id 1BB1330600A6; Tue, 4 Aug 2020 19:16:38 -0400 (EDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\))
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <CAAWU5L4Rd87+VVc7cZkUw5=MsbNc0=HJh1jiS037xGL4rx4BPw@mail.gmail.com>
Date: Wed, 05 Aug 2020 09:16:36 +1000
Cc: Darrel Miller <Darrel.Miller=40microsoft.com@dmarc.ietf.org>, "dispatch@ietf.org" <dispatch@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <F2081CD0-91BD-404B-B610-F38009A7FA10@mnot.net>
References: <DM6PR00MB08482BB8234F35A07BCC1F93F04D0@DM6PR00MB0848.namprd00.prod.outlook.com> <CAAWU5L4Rd87+VVc7cZkUw5=MsbNc0=HJh1jiS037xGL4rx4BPw@mail.gmail.com>
To: Davide Bettio <davide.bettio@ispirata.com>
X-Mailer: Apple Mail (2.3608.80.23.2.2)
Archived-At: <https://mailarchive.ietf.org/arch/msg/dispatch/K5D97tBzGcd95rYhLmS0C1b9-pA>
Subject: Re: [dispatch] JSONPath or JMESPath?
X-BeenThere: dispatch@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DISPATCH Working Group Mail List <dispatch.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dispatch>, <mailto:dispatch-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dispatch/>
List-Post: <mailto:dispatch@ietf.org>
List-Help: <mailto:dispatch-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dispatch>, <mailto:dispatch-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 04 Aug 2020 23:16:52 -0000

Just some general comments (I don't have any particular insights or preferences regarding technology here):

> On 4 Aug 2020, at 11:48 pm, Davide Bettio <davide.bettio@ispirata.com> wrote:
> 
> Hello,
> 
> I agree, JMESPath looks excellent however I would like to raise points
> on this topic:
> 
> * both JMESPath and JSONPath have a number of users and softwares
> which are using them (JSONPath: [1], [2], etc...)
> * JSONPath is easier to implement compared to JMESPath
> * JSONPath has wider number of different implementations (and
> different supported languages)
> * without a JSONPath standard people will continue using and
> implementing it, but all inconsistencies will stay there without any
> fix (and standard)

The purpose of standardisation isn't to preclude all other approaches being used, nor is it to address all possible problems in the world. What we're trying to do is choose a suitable basis for future work -- one that will result in the best combination of interoperability, deployment, and functionality.

> * a number of supported JSONPath paths are also valid JMESPath paths
> * most JSONPath inconsistencies come out when dealing with corner
> cases and nearly ill formed paths

Unfortunately, those are the usual places that interoperability becomes hard - and eventually necessary to consider. Consider the history of HTML.

> * a JSONPath consensus can be easily found when dealing with all the
> most common use cases

That's only something we can find out by actually trying to achieve consensus; it's premature to say it's easy.

> * JSONPath "scripting" is mostly used for filtering, a strict spec is
> required, but I don't see it as a stopper issue
> * JMESPath has support for some useful functions such as sort, ceil,
> etc. which they enable more powerful operations
> 
> So what I really see here as a major key difference is that JMESPath
> has support for functions, which they require a more complex
> implementation, and I'm not sure if JSONPath users are interested in
> them (to be fairly honest I would find them useful, but I'm not sure
> about any other else).
> 
> Regards,
> Davide Bettio.
> 
> [1]: https://kubernetes.io/docs/reference/kubectl/jsonpath/
> [2]: https://docs.oracle.com/en/database/oracle/oracle-database/12.2/adjsn/json-path-expressions.html#GUID-2DC05D71-3D62-4A14-855F-76E054032494
> 
> Il giorno lun 3 ago 2020 alle ore 15:27 Darrel Miller
> <Darrel.Miller=40microsoft.com@dmarc.ietf.org> ha scritto:
>> 
>> After reviewing the discussion from the Dispatch meeting related to the JSONPath standardization effort I noticed there was no mention of JMESPath (pronounced JamesPath)  (https://www.jmespath.org ).
>> 
>> 
>> 
>> In some recent specification work I was involved with, we were faced with the need for this type of query capability.  Our investigation led us to move forward with JMESPath instead of JSONPath.  The reasons included:
>> 
>> It has a complete ABNF description https://jmespath.org/specification.html
>> It has a compliance suite https://jmespath.org/compliance.html
>> It has a reasonable set of language support https://jmespath.org/libraries.html
>> JMESPath doesn’t have a dependency on an underlying scripting language
>> 
>> 
>> 
>> 
>> 
>> JMESPath came from the Python world and has been picked up by both AWS and Azure as a query capability in their command line tools.  This drives a significant amount of exposure to developers.
>> 
>> https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-output.html#cli-usage-output-filter
>> 
>> https://docs.microsoft.com/en-us/cli/azure/query-azure-cli?view=azure-cli-latest
>> 
>> 
>> 
>> While I do believe there is value in standardizing a tech that has wide usage like JSONPath, due to the current challenges with JSONPath implementation variations, would it more valuable to try and coalesce the industry around an option that already has a formally defined grammar and compliance tests?
>> 
>> 
>> 
>> Darrel
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> dispatch mailing list
>> dispatch@ietf.org
>> https://www.ietf.org/mailman/listinfo/dispatch
> 
> _______________________________________________
> dispatch mailing list
> dispatch@ietf.org
> https://www.ietf.org/mailman/listinfo/dispatch

--
Mark Nottingham   https://www.mnot.net/