Re: [netmod] leaf-list and subtree filtering

Andy Bierman <andy@netconfcentral.com> Sun, 25 January 2009 20:14 UTC

Return-Path: <netmod-bounces@ietf.org>
X-Original-To: netmod-archive@ietf.org
Delivered-To: ietfarch-netmod-archive@core3.amsl.com
Received: from [127.0.0.1] (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 2ADC43A6A86; Sun, 25 Jan 2009 12:14:10 -0800 (PST)
X-Original-To: netmod@core3.amsl.com
Delivered-To: netmod@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 913443A6A97 for <netmod@core3.amsl.com>; Sun, 25 Jan 2009 12:14:08 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.282
X-Spam-Level:
X-Spam-Status: No, score=-2.282 tagged_above=-999 required=5 tests=[AWL=-0.017, BAYES_00=-2.599, IP_NOT_FRIENDLY=0.334]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fjtogqoe6Dgf for <netmod@core3.amsl.com>; Sun, 25 Jan 2009 12:14:07 -0800 (PST)
Received: from smtp128.sbc.mail.sp1.yahoo.com (smtp128.sbc.mail.sp1.yahoo.com [69.147.65.187]) by core3.amsl.com (Postfix) with SMTP id D96153A6A86 for <netmod@ietf.org>; Sun, 25 Jan 2009 12:14:07 -0800 (PST)
Received: (qmail 50058 invoked from network); 25 Jan 2009 20:13:50 -0000
Received: from unknown (HELO ?127.0.0.1?) (andy@207.215.244.31 with plain) by smtp128.sbc.mail.sp1.yahoo.com with SMTP; 25 Jan 2009 20:13:49 -0000
X-YMail-OSG: G3FGMQUVM1kFaSCD8EzFi3BqC5BfQcm32a8m0d.bvyKCSUPhXfz.PYrC93823Xe6PpRqMN2Bj9V37PUz1r6dffBGw8WX6Sbp8NjyUjOYye1xpbRNY5qxhf_9kBm9aO5CU.exAAuiuZ8PkPNWYB7XpaC5l7ooiWLy1Zw_S_nLqoga1e6Dyd7EUOFDvlYl.z.PdvfzY5w.VuatvGc0TFapug--
X-Yahoo-Newman-Property: ymail-3
Message-ID: <497CC7FB.1010005@netconfcentral.com>
Date: Sun, 25 Jan 2009 12:13:47 -0800
From: Andy Bierman <andy@netconfcentral.com>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
To: Martin Bjorklund <mbj@tail-f.com>
References: <497CA74F.2010407@netconfcentral.com> <20090125.205344.216637668.mbj@tail-f.com>
In-Reply-To: <20090125.205344.216637668.mbj@tail-f.com>
Cc: netmod@ietf.org
Subject: Re: [netmod] leaf-list and subtree filtering
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/pipermail/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>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: netmod-bounces@ietf.org
Errors-To: netmod-bounces@ietf.org

Martin Bjorklund wrote:
> Hi,
> 
> Andy Bierman <andy@netconfcentral.com> wrote:
>>    <rpc>
>>      <get>
>>        <filter>
>>          <foo>fred</foo>
>>        </filter>
>>      </get>
>>    </rpc>
>>
>>    <config>
>>      <foo>fred</foo>
>>      <foo>barney</foo>
>>      <foo>wilma</foo>
>>    </config>
>>
>>    <rpc-reply>
>>      <data></data>
>>    </rpc-reply>
>>
>> This example shows a leaf-list at the top-level.
>> Since the content-match tests are AND-ed together,
>> any non-match cancels out all the siblings.
> 
> I don't agree.  Since there is a node in the data store that matches
> the content match node <foo>fred</foo>, all sibling nodes at this
> level are selected.
> 

 From RFC 4741, 6.2.5:

    A leaf node that contains simple content is called a "content match
    node".  It is used to select some or all of its sibling nodes for
    filter output, and it represents an exact-match filter on the leaf
    node element content.  The following constraints apply to content
    match nodes:

    o  A content match node must not contain nested elements (i.e., must
       resolve to a simpleType in the XML Schema Definition (XSD)).

    o  Multiple content match nodes (i.e., sibling nodes) are logically
       combined in an "AND" expression.


This 2nd bullet needs to be clarified in 4741-bis.
It is confusing whether it means that every
content match (CM) node which matches the QName of CM node
must also match in content as well, or if it means
that at least one match of the CM node QName must contain
the specified value (and just that leaf-list node
is selected, since they are all unique in value).

I do not think the RFC is clear on this issue at all.

I get it that multiple content match node tests are
AND-ed together. That is all the 2nd bullet addresses.

    <filter>
       <foo>fred</foo>
       <bar>7</bar>
    </filter>

It's fine with me to interpret the intended behavior
as "at least one instance" of each CM node must match
the content of the CM node, not "every instance" must match.
That is more useful.  The current RFC is silent
on this issue, so 4741-bis should have some text added
to fix it.


> content-match siblings are AND-ed together, but in this example there
> is just one node (no siblings in the filter).
> 
>> The value of a leaf list vs. an XSD list
>> is more apparent with XPath filtering,
>> because tests like "*[foo='fred']" can
>> select a parent node if 'fred' is a member
>> of the child leaf-list <foo>.
> 
> 5.2.5 of 4741 explicitly states that subtree filtering does not
> support (XSD) list content.
> 
> 
> /martin
> 
> 
> 

Andy

_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod