Subject: [Uri-review] review requested for the YANG definition of a URI datatype

From: Juergen Schoenwaelder <[email-masked]>
Date: Wed, 1 Apr 2009 11:12:57 +0200

Hi,

I am editor of a document defining among other things a URI data type
for the YANG data modeling language (NETMOD working group). Right now,
our definition looks as follows (<draft-ietf-netmod-yang-types-02>):

   typedef uri {
     type string;    // [TODO] add the regex from RFC 3986 here?
     description
      "The uri type represents a Uniform Resource Identifier
       (URI) as defined by STD 66.

       Objects using the uri type must be in US-ASCII encoding,
       and MUST be normalized as described by RFC 3986 Sections
       6.2.1, 6.2.2.1, and 6.2.2.2.  All unnecessary
       percent-encoding is removed, and all case-insensitive
       characters are set to lowercase except for hexadecimal
       digits, which are normalized to uppercase as described in
       Section 6.2.2.1.

       The purpose of this normalization is to help provide
       unique URIs.  Note that this normalization is not
       sufficient to provide uniqueness.  Two URIs that are
       textually distinct after this normalization may still be
       equivalent.

       Objects using the uri type may restrict the schemes that
       they permit.  For example, 'data:' and 'urn:' schemes
       might not be appropriate.

       A zero-length URI is not a valid URI.  This can be used to
       express 'URI absent' where required

       This type is in the value set and its semantics equivalent
       to the Uri textual convention of the SMIv2.";
     reference
      "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
       RFC 3305: Report from the Joint W3C/IETF URI Planning Interest
                 Group: Uniform Resource Identifiers (URIs), URLs,
                 and Uniform Resource Names (URNs): Clarifications
                 and Recommendations
       RFC 5017: MIB Textual Conventions for Uniform Resource
                 Identifiers (URIs)";
   }

One particular question is whether it is safe to add the following
pattern restriction (XSD regular expression syntax):

  type string {
    pattern '(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?';
  }

The regular expression is taken from appendix B of RFC 3986.

/js

-- 
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/>

---

From: "Martin J. Dürst" <[email-masked]>
Date: Thu, 02 Apr 2009 11:20:26 +0900

Hello Juergen,

I think this is a question about generic URI syntax, and therefore
should go to [email-masked] (which I have cc'ed).

Did you also consider having a datatype for IRIs?

Regards,    Martin.

P.S.: Please remove [email-masked] from the cc list when replying.

-- 
#-# Martin J.Dürst, Professor, Aoyama Gakuin University
#-# http://www.sw.it.aoyama.ac.jp   mailto:[email-masked]

---

From: Larry Masinter <[email-masked]>
Date: Wed, 1 Apr 2009 20:48:28 -0700

I'm not sure that "necessary" percent encoding is well defined

Sent from my iPhone