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

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Wed, 01 April 2009 09:12 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
X-Original-To: uri-review@core3.amsl.com
Delivered-To: uri-review@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 6945A3A6BD6 for <uri-review@core3.amsl.com>; Wed, 1 Apr 2009 02:12:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.083
X-Spam-Level:
X-Spam-Status: No, score=-2.083 tagged_above=-999 required=5 tests=[AWL=0.166, BAYES_00=-2.599, HELO_EQ_DE=0.35]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HRAS52C-zBK0 for <uri-review@core3.amsl.com>; Wed, 1 Apr 2009 02:12:16 -0700 (PDT)
Received: from hermes.jacobs-university.de (hermes.jacobs-university.de [212.201.44.23]) by core3.amsl.com (Postfix) with ESMTP id 0C8D73A6B80 for <uri-review@ietf.org>; Wed, 1 Apr 2009 02:12:16 -0700 (PDT)
Received: from localhost (demetrius3.jacobs-university.de [212.201.44.48]) by hermes.jacobs-university.de (Postfix) with ESMTP id A1793C0053; Wed, 1 Apr 2009 11:13:15 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius3.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id TXaLI-pCAr7j; Wed, 1 Apr 2009 11:13:14 +0200 (CEST)
Received: from elstar.local (elstar.iuhb02.iu-bremen.de [10.50.231.133]) by hermes.jacobs-university.de (Postfix) with ESMTP id 4753DC000A; Wed, 1 Apr 2009 11:13:14 +0200 (CEST)
Received: by elstar.local (Postfix, from userid 501) id 97766A494FC; Wed, 1 Apr 2009 11:12:57 +0200 (CEST)
Date: Wed, 01 Apr 2009 11:12:57 +0200
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: uri-review@ietf.org
Message-ID: <20090401091257.GC15362@elstar.local>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
User-Agent: Mutt/1.5.19 (2009-01-05)
X-Mailman-Approved-At: Wed, 01 Apr 2009 02:47:30 -0700
Cc: Martin Bjorklund <mbj@tail-f.com>, David Partain <david@partain.se>
Subject: [Uri-review] review requested for the YANG definition of a URI datatype
X-BeenThere: uri-review@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
List-Id: Proposed URI Schemes <uri-review.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/uri-review>, <mailto:uri-review-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/uri-review>
List-Post: <mailto:uri-review@ietf.org>
List-Help: <mailto:uri-review-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/uri-review>, <mailto:uri-review-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 01 Apr 2009 09:12:17 -0000

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