Re: [netmod] xpath expressions in JSON

Ladislav Lhotka <lhotka@nic.cz> Tue, 23 October 2018 10:28 UTC

Return-Path: <lhotka@nic.cz>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3A1B1130DFE for <netmod@ietfa.amsl.com>; Tue, 23 Oct 2018 03:28:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7
X-Spam-Level:
X-Spam-Status: No, score=-7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
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 xd2FJdAn14qN for <netmod@ietfa.amsl.com>; Tue, 23 Oct 2018 03:28:16 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [217.31.204.67]) (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 88C6F12F1AB for <netmod@ietf.org>; Tue, 23 Oct 2018 03:28:16 -0700 (PDT)
Received: from birdie (unknown [IPv6:2001:718:1a02:1::380]) by mail.nic.cz (Postfix) with ESMTPSA id 62351600D8; Tue, 23 Oct 2018 12:28:14 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1540290494; bh=cudxfVF7T9rHXkFTOPUrmb5Gx4nYvV9uZfi57Jj6NV4=; h=From:To:Date; b=ZanwP33FhDrvbNY6Eh6eNoR/PNnn75tQxrLOYMKNokMM8Nop2XhV65ws4wdx3MwVm dJl9VNYY0Jl6U8xFSNgnC10UfHUaSVV7l+98higiMYvipQAWY7GdPPKUlMRnAJwf7M e4oX3l5ZqJOqGx3NikZ/ziu/PSbDjGZBvcBdAL5Y=
Message-ID: <db8131ecf2b77cf7c3ef247076b47f8ba72bce6f.camel@nic.cz>
From: Ladislav Lhotka <lhotka@nic.cz>
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, Robert Wilton <rwilton@cisco.com>
Cc: netmod@ietf.org
Date: Tue, 23 Oct 2018 12:28:13 +0200
In-Reply-To: <20181023101630.7m52ctd3wb3nq2t3@anna.jacobs.jacobs-university.de>
References: <20181022.145605.1533686864301630023.mbj@tail-f.com> <c65c0eaf9054242c5378f50c001789a84b3007c2.camel@nic.cz> <B8F9A780D330094D99AF023C5877DABA9B0BC6A0@nkgeml513-mbx.china.huawei.com> <20181023.084254.2257754077098127031.mbj@tail-f.com> <87d0s1azc8.fsf@nic.cz> <ed32a8f0-53b5-dbee-c6ac-b1ff2ddad039@cisco.com> <8ef79f3002b77b8be59d667b656e776c80a80531.camel@nic.cz> <20181023092800.mhu4kntxhjycsol4@anna.jacobs.jacobs-university.de> <d0ac6404-4af7-c046-37bf-ca3eb7814bc8@cisco.com> <20181023101630.7m52ctd3wb3nq2t3@anna.jacobs.jacobs-university.de>
Organization: CZ.NIC
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.30.2
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: clamav-milter 0.99.2 at mail
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/BApKcQ6h1ZObunoyk8VJCMqxUIE>
Subject: Re: [netmod] xpath expressions in JSON
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 23 Oct 2018 10:28:19 -0000

On Tue, 2018-10-23 at 12:16 +0200, Juergen Schoenwaelder wrote:
> On Tue, Oct 23, 2018 at 10:39:22AM +0100, Robert Wilton wrote:
> > Hi Juergen,
> > 
> > Is this the same as Martin's alternative B proposed previously (attached)? 
> > Or are you suggesting a different alternative?
> > 
> 
> Likely the same, but I admit that I do not understand Martin's
> comment:
> 
>   Con: in XML, this leaf is treated differently from other XPath
>        expressions, such as get-config filter and nacm rules.
> 
> If the context has ietf-interfaces pre-populated and you receive
> if:ietf-interfaces with proper XML namespace bindings, one could add
> the prefix if to the namespace declarations. One might even use (if
> the server signals that it supports prepopulated namespaces) the
> module name prefixed xpath expressions in say get-data.

This may be the best option: the "verbose" prefix/namespace bindings will be
available in all encodings, which doesn't prevent users of the XML encoding to
define additional ones.

I would suggest to extend the definition of the "xpath1.0" type with the
corresponding specification of the default XPath context.

Lada

> 
> The only downside really is the verbosity but I value compatibility
> with xpath and no ambiguity or corner cases where things can clash
> higher than compactness. And a client that is capable to parse xpath
> and yang-library aware may do the expansion locally or if we work out
> the details, a server may signal its ability to do the expansion as
> well (not sure though that all this is effort well invested since N
> different ways to send around xpath expressions increases costs on all
> sides and is asking for interoperability problems. Hence, I rather go
> with longish xpath expressions for the sake of simplicity and
> interoperability.
> 
> /js
> 
-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67