Re: [netmod] Y09: optional keys

Martin Bjorklund <mbj@tail-f.com> Thu, 20 November 2014 08:55 UTC

Return-Path: <mbj@tail-f.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A6E2B1A00A3 for <netmod@ietfa.amsl.com>; Thu, 20 Nov 2014 00:55:53 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.495
X-Spam-Level:
X-Spam-Status: No, score=-2.495 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.594, SPF_PASS=-0.001] autolearn=ham
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 B3l-tKigv66G for <netmod@ietfa.amsl.com>; Thu, 20 Nov 2014 00:55:46 -0800 (PST)
Received: from mail.tail-f.com (mail.tail-f.com [83.241.162.140]) by ietfa.amsl.com (Postfix) with ESMTP id E4ADD1A00C0 for <netmod@ietf.org>; Thu, 20 Nov 2014 00:55:45 -0800 (PST)
Received: from localhost (173-38-208-169.cisco.com [173.38.208.169]) by mail.tail-f.com (Postfix) with ESMTPSA id 0C2D51280098; Thu, 20 Nov 2014 09:55:44 +0100 (CET)
Date: Thu, 20 Nov 2014 09:55:44 +0100
Message-Id: <20141120.095544.241105593989651686.mbj@tail-f.com>
To: lhotka@nic.cz
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <m27fyqqn64.fsf@nic.cz>
References: <201411181937.sAIJbguL080247@idle.juniper.net> <20141119.104651.1930940910444913825.mbj@tail-f.com> <m27fyqqn64.fsf@nic.cz>
X-Mailer: Mew version 6.5 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: http://mailarchive.ietf.org/arch/msg/netmod/jTjxvEqrF4ZZSiVh38lugAKJ4bo
Cc: netmod@ietf.org
Subject: Re: [netmod] Y09: optional keys
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.15
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: <http://www.ietf.org/mail-archive/web/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, 20 Nov 2014 08:55:53 -0000

Ladislav Lhotka <lhotka@nic.cz> wrote:
> Martin Bjorklund <mbj@tail-f.com> writes:
> 
> > Phil Shafer <phil@juniper.net> wrote:
> >> * OPEN :Y09: introduce optional keys
> >> 
> >> I don't understand the 'resolution' here.
> >> 
> >> My concern is that optional keys make interaction with databases
> >> more difficult.  Keys are mandatory for most databases.
> >
> > Implementation detail.  Most databases do not support hierarchical
> > structures; yet we have that in YANG.
> >
> >> The usage of 'not(key)' in the second solution is not compatible
> >> with xpath expressions
> >
> > [...]
> >
> >> not(optional-key) would be true when the value is a numeric zero
> >> or a zero length string.
> >
> > Whoops.  You are right.  This would work: not(count(key)) - but looks
> > extremely weird.
> 
> No, Phil is not right:

[...]

> not(key) evaluates to true only if no <key> element is present. The
> value doesn't matter.

Good!  Sorry for contributing to the confusion.

Actually, Phil wrote:

  not(optional-key) would be true when the value is a numeric zero
    or a zero length string.

which *is* true, but irrelevant.

What is important for Y09-02 is that we have a representation of an
instance-identifier for instances with unset optional keys, and that
this representation gives the correct instance when evaluated as an
XPath expression.



/martin