On Tue, Apr 19, 2016 at 09:37:03PM +0200, Martin Bjorklund wrote:
> Juergen Schoenwaelder <[email protected]> wrote:
> > 
> > The namespace definition is used by the XML encoding, the JSON
> > encoding uses the YANG module name to identify a 'namespace'. The
> > module name generally is assumed to be unique since tools (e.g., YANG
> > compilers) import via module names. A urn:yang:<modulename> would have
> > the advantage to integrate things. In fact, the namespace statement in
> > YANG could become optional, if one does not define a namespace, then
> > the default namespace is urn:yang:<modulename> (and this would enable
> > round-trip conversion of namespaces between XML and JSON encoding,
> > something I always found a valuable property.)
> > 
> > Anyway, it would be good to hear opinions of other people.
> 
> I can see the value in a urn:rdns: URN.  Using 'http://' for YANG
> module namespace is a bit weird.  Why not 'https://'?  Or 'gopher://'?

The point is it does not matter. In some theory, the idea is that the
URL resolves to something useful but in practice this does not matter.
 
> But I like urn:yang:<module-name> even more - and if we had this, we
> wouldn't have to use the "namespace" statement.  Unfortunately that
> would require a new version of YANG...

I think we should try to move into a direction that makes things
simpler and more consistent in the longer term. It is too late to
address this in YANG 1.1 but clearly if I would have had this idea
earlier I would have filed an issue. The urn:yang:<module-name> makes
it clear that

- we are talking about YANG URNs and
- it forces people to think carefully about their module names.

Even the IETF could in principle move to a scheme where we use

  module ietf-foo {
    version 1.1;
    namespace "urn:yang:ietf-foo";
    // ...
  }

and future versions of YANG may then even drop the namespace
definition if it matches the module name, e.g., the example
becomes just this:

  module ietf-foo {
    version 1.2;
    // ...
  }

(The XML encoding specific namespace definition is removed.)

/js

PS: In hindsight, perhaps we should have used reverse DNS names for
    module name prefixes, i.e., org-ietf-foo instead of just ietf-foo
    and so we would have a reasonably reliable mechanism in place to
    create unique names for both SDOs and other organizations.

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>

_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to