Re: [netmod] Clarification needed for YANG 1.1 XPATH context

2018-04-13 Thread Radek Krejčí
Hi,
I'm refreshing an old thread to clarify specific use case, see below...

Dne 25.2.2016 v 16:31 Martin Bjorklund napsal(a):
> William Ivory  wrote:
>>
>> -Original Message-
>> From: Martin Bjorklund [mailto:m...@tail-f.com] 
>> Sent: 25 February 2016 15:17
>> To: William Ivory 
>> Cc: netmod@ietf.org
>> Subject: Re: [netmod] Clarification needed for YANG 1.1 XPATH context
>>
>> William Ivory  wrote:
>>> Hi,
>>>
>>> I'm looking for clarification on the meaning of the following 
>>> paragraph in section 6.4.1 (XPATH context) in RFC6020bis:
>>>
>>>'If a node that exists in the accessible tree has a non-presence
>>>container as a child, then the non-presence container also exists in
>>>the tree.'
>>>
>>> It's unclear to me what this is trying to say, and why - for example, 
>>> does this mean that I need to validate any 'must' and 'when'
>>> statements on the child container even when nothing within that child 
>>> container is configured?
>> must expressions are always evaluated if the node where the must
>> expression is defined exists, regardless of the number of children
>> this node has.
>>
>> [wivory] So in my example where the child container (non-presence) has
>> NO children, then it doesn't exist, and any must statement on it
>> should not be run.  Only when a non-presence container has a non-zero
>> number of children should any 'must' statements on that container be
>> run.
>>
>> [wivory] If that's the case, then would it be correct to say that the
>> intention of this paragraph is as a reminder that one must evaluate
>> 'must' statements on nodes that have no inherent meaning and exist
>> only because they contain child nodes?
> No; section 7.5.3 says:
>
>When a datastore is validated, all "must" constraints are
>conceptually evaluated once for each node in the accessible tree (see
>Section 6.4.1).
>
> And the quoted paragraph of 6.4.1 says that the NP-container
> (conceptually) exists if its parent exists - regardless of number of
> children.
>
> So if the parent exists, any must expressions in the NP-container are
> evaluated.
>

what about top-level NP-container with must constraint? Is a root node 
something which is always present in accessible tree (even in an empty tree)? 
Intuitively, I believe that it is, so even constraints on top-level 
NP-containers are supposed to be evaluated, but I cannot find something about 
it in RFC.

Regards,
Radek


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


Re: [netmod] Clarification needed for YANG 1.1 XPATH context

2016-02-25 Thread William Ivory


-Original Message-
From: Martin Bjorklund [mailto:m...@tail-f.com] 
Sent: 25 February 2016 15:31
To: William Ivory 
Cc: netmod@ietf.org
Subject: Re: [netmod] Clarification needed for YANG 1.1 XPATH context

William Ivory  wrote:
> 
> 
> -Original Message-
> From: Martin Bjorklund [mailto:m...@tail-f.com]
> Sent: 25 February 2016 15:17
> To: William Ivory 
> Cc: netmod@ietf.org
> Subject: Re: [netmod] Clarification needed for YANG 1.1 XPATH context
> 
> William Ivory  wrote:
> > Hi,
> > 
> > I'm looking for clarification on the meaning of the following 
> > paragraph in section 6.4.1 (XPATH context) in RFC6020bis:
> > 
> >'If a node that exists in the accessible tree has a non-presence
> >container as a child, then the non-presence container also exists in
> >the tree.'
> > 
> > It's unclear to me what this is trying to say, and why - for 
> > example, does this mean that I need to validate any 'must' and 'when'
> > statements on the child container even when nothing within that 
> > child container is configured?
> 
> must expressions are always evaluated if the node where the must 
> expression is defined exists, regardless of the number of children 
> this node has.
> 
> [wivory] So in my example where the child container (non-presence) has 
> NO children, then it doesn't exist, and any must statement on it 
> should not be run.  Only when a non-presence container has a non-zero 
> number of children should any 'must' statements on that container be 
> run.
> 
> [wivory] If that's the case, then would it be correct to say that the 
> intention of this paragraph is as a reminder that one must evaluate 
> 'must' statements on nodes that have no inherent meaning and exist 
> only because they contain child nodes?

No; section 7.5.3 says:

   When a datastore is validated, all "must" constraints are
   conceptually evaluated once for each node in the accessible tree (see
   Section 6.4.1).

And the quoted paragraph of 6.4.1 says that the NP-container
(conceptually) exists if its parent exists - regardless of number of children.

So if the parent exists, any must expressions in the NP-container are evaluated.

[wivory] Is the intended use case top-level containers (directly under the root 
node) where you might wish to enforce that at least one such container existed? 
 In that case there would be no higher level node (as you can't add when/must 
to root) on which you could attach the 'must'.  At any other level in the tree 
you would always be able to attach the 'must' at a higher level.  Or am I 
missing some use case(s)?

Thanks,

William


/martin

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


Re: [netmod] Clarification needed for YANG 1.1 XPATH context

2016-02-25 Thread Martin Bjorklund
William Ivory  wrote:
> 
> 
> -Original Message-
> From: Martin Bjorklund [mailto:m...@tail-f.com] 
> Sent: 25 February 2016 15:17
> To: William Ivory 
> Cc: netmod@ietf.org
> Subject: Re: [netmod] Clarification needed for YANG 1.1 XPATH context
> 
> William Ivory  wrote:
> > Hi,
> > 
> > I'm looking for clarification on the meaning of the following 
> > paragraph in section 6.4.1 (XPATH context) in RFC6020bis:
> > 
> >'If a node that exists in the accessible tree has a non-presence
> >container as a child, then the non-presence container also exists in
> >the tree.'
> > 
> > It's unclear to me what this is trying to say, and why - for example, 
> > does this mean that I need to validate any 'must' and 'when'
> > statements on the child container even when nothing within that child 
> > container is configured?
> 
> must expressions are always evaluated if the node where the must
> expression is defined exists, regardless of the number of children
> this node has.
> 
> [wivory] So in my example where the child container (non-presence) has
> NO children, then it doesn't exist, and any must statement on it
> should not be run.  Only when a non-presence container has a non-zero
> number of children should any 'must' statements on that container be
> run.
> 
> [wivory] If that's the case, then would it be correct to say that the
> intention of this paragraph is as a reminder that one must evaluate
> 'must' statements on nodes that have no inherent meaning and exist
> only because they contain child nodes?

No; section 7.5.3 says:

   When a datastore is validated, all "must" constraints are
   conceptually evaluated once for each node in the accessible tree (see
   Section 6.4.1).

And the quoted paragraph of 6.4.1 says that the NP-container
(conceptually) exists if its parent exists - regardless of number of
children.

So if the parent exists, any must expressions in the NP-container are
evaluated.


/martin

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


Re: [netmod] Clarification needed for YANG 1.1 XPATH context

2016-02-25 Thread William Ivory


-Original Message-
From: Martin Bjorklund [mailto:m...@tail-f.com] 
Sent: 25 February 2016 15:17
To: William Ivory 
Cc: netmod@ietf.org
Subject: Re: [netmod] Clarification needed for YANG 1.1 XPATH context

William Ivory  wrote:
> Hi,
> 
> I'm looking for clarification on the meaning of the following 
> paragraph in section 6.4.1 (XPATH context) in RFC6020bis:
> 
>'If a node that exists in the accessible tree has a non-presence
>container as a child, then the non-presence container also exists in
>the tree.'
> 
> It's unclear to me what this is trying to say, and why - for example, 
> does this mean that I need to validate any 'must' and 'when'
> statements on the child container even when nothing within that child 
> container is configured?

must expressions are always evaluated if the node where the must expression is 
defined exists, regardless of the number of children this node has.

[wivory] So in my example where the child container (non-presence) has NO 
children, then it doesn't exist, and any must statement on it should not be 
run.  Only when a non-presence container has a non-zero number of children 
should any 'must' statements on that container be run.

[wivory] If that's the case, then would it be correct to say that the intention 
of this paragraph is as a reminder that one must evaluate 'must' statements on 
nodes that have no inherent meaning and exist only because they contain child 
nodes?

Thanks,

William


/martin

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


Re: [netmod] Clarification needed for YANG 1.1 XPATH context

2016-02-25 Thread Martin Bjorklund
William Ivory  wrote:
> Hi,
> 
> I'm looking for clarification on the meaning of the following
> paragraph in section 6.4.1 (XPATH context) in RFC6020bis:
> 
>'If a node that exists in the accessible tree has a non-presence
>container as a child, then the non-presence container also exists in
>the tree.'
> 
> It's unclear to me what this is trying to say, and why - for example,
> does this mean that I need to validate any 'must' and 'when'
> statements on the child container even when nothing within that child
> container is configured?

must expressions are always evaluated if the node where the must
expression is defined exists, regardless of the number of children
this node has.


/martin

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


[netmod] Clarification needed for YANG 1.1 XPATH context

2016-02-25 Thread William Ivory
Hi,

I'm looking for clarification on the meaning of the following paragraph in 
section 6.4.1 (XPATH context) in RFC6020bis:

   'If a node that exists in the accessible tree has a non-presence
   container as a child, then the non-presence container also exists in
   the tree.'

It's unclear to me what this is trying to say, and why - for example, does this 
mean that I need to validate any 'must' and 'when' statements on the child 
container even when nothing within that child container is configured?

Thanks,

William

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