Subject: [netmod] instance-identifier ABNF broken

From: Andy Bierman <[email-masked]>
Date: Wed, 25 Feb 2009 02:31:20 -0800

Hi,

The instance-identifier syntax does not allow for
positional entries (/foo[3]).  This is needed for
lists without any keys.  The only way to specify
such a node is by its relative position.

Andy

---

From: WashamFan <[email-masked]>
Date: Thu, 26 Feb 2009 14:46:54 +0800

>  such a node is by its relative position.

How come lists without any keys? 
Look at para2, sec 7.8:

  "A list entry is uniquely identified by the values of 
   the list's keys."

Am I missing something?

washam

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 26 Feb 2009 09:00:50 +0100 (CET)

>   "A list entry is uniquely identified by the values of 

YANG allows you to define lists without keys, see 7.8

  The "key" statement, which MUST be present if the list represents
  configuration, and MAY be present otherwise,

But I'm not sure if the modification Andy proposed should be added,
esp. not in the light of the ordering / positional mail thread.  Maybe
it is ok to limit this type to instances that *can* be identified by
name?  (All config instances can be identified by name).

/martin

---

From: Andy Bierman <[email-masked]>
Date: Thu, 26 Feb 2009 02:49:54 -0800

> name?  (All config instances can be identified by name).

Every single node in a NETCONF PDU or a NETCONF database
needs to be identified for select, error-path, and must/when
expressions.  The only way to tell 2 list entries apart
(if they do not have keys) is by their relative position.

There is no danger in the agent generating relative expressions
for error-path (for example).  The netconf-state DM has a
read-only list without a key.
E.g., /netconf/configurations/configuration[1]/name is
the only way to specify the 'name' field in an instance-identifier.

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 26 Feb 2009 12:40:23 +0100 (CET)

> the only way to specify the 'name' field in an instance-identifier.

You're right.  I think think this will work:

instance-identifier    = 1*("/" (node-identifier *predicate))

predicate              = "[" *WSP (predicate-expr / pos) *WSP "]"

predicate-expr         = (node-identifier / ".") *WSP "=" *WSP
                         ((DQUOTE string DQUOTE) /
                          (SQUOTE string SQUOTE))

pos                    = non-negative-decimal-value)

/martin