Internet-Draft Ryan Moats draft-ietf-urn-ietf-06.txt AT&T Expires in six months June 1998 A URN Namespace for IETF Documents Filename: draft-ietf-urn-ietf-06.txt Status of This Memo This document is an Internet-Draft. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet- Drafts as reference material or to cite them other than as ``work in progress.'' To learn the current status of any Internet-Draft, please check the ``1id-abstracts.txt'' listing contained in the Internet- Drafts Shadow Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or ftp.isi.edu (US West Coast). Abstract A system for Uniform Resource Names (URNs) must be capable of supporting new naming systems. As an example of proposing a new namespace, this document proposes the 'ietf' namespace. This namespace consists of the RFC family of documents (RFCs, STDs, FYIs, and BCPs) developed by the IETF and published by the RFC editor and the minutes of working groups (WG) and birds of a feather (BOF) meetings that occur during IETF conferences. Both the current URN framework and URN syntax support this namespace. 0.1 Changes from -02 This document has been restructured to use the template proposed in draft-ietf-urn-nid-req-03.txt. Example Perl scripts for resolving this namespace have been supplied in an Appendix. Expires 12/31/98 [Page 1] INTERNET DRAFT A URN Namespace for IETF Documents June 1998 0.2 Changes from -03 Text was added to the template clarifying persistence and uniqueness. Support for the BCP document series added to the examples and the ABNF. 0.3 Changes from -04 More clarifications for the persistence section. In addition, cleaned up some typos and ensured that the Appendix examples are functional 0.4 Changes from -05 Based on a number of requests, i-ds have been added to the structure and resolvers. In addition, some examples have been added. 1. Introduction This document proposes the "ietf" namespace, which consists of the RFC family of documents (RFCs, STDs, FYIs, and BCPs) developed by the IETF and published by the RFC editor and the minutes of working groups (WG) and birds of a feather (BOF) meetings that occur during IETF conferences. The namespace specification is for a formal namespace. 2. Specification Template Namespace ID: "ietf" requested. Declared registrant of the namespace: Ryan Moats jayhawk@att.com Declaration of structure: The identifier has the following ABNF [2] specification: NSS = (family ":" number) / ("mtg-" number "-" wgbofname) ( "id:" name) family = "rfc" / "std" / "fyi" / "bcp" number = 1*DIGIT wgbofname = 1*LETDIGIT name = id draft designation with "draft-" and trailing Expires 12/31/98 [Page 2] INTERNET DRAFT A URN Namespace for IETF Documents June 1998 type removed (e.g. ietf-urn-ietf-06) LETDIGIT = DIGIT / %x41-%x5a / %x61-%x7a DIGIT = %x30-%x39 If the IESG (or it successor) adds a new document series, this ABNF specification will need to be updated. Further, if a working group or BOF is created that used characters outside the range of this ABNF specification, this specification will need to be updated. Any system intended to resolve names for this namespace should be written with the awareness that this could occur at any time. Identifier uniqueness considerations: Because the rfc-editor assigns the RFC number uniquely these URNs are unique. Since the mapping between RFCs and other rfc-editor document series (STDs, FYIs or BCPs) is not necessarily one-to-one, uniqueness of STDs, FYIs and BCPs are defined based on the document mappings maintained by the RFC Editor (the index files "rfc-index.txt", "fyi-index.txt", "bcp-index.txt", "std-index.txt") are defined to be the definitive statement of the assignment of RFC Family URNs in this namespace. The meeting minutes portion of the namespace is guaranteed unique because the URN includes the sequence number of the IETF conference. The document mapping maintained by the Internet Drafts editor ("1id-abstracts.txt") is defined as the definitive statement of the assignment of URNs for the internet draft portion of this namespace. Identifier persistence considerations: Persistence of the URNs of this namespace is independent of the mutability of the underlying documents. A URN once assigned will never be reassigned to a different resource; the assignment is persistent and immutable. Distinct from this, the resources identified as RFCs are immutable, whereas the other sorts of documents, STDs, FYIs, and BCPs are not. They may be composites of one or more RFCs and the set of RFCs that comprise them may change with time. It is important to note that this mutability of some resources is independent of the immutability of URN assignment to a resource. Process of identifier assignment: Expires 12/31/98 [Page 3] INTERNET DRAFT A URN Namespace for IETF Documents June 1998 Assignment of URNs from this namespace occurs in two ways. The first is when a new RFC, FYI, STD or BCP is passed by the IESG and published by the RFC Editor. This new document will have a new series number and will therefore define a new URN. The document mappings maintained by the RFC Editor (the index files "rfc-index.txt", "fyi-index.txt", "bcp-index.txt" and "std-index.txt") are defined to be the definitive statement of the assignment of RFC Family URNs in this namespace. The second way a URN is assigned is when a working group or birds of a feather files meeting minutes as part of an IETF conference. The list of minutes maintained by the IETF for each working group and conference in the subtree pointed at by the URL ftp://ietf.org/ietf/ is considered the definitive assignment of URNs for working group or birds of a feather minutes. The third way a URN is assigned is through the publication of a new internet-draft by the Internet Draft Editor. This draft will have a distinct name (and version number) and therefore defined a new URN. The document mapping maintained by the Internet Drafts editor ("1id-abstracts.txt") is defined as the definitive statement of the assignment of URNs for this portion of the namespace. Process of identifier resolution: A mirrored copy of the underlying documentation is required to resolve these URNs. Resolution via HTTP is accomplished by a set of simple Perl cgi-bin scripts presented in Appendix A. Rules for Lexical Equivalence: The entire URN is case-insensitive. Conformance with URN Syntax: There are no additional characters reserved. Validation mechanism: None specified. Expires 12/31/98 [Page 4] INTERNET DRAFT A URN Namespace for IETF Documents June 1998 Scope: Global. 3. Examples The following are examples of URNs that a resolver for this namespace can resolve: urn:ietf:rfc:2141 urn:ietf:std:50 urn:ietf:id:ietf-urn-ietf-06.txt urn:ietf:mtg-41-urn 4. Security Considerations Because this namespace defines no additional reserved characters, it does not add any security considerations beyond those inherent from the existence of the reserved characters from [1]. Further, none of the reserved characters from [1] are used in the definition of the NSS. This means that resolvers for this namespace may be considered "secure" in the sense that any escaping of characters in the NSS MUST result in the resolver indicating that the URN has incorrect syntax. 5. Acknowledgments Thanks to various members of the URN working group for comments on earlier drafts of this document. The work described in this document is partially supported by the National Science Foundation, Cooperative Agreement NCR-9218179. 6. References Request For Comments (RFC) and Internet Draft documents are available from and numerous mirror sites. [1] R. Moats, "URN Syntax," RFC 2141, May 5, 1997. [2] D. Crocker, P. Overell, "Augmented BNF for Syntax Specifications: ABNF," RFC 2234, November 1997. 7. Author's Address Ryan Moats AT&T 15621 Drexel Circle Omaha, NE 68135-2358 Expires 12/31/98 [Page 5] INTERNET DRAFT A URN Namespace for IETF Documents June 1998 USA Phone: +1 402 894-9456 EMail: jayhawk@att.com Appendix A. Example Resolution Scripts The following scripts are examples that can be used for resolving URNs in this namespace. A.1 I2C #!/usr/local/bin/perl use strict; # # this is a URN 2 URC resolver for the ietf namespace # my(%cite) = ( bcp => "/ftp/rfc/bcp-index.txt", fyi => "/ftp/fyi/fyi-index.txt", id => "/ftp/internet-drafts/1id-abstracts.txt", rfc => "/ftp/rfc/rfc-index.txt", std => "/ftp/std/std-index.txt" ); my(%number2date) = ( 41 => "98apr", 40 => "97dec", 39 => "97aug", 38 => "97apr", 37 => "96dec", 36 => "96jun", 35 => "96mar", 34 => "95dec", 33 => "95jul", 32 => "95apr", 31 => "94dec", 30 => "94jul", 29 => "94mar", 28 => "93nov", 27 => "93jul", 26 => "93mar", 25 => "92nov", 24 => "92jul", 23 => "92mar", 22 => "91nov", 21 => "91jul", 20 => "91mar", 19 => "90dec" ); my($wgpath) = "/ftp/ietf"; my($urn) = $ENV{'QUERY_STRING'}; my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header (&resolveid($1), exit) if ($urn =~ /urn:ietf:id:(i); (&resolverfc($1, $2), exit) if ($urn =~ /urn:ietf:(72)/i); (&resolvemtg($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(9*)-( 120&urn_error("400 Bad Request0); Expires 12/31/98 [Page 6] INTERNET DRAFT A URN Namespace for IETF Documents June 1998 sub resolvemtg { my($ietfnum, $sesnam) = @_; &urn_error("404 Not Found0) if (!defined $number2date{$ietfnum}); my($date)=$number2date{$ietfnum}; my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; if (-f $link) { print "Status: 200 OK70; print "Content-type: text/html70; print "0TITLE>Citation for $urn0; print "0; print "

0/HTML>0; return; } my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; if (-f $link) { print "Status: 200 OK70; print "Content-type: text/html70; print "0TITLE>Citation for $urn0; print "0; print "

0/HTML>0; return; } &urn_error("404 Not Found0); } sub end { my($inarg)=@_; return $inarg . "st" if ($inarg =~ /1$/); return $inarg . "nd" if ($inarg =~ /2$/); return $inarg . "rd" if ($inarg =~ /3$/); return $inarg . "th"; } sub resolverfc { my($flag,@bib,$i,$k,$j,$done,@ref); my($l,$link); my($scheme, $value) = @_; $scheme =~ tr/A-Z/a-z/; if (!defined $cite{$scheme}) { &urn_error("404 Not Found0); } $flag = 0; open(INPUT, "$cite{$scheme}"); Expires 12/31/98 [Page 7] INTERNET DRAFT A URN Namespace for IETF Documents June 1998 while () { $flag = 1 if (/^0*$value /); if ($flag == 1) { last if (/^$/); chop; push @bib,$_; } } if ($scheme ne "rfc") { print "Status: 200 OK70; print "Content-type: text/html70; $bib[0] =~ s/^[0-9]*//; for ($i=0; $i<=$#bib; $i+=1) { last if ($bib[$i] =~ s/././); } for ($i=0;$i<=$#bib;$i+=1) { $k=$bib[$i]; while ($k =~ /(fyi|std|rfc|bcp)([0-9]+)(.*)/i) { push @ref,"$1$2"; $k=$3; } $done=""; foreach $j (@ref) { next if ($done =~ $j); $done .= "$j "; $l = $j; $l =~ tr/A-Z/a-z/; $link=&make_link("$l"); $bib[$i] =~ s/$j/$j/g; } } print "0TITLE>Citation for $urn0; print "0; $link=&make_link("$scheme$value"); print "

0/HTML>0; } else { print "Status: 200 OK70; print "Content-type: text/html70; $bib[0] =~ s/^[0-9]*//; $j=0; for ($i=0; $i<=$#bib; $i+=1) { $j += ($bib[$i] =~ s/, "/, "/); $j += ($bib[$i] =~ s/",/",/); Expires 12/31/98 [Page 8] INTERNET DRAFT A URN Namespace for IETF Documents June 1998 } for ($i=0;$i<=$#bib;$i+=1) { $k=$bib[$i]; while ($k =~ /(fyistdrfc|bcp)([0-9]+)(.*)/i) { push @ref,"$1$2"; $k=$3; } $done=""; foreach $j (@ref) { next if ($done =~ $j); $done .= "$j "; $l = $j; $l =~ s//g; $l =~ tr/A-Z/a-z/; $link=&make_link("$l"); $bib[$i] =~ s/$j/$j/g; } } print "0TITLE>Citation for $urn0; print "0; $link=&make_link("$scheme$value"); print "

0/HTML>0; } } sub make_link { my($sc); my($inarg)=@_; ($sc=$1) if ($inarg =~ /([a-z]*)/); return "/$sc/$inarg.ps" if (-e "/ftp/$sc/$inarg.ps"); return "/$sc/$inarg.html" if (-e "/ftp/$sc/$inarg.html"); return "/$sc/$inarg.txt"; } sub urn_error { my($code) = @_; #store failure code here... print "Status: $code"; print "Content-type: text/html0HTML>0; print "URN Resolution: I2C $code0; print "0; print "

URN to URC resolution failed for the URN:

0; print "

$urn

0; print "0; Expires 12/31/98 [Page 9] INTERNET DRAFT A URN Namespace for IETF Documents June 1998 print "0; exit; }; sub resolveid { my($flag,@bib,$i,$k,$j,$count,@ref); my($l,$link, $hdr, $done); my($value) = @_; my($scheme) = "id"; open(INPUT, "$cite{$scheme}"); while () { # # capture record # if ($flag == 1 || /^ push @bib,$_; ($hdr = -1, $count = 0, $flag = 1) if (/^ $count++ if (/^/); } if ($count == 1) { $hdr = $#bib if ($hdr == -1); } if ($count == 2) { for ($i=0; $i<=$hdr; $i+=1) { if ($bib[$i] =~ /<(.*)>/) { $l = $1; if ($l eq "draft-$value.txt" || $l eq "draft-$value.ps") { print "Status: 200 OK70; print "Content-type: text/html70; print "0TITLE>Citation for $urn0; print "0; print "
0; foreach $i (@bib) { print "$i"; } print "0; print "0/HTML>0; exit; } } } $flag = 0; @bib = (); } } &urn_error("404 Not Found0); Expires 12/31/98 [Page 10] INTERNET DRAFT A URN Namespace for IETF Documents June 1998 } A.2 I2L #!/usr/local/bin/perl use strict; # # this is a URN 2 URL resolver for the ietf namespace # my(%pathbase) = ( rfc => "rfc/rfc", fyi => "fyi/fyi", std => "std/std", bcp => "bcp/bcp", id => "internet-drafts/draft-", ); my(%number2date) = ( 41 => "98apr", 40 => "97dec", 39 => "97aug", 38 => "97apr", 37 => "96dec", 36 => "96jun", 35 => "96mar", 34 => "95dec", 33 => "95jul", 32 => "95apr", 31 => "94dec", 30 => "94jul", 29 => "94mar", 28 => "93nov", 27 => "93jul", 26 => "93mar", 25 => "92nov", 24 => "92jul", 23 => "92mar", 22 => "91nov", 21 => "91jul", 20 => "91mar", 19 => "90dec" ); my($wgpath) = "/ftp/ietf"; my($urn) = $ENV{'QUERY_STRING'}; my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header (&resolveid($1), exit) if ($urn =~ /urn:ietf:id:(i); (&resolverfc($1, $2), exit) if ($urn =~ /urn:ietf:(72)/i); (&resolvemtg($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(9*)-( 120&urn_error("400 Bad Request0); sub resolvemtg { my($ietfnum, $sesnam) = @_; &urn_error("404 Not Found0) if (!defined $number2date{$ietfnum}); my($date)=$number2date{$ietfnum}; my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; if (-f $link) { print "Status: 302 Moved temporarily0; Expires 12/31/98 [Page 11] INTERNET DRAFT A URN Namespace for IETF Documents June 1998 print "Location: $link0; return; } my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; if (-f $link) { print "Status: 302 Moved temporarily0; print "Location: $link0; return; } &urn_error("404 Not Found0); } sub end { my($inarg)=@_; return $inarg . "st" if ($inarg =~ /1$/); return $inarg . "nd" if ($inarg =~ /2$/); return $inarg . "rd" if ($inarg =~ /3$/); return $inarg . "th"; } sub resolverfc { my($flag,@bib,$i,$k,$j,$done,@ref); my($l,$link); my($scheme, $value) = @_; $scheme =~ tr/A-Z/a-z/; &urn_error("404 Not Found0)if (!defined $pathbase{$scheme}); my($txttry)="/ftp/$pathbase{$scheme}$value.txt"; my($pstry)="/ftp/$pathbase{$scheme}$value.ps"; my($htmltry)="/ftp/$pathbase{$scheme}$value.html"; MIME_SWITCH: { if ($accept =~ /application/postscript/ && -f $pstry) { print "Status: 302 Moved temporarily0; print "Location: http://$host/$pathbase{$scheme}$value.ps0; last MIME_SWITCH; } if ($accept =~ /text/html/ && -f $htmltry) { print "Status: 302 Moved temporarily0; print "Location: http://$host/$pathbase{$scheme}$value.html0; last MIME_SWITCH; } if ($accept =~ /text/plain/ && -f $txttry) { print "Status: 302 Moved temporarily0; print "Location: http://$host/$pathbase{$scheme}$value.txt0; last MIME_SWITCH; } &urn_error("404 Not Found0); } } Expires 12/31/98 [Page 12] INTERNET DRAFT A URN Namespace for IETF Documents June 1998 sub urn_error { my($code) = @_; #store failure code here... print "Status: $code"; print "Content-type: text/html0HTML>0; print "URN Resolution: I2L $code0; print "0; print "

URN to URL resolution failed for the URN:

0; print "

$urn

0; print "0; print "0; exit; } sub resolveid { my($flag,@bib,$i,$k,$j,$done,@ref); my($l,$link); my($scheme) = "id"; my($value) = @_; $scheme =~ tr/A-Z/a-z/; &urn_error("404 Not Found0)if (!defined $pathbase{$scheme}); my($txttry)="/ftp/$pathbase{$scheme}$value.txt"; my($pstry)="/ftp/$pathbase{$scheme}$value.ps"; my($htmltry)="/ftp/$pathbase{$scheme}$value.html"; MIME_SWITCH: { if ($accept =~ /application/postscript/ && -f $pstry) { print "Status: 302 Moved temporarily0; print "Location: http://$host/$pathbase{$scheme}$value.ps0; last MIME_SWITCH; } if ($accept =~ /text/html/ && -f $htmltry) { print "Status: 302 Moved temporarily0; print "Location: http://$host/$pathbase{$scheme}$value.html0; last MIME_SWITCH; } if ($accept =~ /text/plain/ && -f $txttry) { print "Status: 302 Moved temporarily0; print "Location: http://$host/$pathbase{$scheme}$value.txt0; last MIME_SWITCH; } &urn_error("404 Not Found0); } } A.3 I2Ls #!/usr/local/bin/perl Expires 12/31/98 [Page 13] INTERNET DRAFT A URN Namespace for IETF Documents June 1998 use strict; # # this is a URN 2 URLs resolver for the ietf namespace # my(@urls); my(%pathbase) = ( rfc => "rfc/rfc", fyi => "fyi/fyi", std => "std/std", bcp => "bcp/bcp", id => "internet-drafts/draft-" ); my(%number2date) = ( 41 => "98apr", 40 => "97dec", 39 => "97aug", 38 => "97apr", 37 => "96dec", 36 => "96jun", 35 => "96mar", 34 => "95dec", 33 => "95jul", 32 => "95apr", 31 => "94dec", 30 => "94jul", 29 => "94mar", 28 => "93nov", 27 => "93jul", 26 => "93mar", 25 => "92nov", 24 => "92jul", 23 => "92mar", 22 => "91nov", 21 => "91jul", 20 => "91mar", 19 => "90dec" ); my($wgpath) = "/ftp/ietf"; my($urn) = $ENV{'QUERY_STRING'}; my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header (&resolveid($1), exit) if ($urn =~ /urn:ietf:id:(i); (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(72)/i); (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(9*)-( 120&urn_error("400 Bad Request0); sub resolve2 { my($ietfnum, $sesnam) = @_; &urn_error("404 Not Found0) if (!defined $number2date{$ietfnum}); my($date)=$number2date{$ietfnum}; my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; if (-f $link) { $link=~s/^/ftp///; my($ftplink)="ftp://$host/$link"; my($httplink)="http://$host/$link"; my($glink)="gopher://$host:70/0/$link"; if ($accept =~ /text/uri-list/) { #look for text/uri-list, otherwise text/html Expires 12/31/98 [Page 14] INTERNET DRAFT A URN Namespace for IETF Documents June 1998 print "Status: 200 OK0; print "Content-type: text/uri-list0; print "#$urn0; print "$ftplink0; print "$httplink0; print "$glink0; } if ($accept =~ /text/html/) { print "Status: 200 OK0; print "Content-type: text/html0HTML>0; print "URN Resolution: I2Ls0; print "0; print "

URN $urn resolves to the following URLs:

0; print "