Discussion:
ABNF for URN
(too old to reply)
Generic Usenet Account
2011-04-06 23:25:08 UTC
Permalink
Hello,

I have arrived at the following ABNF for URN by combining RFC 2141 and
RFC 5234. Can someone kindly let me know whether I got it right?

Thanks,
Gus

----------------------------------------------------------------------------------------------------------------------------------------------


URN = "urn:" NID ":" NSS
NID = LET-NUM [ 1*31LET-NUM-HYP ]
LET-NUM-HYP = UPPER / LOWER / NUMBER / "-"
LET-NUM = UPPER / LOWER / NUMBER
UPPER = "A" / "B" / "C" / "D" / "E" / "F" / "G" / "H" /
"I" / "J" / "K" / "L" / "M" / "N" / "O" / "P" /
"Q" / "R" / "S" / "T" / "U" / "V" / "W" / "X" /
"Y" / "Z"
LOWER = "a" / "b" / "c" / "d" / "e" / "f" / "g" / "h" /
"i" / "j" / "k" / "l" / "m" / "n" / "o" / "p" /
"q" / "r" / "s" / "t" / "u" / "v" / "w" / "x" /
"y" / "z"
NUMBER = "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7" /
"8" / "9"
NSS = 1*URNchars
URNchars = TRANS / "%" HEX HEX
TRANS = UPPER / LOWER / NUMBER / other / reserved
HEX = NUMBER / "A" / "B" / "C" / "D" / "E" / "F" /
"a" / "b" / "c" / "d" / "e" / "f"
other = "(" / ")" / "+" / "," / "-" / "." /
":" / "=" / "@" / ";" / "$" /
"_" / "!" / "*" / "'"
Generic Usenet Account
2011-04-07 04:59:28 UTC
Permalink
Post by Generic Usenet Account
Hello,
I have arrived at the following ABNF for URN by combining RFC 2141 and
RFC 5234.  Can someone kindly let me know whether I got it right?
Thanks,
Gus
The ABNF spec RFC 5234 seems to define only the following "Core
Rules". Are these adequate?

ALPHA = %x41-5A / %x61-7A ; A-Z / a-z

BIT = "0" / "1"

CHAR = %x01-7F
; any 7-bit US-ASCII character,
; excluding NUL

CR = %x0D
; carriage return

CRLF = CR LF
; Internet standard newline

CTL = %x00-1F / %x7F
; controls

DIGIT = %x30-39
; 0-9

DQUOTE = %x22
; " (Double Quote)

HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"

HTAB = %x09
; horizontal tab

LF = %x0A
; linefeed

LWSP = *(WSP / CRLF WSP)
; Use of this linear-white-space rule
; permits lines containing only white
; space that are no longer legal in
; mail headers and have caused
; interoperability problems in other
; contexts.
; Do not use when defining mail
; headers and use with caution in
; other contexts.

OCTET = %x00-FF
; 8 bits of data

SP = %x20

VCHAR = %x21-7E
; visible (printing) characters

WSP = SP / HTAB
; white space
Generic Usenet Account
2011-04-08 04:34:30 UTC
Permalink
Post by Generic Usenet Account
Hello,
I have arrived at the following ABNF for URN by combining RFC 2141 and
RFC 5234.  Can someone kindly let me know whether I got it right?
Thanks,
Gus
Here's the complete ABNF. Apologies for the previous posting, which
had some omissions:
URN = "urn:" NID ":" NSS
; Always starts with the string "urn:"

NID = LET-NUM [ 1*31LET-NUM-HYP ]
; Max length 31

LET-NUM-HYP = UPPER / LOWER / NUMBER / "-"

LET-NUM = UPPER / LOWER / NUMBER

UPPER = "A" / "B" / "C" / "D" / "E" / "F" / "G" / "H" /
"I" / "J" / "K" / "L" / "M" / "N" / "O" / "P" /
"Q" / "R" / "S" / "T" / "U" / "V" / "W" / "X" /
"Y" / "Z"

LOWER = "a" / "b" / "c" / "d" / "e" / "f" / "g" / "h" /
"i" / "j" / "k" / "l" / "m" / "n" / "o" / "p" /
"q" / "r" / "s" / "t" / "u" / "v" / "w" / "x" /
"y" / "z"

NUMBER = "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7" /
"8" / "9"

NSS = 1*URNchars

URNchars = TRANS / "%" HEX HEX

TRANS = UPPER / LOWER / NUMBER / OTHER / RESERVED

HEX = NUMBER / "A" / "B" / "C" / "D" / "E" / "F" /
"a" / "b" / "c" / "d" / "e" / "f"

OTHER = "(" / ")" / "+" / "," / "-" / "." /
":" / "=" / "@" / ";" / "$" /
"_" / "!" / "*" / "'"

RESERVED = '%" / "/" / "?" / "#"

Loading...