Re: [netmod] xpath expressions in JSON

"Reshad Rahman (rrahman)" <rrahman@cisco.com> Thu, 11 October 2018 02:00 UTC

Return-Path: <rrahman@cisco.com>
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 B5796130DFE for <netmod@ietfa.amsl.com>; Wed, 10 Oct 2018 19:00:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.5
X-Spam-Level:
X-Spam-Status: No, score=-14.5 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, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.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 ePNoVPfi5ngB for <netmod@ietfa.amsl.com>; Wed, 10 Oct 2018 18:59:59 -0700 (PDT)
Received: from rcdn-iport-5.cisco.com (rcdn-iport-5.cisco.com [173.37.86.76]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id ADC92130DFB for <netmod@ietf.org>; Wed, 10 Oct 2018 18:59:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3926; q=dns/txt; s=iport; t=1539223199; x=1540432799; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=bRWtGx/ehDuctyYaOgnn1MurEaJWK/spw78Nf7/LN1s=; b=KPavBZdm1YfWliQAgyy+fLl8ylvZdW2DoLWFSI03yp1RFG+n/+WB6bx8 p18LDFGT4RW+P7U6X/mO3rRFsXucSyWc0txbVAzls2ZZycVpiirX61tRU 6e5K4oA9FfdMFvEjziwS1OGw1KEAocCxp83E+nNOLKTdawJQOmXabjnYf o=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0AQAAC/rb5b/4YNJK1jGQEBAQEBAQEBAQEBAQcBAQEBAQGBVAEBAQEBAQsBggNmfygKg2uUTYFoJZh5CwEBGAuEA0YCF4Q5ITcKDQEDAQECAQECbRwMhTkBAQEDAQEBIRE6CxACAQgOCgICJgICAiULFRACBAEJBAWDIQGBeQgPph+BLoR3hGUFgQuKMBeBQT+BOQwTgkyDGwEBgUsWFyOCRzGCJgKOMY9YCQKQUBeBT44+iROMVAIRFIElMyKBVXAVOyoBgkGLF4U+b4xEgR8BAQ
X-IronPort-AV: E=Sophos;i="5.54,366,1534809600"; d="scan'208";a="246597327"
Received: from alln-core-12.cisco.com ([173.36.13.134]) by rcdn-iport-5.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2018 01:59:58 +0000
Received: from XCH-RCD-004.cisco.com (xch-rcd-004.cisco.com [173.37.102.14]) by alln-core-12.cisco.com (8.15.2/8.15.2) with ESMTPS id w9B1xwTH013425 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Thu, 11 Oct 2018 01:59:58 GMT
Received: from xch-rcd-005.cisco.com (173.37.102.15) by XCH-RCD-004.cisco.com (173.37.102.14) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 10 Oct 2018 20:59:58 -0500
Received: from xch-rcd-005.cisco.com ([173.37.102.15]) by XCH-RCD-005.cisco.com ([173.37.102.15]) with mapi id 15.00.1395.000; Wed, 10 Oct 2018 20:59:58 -0500
From: "Reshad Rahman (rrahman)" <rrahman@cisco.com>
To: Martin Bjorklund <mbj@tail-f.com>, "lhotka@nic.cz" <lhotka@nic.cz>
CC: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] xpath expressions in JSON
Thread-Index: AQHUYIqyJUA4hM8yQEuWRAlaWHhia6UYv5+AgAAV+YCAAIZOgA==
Date: Thu, 11 Oct 2018 01:59:57 +0000
Message-ID: <3B614CF4-9545-4C31-BEF4-CDFBF72AA045@cisco.com>
References: <20181010.131610.1510095762179710072.mbj@tail-f.com> <8736tevut6.fsf@nic.cz> <20181010.155915.278994099457235212.mbj@tail-f.com>
In-Reply-To: <20181010.155915.278994099457235212.mbj@tail-f.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/10.b.0.180311
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.86.245.62]
Content-Type: text/plain; charset="utf-8"
Content-ID: <B15206BC14611D43B8300A7D67BF1BAD@emea.cisco.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-Outbound-SMTP-Client: 173.37.102.14, xch-rcd-004.cisco.com
X-Outbound-Node: alln-core-12.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/GorshfjJ9wxO8UbJkavTmdbiKzA>
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: Thu, 11 Oct 2018 02:00:02 -0000

On 2018-10-10, 9:59 AM, "netmod on behalf of Martin Bjorklund" <netmod-bounces@ietf.org on behalf of mbj@tail-f.com> wrote:

    Ladislav Lhotka <lhotka@nic.cz> wrote:
    > Martin Bjorklund <mbj@tail-f.com> writes:
    > 
    > > Hi,
    > >
    > > While reviewing restconf-notif, I saw this example:
    > >
    > >    {
    > >       "ietf-subscribed-notifications:input": {
    > >          "stream": "NETCONF",
    > >          "stream-xpath-filter": "/ds:foo/",
    > >          "dscp": "10"
    > >       }
    > >    }
    > >
    > > Note the "stream-xpath-filter".  It has a prefix in the XPath string.
    > > How are prefixes declared when JSON is used?
    > >
    > > The leaf "stream-xpath-filter" says:
    > >
    > >               o  The set of namespace declarations are those in scope on
    > >                  the 'stream-xpath-filter' leaf element.
    > >
    > > (I think I provided that text...)
    > >
    > > This assumes that the encoding is XML, or at leas that the encoding
    > > can somehow transfer namespace declarations.
    > 
    > It can't. There are two options:
    > 
    > 1. have different representations of this value in XML and JSON,
    >    analogically to instance indentifiers (sec. 6.11 in RFC 7951).
    > 
    > 2. use a module name rather than a prefix in XML, too.
    > 
    > I would suggest #2.
<RR> But that means making non-backwards compatible change to the XML representation?
    
    Hmm, so you mean change the leaf "stream-xpath-filter" to say:
    
             o  The set of namespace declarations has one member for each
                YANG module supported by the server.  This member maps
                from the YANG module name to the YANG module namespace.
    
                This means that in the XPath expression, the module name
                serves as the prefix.
    
    .... and then also give an example of this.
    
    This is probably what we need to do in all places where yang:xpath1.0
    is used, going forward.  Maybe even define a new type
    yang:xpath1.0-2 (name?) with the set of namespace declarations
    built-in.
<RR> So we need an update to RFC7951?

Regards,
Reshad.
    
    
    /martin
    
    
    
    
    
    > 
    > Lada
    > 
    > >
    > > How is this supposed to work with JSON?
    > >
    > >
    > > /martin
    > >
    > > _______________________________________________
    > > netmod mailing list
    > > netmod@ietf.org
    > > https://www.ietf.org/mailman/listinfo/netmod
    > 
    > -- 
    > Ladislav Lhotka
    > Head, CZ.NIC Labs
    > PGP Key ID: 0xB8F92B08A9F76C67
    > 
    
    _______________________________________________
    netmod mailing list
    netmod@ietf.org
    https://www.ietf.org/mailman/listinfo/netmod