Re: [dispatch] JSONPath or JMESPath?

Davide Bettio <davide.bettio@ispirata.com> Tue, 04 August 2020 13:48 UTC

Return-Path: <davide.bettio@ispirata.com>
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 C27013A07E0 for <dispatch@ietfa.amsl.com>; Tue, 4 Aug 2020 06:48:46 -0700 (PDT)
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, SPF_HELO_NONE=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=ispirata.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 lcncVInz38GJ for <dispatch@ietfa.amsl.com>; Tue, 4 Aug 2020 06:48:45 -0700 (PDT)
Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (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 29A6A3A07DB for <dispatch@ietf.org>; Tue, 4 Aug 2020 06:48:40 -0700 (PDT)
Received: by mail-wr1-x434.google.com with SMTP id c15so1252002wrs.11 for <dispatch@ietf.org>; Tue, 04 Aug 2020 06:48:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispirata.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=T01UKvLM6ACjIWDk4D2xSZOmChLFJgV54mnje+Ru/mU=; b=H3n1JFvYjpThTt9rxZFJADSDf0Y4UtYYJ5N/YaBZEPMwXJdZ+UO7cbtH9M03NBluUM ThD+tLfUU+KXuahu0xIqgslbn1KEwSrmRQZMVjNWt/eSaBbf8DjwL/QUhdJf0gzHJ86b r8WAwR9T6fM8thdbTrmqfVx1QtWoJsy/EHWpb5ocWz7iCNQUiIpYBNEotvg6UN+SQSf4 djQLSkFd05J/HbBMU2BH6inUT0Dmsm7GtMT6RrPShsF8Z96duFP3UhXTFOvzliVdz88E +wBehT2U5evUHj+MV+IPnxahxZXeDYuNab+dU6TGhaBplrm1fesz4g96vaw2RTsKQGMZ Hf/g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=T01UKvLM6ACjIWDk4D2xSZOmChLFJgV54mnje+Ru/mU=; b=J6gvhEBYp0fqtsTM+7IfroegoaNJkpjBK4IOqJDzgIG3OTeK24khzM1B/1yZZSazac 988sWNcd9i+dGq4zSNV9d0klXGhPT//4CApgF2GaIGYk6lSraPgS+MdBygHBAImtQYZX vgbaa1YF0JkJGZPJTNppGObxrA5Y/PzhiXabx46H6m9i9pbE+6lD477nG+9GrInZhzrx b/LpsTZZXoadY+aWw96Ca1MmSERrbkflNhRBsP7Z3kfSlygo4hW5i/AFJMnDEVamnKsM VWE/5QxhcEIzph9CxJcPxaGAVjTYImNGVEEyZzZAGgZg7XZb04OOWN27Lge6xRwNC9w1 uQwg==
X-Gm-Message-State: AOAM533iwd50ftdfWzzPlb7Whs4jobA0mPUfMF/HDS+4XylEyUSTAlWc /c6PejFzlfsOvNE1KbFn3F2N85/xUrmavqsrsCwLaRYIQ+o=
X-Google-Smtp-Source: ABdhPJxGX1AYXhX19HxnB76ewa6FY6xqSpR/mb9jQeNJ6fVhj96p7x72nFi2d0mTQfO1LoHSYFyzu7UMc7D179ak0vY=
X-Received: by 2002:adf:efd2:: with SMTP id i18mr18908845wrp.32.1596548918468; Tue, 04 Aug 2020 06:48:38 -0700 (PDT)
MIME-Version: 1.0
References: <DM6PR00MB08482BB8234F35A07BCC1F93F04D0@DM6PR00MB0848.namprd00.prod.outlook.com>
In-Reply-To: <DM6PR00MB08482BB8234F35A07BCC1F93F04D0@DM6PR00MB0848.namprd00.prod.outlook.com>
From: Davide Bettio <davide.bettio@ispirata.com>
Date: Tue, 04 Aug 2020 15:48:02 +0200
Message-ID: <CAAWU5L4Rd87+VVc7cZkUw5=MsbNc0=HJh1jiS037xGL4rx4BPw@mail.gmail.com>
To: Darrel Miller <Darrel.Miller=40microsoft.com@dmarc.ietf.org>
Cc: "dispatch@ietf.org" <dispatch@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/dispatch/oyLLNRBeNk2MN9T2EkcH5efKoLE>
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 13:48:47 -0000

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)
* 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
* a JSONPath consensus can be easily found when dealing with all the
most common use cases
* 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