home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / rfc / rfc2141 < prev    next >
Text File  |  1997-05-05  |  14KB  |  452 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                           R. Moats
  8. Request for Comments: 2141                                          AT&T
  9. Category: Standards Track                                       May 1997
  10.  
  11.  
  12.                                URN Syntax
  13.  
  14. Status of This Memo
  15.  
  16.    This document specifies an Internet standards track protocol for the
  17.    Internet community, and requests discussion and suggestions for
  18.    improvements.  Please refer to the current edition of the "Internet
  19.    Official Protocol Standards" (STD 1) for the standardization state
  20.    and status of this protocol.  Distribution of this memo is unlimited.
  21.  
  22. Abstract
  23.  
  24.    Uniform Resource Names (URNs) are intended to serve as persistent,
  25.    location-independent, resource identifiers. This document sets
  26.    forward the canonical syntax for URNs.  A discussion of both existing
  27.    legacy and new namespaces and requirements for URN presentation and
  28.    transmission are presented.  Finally, there is a discussion of URN
  29.    equivalence and how to determine it.
  30.  
  31. 1. Introduction
  32.  
  33.    Uniform Resource Names (URNs) are intended to serve as persistent,
  34.    location-independent, resource identifiers and are designed to make
  35.    it easy to map other namespaces (which share the properties of URNs)
  36.    into URN-space. Therefore, the URN syntax provides a means to encode
  37.    character data in a form that can be sent in existing protocols,
  38.    transcribed on most keyboards, etc.
  39.  
  40. 2. Syntax
  41.  
  42.    All URNs have the following syntax (phrases enclosed in quotes are
  43.    REQUIRED):
  44.  
  45.                      <URN> ::= "urn:" <NID> ":" <NSS>
  46.  
  47.    where <NID> is the Namespace Identifier, and <NSS> is the Namespace
  48.    Specific String.  The leading "urn:" sequence is case-insensitive.
  49.    The Namespace ID determines the _syntactic_ interpretation of the
  50.    Namespace Specific String (as discussed in [1]).
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. Moats                       Standards Track                     [Page 1]
  59.  
  60. RFC 2141                       URN Syntax                      May 1997
  61.  
  62.  
  63.    RFC 1630 [2] and RFC 1737 [3] each presents additional considerations
  64.    for URN encoding, which have implications as far as limiting syntax.
  65.    On the other hand, the requirement to support existing legacy naming
  66.    systems has the effect of broadening syntax.  Thus, we discuss the
  67.    acceptable syntax for both the Namespace Identifier and the Namespace
  68.    Specific String separately.
  69.  
  70. 2.1 Namespace Identifier Syntax
  71.  
  72.    The following is the syntax for the Namespace Identifier. To (a) be
  73.    consistent with all potential resolution schemes and (b) not put any
  74.    undue constraints on any potential resolution scheme, the syntax for
  75.    the Namespace Identifier is:
  76.  
  77.    <NID>         ::= <let-num> [ 1,31<let-num-hyp> ]
  78.  
  79.    <let-num-hyp> ::= <upper> | <lower> | <number> | "-"
  80.  
  81.    <let-num>     ::= <upper> | <lower> | <number>
  82.  
  83.    <upper>       ::= "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" |
  84.                      "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" |
  85.                      "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" |
  86.                      "Y" | "Z"
  87.  
  88.    <lower>       ::= "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" |
  89.                      "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" |
  90.                      "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" |
  91.                      "y" | "z"
  92.  
  93.    <number>      ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" |
  94.                      "8" | "9"
  95.  
  96.  
  97.    This is slightly more restrictive that what is stated in [4] (which
  98.    allows the characters "." and "+").  Further, the Namespace
  99.    Identifier is case insensitive, so that "ISBN" and "isbn" refer to
  100.    the same namespace.
  101.  
  102.    To avoid confusion with the "urn:" identifier, the NID "urn" is
  103.    reserved and MUST NOT be used.
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114. Moats                       Standards Track                     [Page 2]
  115.  
  116. RFC 2141                       URN Syntax                      May 1997
  117.  
  118.  
  119. 2.2 Namespace Specific String Syntax
  120.  
  121.    As required by RFC 1737, there is a single canonical representation
  122.    of the NSS portion of an URN.   The format of this single canonical
  123.    form follows:
  124.  
  125.    <NSS>         ::= 1*<URN chars>
  126.  
  127.    <URN chars>   ::= <trans> | "%" <hex> <hex>
  128.  
  129.    <trans>       ::= <upper> | <lower> | <number> | <other> | <reserved>
  130.  
  131.    <hex>         ::= <number> | "A" | "B" | "C" | "D" | "E" | "F" |
  132.                      "a" | "b" | "c" | "d" | "e" | "f"
  133.  
  134.    <other>       ::= "(" | ")" | "+" | "," | "-" | "." |
  135.                      ":" | "=" | "@" | ";" | "$" |
  136.                      "_" | "!" | "*" | "'"
  137.  
  138.    Depending on the rules governing a namespace, valid identifiers in a
  139.    namespace might contain characters that are not members of the URN
  140.    character set above (<URN chars>).  Such strings MUST be translated
  141.    into canonical NSS format before using them as protocol elements or
  142.    otherwise passing them on to other applications. Translation is done
  143.    by encoding each character outside the URN character set as a
  144.    sequence of one to six octets using UTF-8 encoding [5], and the
  145.    encoding of each of those octets as "%" followed by two characters
  146.    from the <hex> character set above. The two characters give the
  147.    hexadecimal representation of that octet.
  148.  
  149. 2.3 Reserved characters
  150.  
  151.    The remaining character set left to be discussed above is the
  152.    reserved character set, which contains various characters reserved
  153.    from normal use.  The reserved character set follows, with a
  154.    discussion on the specifics of why each character is reserved.
  155.  
  156.    The reserved character set is:
  157.  
  158.    <reserved>    ::= '%" | "/" | "?" | "#"
  159.  
  160. 2.3.1 The "%" character
  161.  
  162.    The "%" character is reserved in the URN syntax for introducing the
  163.    escape sequence for an octet.  Literal use of the "%" character in a
  164.    namespace must be encoded using "%25" in URNs for that namespace.
  165.    The presence of an "%" character in an URN MUST be followed by two
  166.    characters from the <hex> character set.
  167.  
  168.  
  169.  
  170. Moats                       Standards Track                     [Page 3]
  171.  
  172. RFC 2141                       URN Syntax                      May 1997
  173.  
  174.  
  175.    Namespaces MAY designate one or more characters from the URN
  176.    character set as having special meaning for that namespace.  If the
  177.    namespace also uses that character in a literal sense as well, the
  178.    character used in a literal sense MUST be encoded with "%" followed
  179.    by the hexadecimal representation of that octet.  Further, a
  180.    character MUST NOT be "%"-encoded if the character is not a reserved
  181.    character.  Therefore, the process of registering a namespace
  182.    identifier shall include publication of a definition of which
  183.    characters have a special meaning to that namespace.
  184.  
  185. 2.3.2 The other reserved characters
  186.  
  187.    RFC 1630 [2] reserves the characters "/", "?", and "#" for particular
  188.    purposes. The URN-WG has not yet debated the applicability and
  189.    precise semantics of those purposes as applied to URNs. Therefore,
  190.    these characters are RESERVED for future developments.  Namespace
  191.    developers SHOULD NOT use these characters in unencoded form, but
  192.    rather use the appropriate %-encoding for each character.
  193.  
  194. 2.4 Excluded characters
  195.  
  196.    The following list is included only for the sake of completeness.
  197.    Any octets/characters on this list are explicitly NOT part of the URN
  198.    character set, and if used in an URN, MUST be %encoded:
  199.  
  200.    <excluded> ::= octets 1-32 (1-20 hex) | "\" | """ | "&" | "<"
  201.                   | ">" | "[" | "]" | "^" | "`" | "{" | "|" | "}" | "~"
  202.                   | octets 127-255 (7F-FF hex)
  203.  
  204.    In addition, octet 0 (0 hex) should NEVER be used, in either
  205.    unencoded or %-encoded form.
  206.  
  207.    An URN ends when an octet/character from the excluded character set
  208.    (<excluded>) is encountered.  The character from the excluded
  209.    character set is NOT part of the URN.
  210.  
  211. 3. Support of existing legacy naming systems and new naming systems
  212.  
  213.    Any namespace (existing or newly-devised) that is proposed as an
  214.    URN-namespace and fulfills the criteria of URN-namespaces MUST be
  215.    expressed in this syntax.  If names in these namespaces contain
  216.    characters other than those defined for the URN character set, they
  217.    MUST be translated into canonical form as discussed in section 2.2.
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226. Moats                       Standards Track                     [Page 4]
  227.  
  228. RFC 2141                       URN Syntax                      May 1997
  229.  
  230.  
  231. 4. URN presentation and transport
  232.  
  233.    The URN syntax defines the canonical format for URNs and all URN
  234.    transport and interchanges MUST take place in this format. Further,
  235.    all URN-aware applications MUST offer the option of displaying URNs
  236.    in this canonical form to allow for direct transcription (for example
  237.    by cut and paste techniques).  Such applications MAY support display
  238.    of URNs in a more human-friendly form and may use a character set
  239.    that includes characters that aren't permitted in URN syntax as
  240.    defined in this RFC (that is, they may replace %-notation by
  241.    characters in some extended character set in display to humans).
  242.  
  243. 5. Lexical Equivalence in URNs
  244.  
  245.    For various purposes such as caching, it's often desirable to
  246.    determine if two URNs are the same without resolving them. The
  247.    general purpose means of doing so is by testing for "lexical
  248.    equivalence" as defined below.
  249.  
  250.    Two URNs are lexically equivalent if they are octet-by-octet equal
  251.    after the following preprocessing:
  252.  
  253.            1. normalize the case of the leading "urn:" token
  254.            2. normalize the case of the NID
  255.            3. normalizing the case of any %-escaping
  256.  
  257.    Note that %-escaping MUST NOT be removed.
  258.  
  259.    Some namespaces may define additional lexical equivalences, such as
  260.    case-insensitivity of the NSS (or parts thereof).  Additional lexical
  261.    equivalences MUST be documented as part of namespace registration,
  262.    MUST always have the effect of eliminating some of the false
  263.    negatives obtained by the procedure above, and MUST NEVER say that
  264.    two URNs are not equivalent if the procedure above says they are
  265.    equivalent.
  266.  
  267. 6. Examples of lexical equivalence
  268.  
  269.    The following URN comparisons highlight the lexical equivalence
  270.    definitions:
  271.  
  272.            1- URN:foo:a123,456
  273.            2- urn:foo:a123,456
  274.            3- urn:FOO:a123,456
  275.            4- urn:foo:A123,456
  276.            5- urn:foo:a123%2C456
  277.            6- URN:FOO:a123%2c456
  278.  
  279.  
  280.  
  281.  
  282. Moats                       Standards Track                     [Page 5]
  283.  
  284. RFC 2141                       URN Syntax                      May 1997
  285.  
  286.  
  287.    URNs 1, 2, and 3 are all lexically equivalent.  URN 4 is not
  288.    lexically equivalent any of the other URNs of the above set.  URNs 5
  289.    and 6 are only lexically equivalent to each other.
  290.  
  291. 7. Functional Equivalence in URNs
  292.  
  293.    Functional equivalence is determined by practice within a given
  294.    namespace and managed by resolvers for that namespeace. Thus, it is
  295.    beyond the scope of this document.  Namespace registration must
  296.    include guidance on how to determine functional equivalence for that
  297.    namespace, i.e. when two URNs are the identical within a namespace.
  298.  
  299. 8. Security considerations
  300.  
  301.    This document specifies the syntax for URNs.  While some namespaces
  302.    resolvers may assign special meaning to certain of the characters of
  303.    the Namespace Specific String, any security consideration resulting
  304.    from such assignment are outside the scope of this document.  It is
  305.    strongly recommended that the process of registering a namespace
  306.    identifier include any such considerations.
  307.  
  308. 9. Acknowledgments
  309.  
  310.    Thanks to various members of the URN working group for comments on
  311.    earlier drafts of this document.  This document is partially
  312.    supported by the National Science Foundation, Cooperative Agreement
  313.    NCR-9218179.
  314.  
  315. 10. References
  316.  
  317.    Request For Comments (RFC) and Internet Draft documents are available
  318.    from <URL:ftp://ftp.internic.net> and numerous mirror sites.
  319.  
  320.    [1]         Sollins, K. R., "Requirements and a Framework for
  321.                URN Resolution Systems," Work in Progress.
  322.  
  323.    [2]         Berners-Lee, T., "Universal Resource Identifiers in
  324.                WWW," RFC 1630, June 1994.
  325.  
  326.    [3]         Sollins, K. and L. Masinter,  "Functional Requirements
  327.                for Uniform Resource Names," RFC 1737.
  328.                December 1994.
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338. Moats                       Standards Track                     [Page 6]
  339.  
  340. RFC 2141                       URN Syntax                      May 1997
  341.  
  342.  
  343.    [4]         Berners-Lee, T., R. Fielding, L. Masinter, "Uniform
  344.                Resource Locators (URL),"  Work in Progress.
  345.  
  346.    [5]         Appendix A.2 of The Unicode Consortium, "The
  347.                Unicode Standard, Version 2.0", Addison-Wesley
  348.                Developers Press, 1996.  ISBN 0-201-48345-9.
  349.  
  350. 11. Editor's address
  351.  
  352.       Ryan Moats
  353.       AT&T
  354.       15621 Drexel Circle
  355.       Omaha, NE 68135-2358
  356.       USA
  357.  
  358.       Phone:  +1 402 894-9456
  359.       EMail:  jayhawk@ds.internic.net
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. Moats                       Standards Track                     [Page 7]
  395.  
  396. RFC 2141                       URN Syntax                      May 1997
  397.  
  398.  
  399. Appendix A. Handling of URNs by URL resolvers/browsers.
  400.  
  401.    The URN syntax has been defined so that URNs can be used in places
  402.    where URLs are expected.  A resolver that conforms to the current URL
  403.    syntax specification [3] will extract a scheme value of "urn:" rather
  404.    than a scheme value of "urn:<nid>".
  405.  
  406.    An URN MUST be considered an opaque URL by URL resolvers and passed
  407.    (with the "urn:" tag) to an URN resolver for resolution.  The URN
  408.    resolver can either be an external resolver that the URL resolver
  409.    knows of, or it can be functionality built-in to the URL resolver.
  410.  
  411.    To avoid confusion of users, an URL browser SHOULD display the
  412.    complete URN (including the "urn:" tag) to ensure that there is no
  413.    confusion between URN namespace identifiers and URL scheme
  414.    identifiers.
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450. Moats                       Standards Track                     [Page 8]
  451.  
  452.