Re: [netmod] choice/case in tree diagrams

Mahesh Jethanandani <mjethanandani@gmail.com> Mon, 05 March 2018 18:23 UTC

Return-Path: <mjethanandani@gmail.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 D46E812DA2B for <netmod@ietfa.amsl.com>; Mon, 5 Mar 2018 10:23:09 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.998
X-Spam-Level:
X-Spam-Status: No, score=-1.998 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 JXZO4bdhu0gL for <netmod@ietfa.amsl.com>; Mon, 5 Mar 2018 10:23:08 -0800 (PST)
Received: from mail-pg0-x234.google.com (mail-pg0-x234.google.com [IPv6:2607:f8b0:400e:c05::234]) (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 1C49912D77B for <netmod@ietf.org>; Mon, 5 Mar 2018 10:23:08 -0800 (PST)
Received: by mail-pg0-x234.google.com with SMTP id g8so2504108pgv.7 for <netmod@ietf.org>; Mon, 05 Mar 2018 10:23:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=+fPuIPDf9k1pL7fgovGaXTGq6iWQb8Ww8v/21ywMovo=; b=oY8nV1M6yRU+2NnFPDD3DfC9BbMYk5GUHQ8TJrYOc94vc3dVV9k6OkoQ+uTazxODTp xF8kMM+G6oVfKvjOX3L3oMZ5lRBN7Hn5haSCDhh2mIDehZjYLNBr9uFE5f3bY7/q90GJ PZ4K6W19CrffglTOZUWVkkL+FZdbf5vcwKgw7pSfdtWoqlg1eqtFKPH5n5hUqkikUMgK 6ICXx2DgK7rWz4NqNQeypm0BFMNqiqLXVcRGLFB+vS+yHvvVNbgoPPoYEYW0+xEhw8ae jeBeIxf3TKSMWE9XtR3qc48lbXZ665LvzsjWmA5c3dFUwzfrnx1cxPH1f1SNB7tuBxyg 4NIw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=+fPuIPDf9k1pL7fgovGaXTGq6iWQb8Ww8v/21ywMovo=; b=AEwJ1fTAbKW24gpCSkZIgNYupFdiPrmaMzgr1UMipBinJBGtwOw8qazOeUt5BzWxTq 74HcOwNWNo06sj7Azq2CVlc3pXxFSN+eCPeBdKeJe46+1C+Enx9Fr9z/N8iptG8XaoKe ngE+ysVeUc9cn0amI3ORGo1Q9M7KkT5aeVmr8Y62nHTp/zUyRi7p/TEepOIzvocVZM/a zOkmFLH4i2OSEVPyR1nTRoAWzFxmZPDUscJt+yVQIxUvYvMEMlkVcNjfbSl/2eoEdWzZ BlM+uHCPRuTchI8PRE262mshebCNgp3NBTXq2ibp4w7LhU1RCI8rJVtPLbe7EeLi032v 1eJw==
X-Gm-Message-State: APf1xPChjpU7dVL753XmwILR+sqwTlrbaBimZr5f35lua4PNsEKH+8/N kIPQumZxG6uJqiszVxmBhsA=
X-Google-Smtp-Source: AG47ELthgt38k7vvJ8jY4buuxuq9cB1tubU1ey6qJ7iy8EFraBlJ7+ZFNsfuH3cqgy2jBwnt7MMoPA==
X-Received: by 10.101.99.133 with SMTP id h5mr12546071pgv.381.1520274187657; Mon, 05 Mar 2018 10:23:07 -0800 (PST)
Received: from ?IPv6:2601:647:4700:1280:8453:8d19:9450:2481? ([2601:647:4700:1280:8453:8d19:9450:2481]) by smtp.gmail.com with ESMTPSA id s9sm24008058pfm.39.2018.03.05.10.23.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 10:23:07 -0800 (PST)
From: Mahesh Jethanandani <mjethanandani@gmail.com>
Message-Id: <3338E375-31AB-4064-8A83-88410776E40F@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_C98E053B-FC88-4DF5-BC93-FEBF29D89488"
Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\))
Date: Mon, 05 Mar 2018 10:23:14 -0800
In-Reply-To: <20180305.152754.1045464928563003353.mbj@tail-f.com>
Cc: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, netmod@ietf.org
To: Martin Bjorklund <mbj@tail-f.com>
References: <20180305.145418.2010818875235650756.mbj@tail-f.com> <20180305141355.gi6kfej3eifdxtjq@elstar.local> <20180305.152602.113020152789243398.mbj@tail-f.com> <20180305.152754.1045464928563003353.mbj@tail-f.com>
X-Mailer: Apple Mail (2.3445.5.20)
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/rONRdL5wkkGAZrCJ2oCwlZ6Z8Gw>
Subject: Re: [netmod] choice/case in tree diagrams
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
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: Mon, 05 Mar 2018 18:23:10 -0000


> On Mar 5, 2018, at 6:27 AM, Martin Bjorklund <mbj@tail-f.com> wrote:
> 
> Martin Bjorklund <mbj@tail-f.com <mailto:mbj@tail-f.com>> wrote:
>> Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> wrote:
>>> On Mon, Mar 05, 2018 at 02:54:18PM +0100, Martin Bjorklund wrote:
>>>>> 
>>>>> So it seems the running code got it right. ;-)
>>>> 
>>>> As the author of that code, I think that was purely by accident...
>>>> 
>>>> But I'm not convinced it is the correct solution.  We have one example
>>>> in the other thread where someone was confused by the "rw" flag and
>>>> thought that it implied that the node would be present in the data
>>>> tree.
>>>> 
>>> 
>>> So what does rw mean?
>>> 
>>> (i)  The schema node has a rw property.
>>> (ii) The schema node can be instantiated and the instantiated data node
>>>     has a rw property.
>>> 
>>> I think it is difficult to have both at the same time. If the tree is
>>> a representation of schema nodes, then (i) seems to make more
>>> sense. That said, the explanation in 2.6 is somewhat vague since it
>>> says 'data' and not 'nodes' (like everywhere else):
>>> 
>>> OLD:
>>> 
>>>       <flags> is one of:
>>>         rw  for configuration data
>>>         ro  for non-configuration data, output parameters to rpcs
>>>             and actions, and notification parameters
>>> 
>>> NEW:
>>> 
>>>       <flags> is one of:
>>>         rw  for configuration data nodes
>>>         ro  for non-configuration data nodes, output parameters to rpcs
>>>             and actions, and notification parameters
>> 
>> I think this is ok.  But that means that we also have to add:
>> 
>>           --  for a choice or case node
>> 
>> But in order to be consistent, we should probably have:
>> 
>>           --  for a choice, case, input or output node
> 
> Whoops, it shouldn't be "--".  Somehow we should say that no flags are
> used for choice,case,input,output.

I would agree, as having choice/case statements represented as schema nodes is not only confusing in the tree diagram, but also confusing when constructing an example. The tree diagram represents it as a node, where one would put it in the example, but validation complained about it (not being a node).

> 
> 
> /martin
> 
> 
>> 
>> 
>> This means that the correct tree syntax for choice and case will be:
>> 
>>     +-- (subnet)?
>>        +-- :(prefix-length)
>>        |  +--rw prefix-length?   uint8
>>        +-- :(netmask)
>>           +--rw netmask?         yang:dotted-quad
>> 
>> 
>> /martin
>> 
>> 
>>> The document (as far as I searched for it) does not clearly say that
>>> 'node' means 'schema node'. In hindsight, it might have been useful to
>>> explicitely import terminology from RFC 7950 and to use it carefully
>>> (RFC 7950 has 'schema node' and 'data node' but here we largely talk
>>> about 'nodes' - and my assumption is that this means 'schema nodes'.)
>> 
>> _______________________________________________
>> netmod mailing list
>> netmod@ietf.org
>> https://www.ietf.org/mailman/listinfo/netmod
>> 
> 
> _______________________________________________
> netmod mailing list
> netmod@ietf.org <mailto:netmod@ietf.org>
> https://www.ietf.org/mailman/listinfo/netmod <https://www.ietf.org/mailman/listinfo/netmod>
Mahesh Jethanandani
mjethanandani@gmail.com