Subject: [netmod] derived-from

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 04 Nov 2013 15:48:21 -0800

Hi,

considering possible uses of the proposed XPath function yangxp:derived-from, I am leaning towards a conclusion that the irreflexibity property of identity derivation (stated explicitly in erratum #3470 to RFC 6020) is highly problematic.

An example using the routing module: assume somebody develops a new route filtering framework "foo" and defines a new identity “foo” for it (its base identity is “route-filter”). The definition of config data then should go like this:

augment "/rt:routing/rt:route-filters/rt:route-filter" {
    when "...";
    ...
}

Now, the question is what the XPath expression in "when" should be, in order to make the new data nodes valid only for route filters of type "foo" or any identity derived from foo:

- If it is "rt:type = 'foo:foo'", then it won't work for route filters that are derived from "foo", and, moreover, we still have the problem with XPath string comparison.

- If it is "derived-from(type,"foo","foo") then it won't work even for "foo", because of irreflexivity.

IMO, identities would be much more useful if the derivation relation had these properties:

1. partial ordering = reflexive, anti-symmetric and transitive;

2. multiple inheritance, i.e. an identity definition can specify one or more bases.

This seems like another item in YANG 2.0 wishlist.

Lada

-- 
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C