Introduction

This page contains the proposed ABNF for XRI Syntax 3.0. The current XRI Syntax 2.0 ABNF is also provided for comparison. At the end of the page is a revision log in reverse chronological order.

Current Proposed ABNF for XRI Syntax 3.0 (Draft 19)

xri               = xri-hier-part [ "?" iquery ] [ "#" ifragment ]
xri-reference     = xri
                  / relative-xri-ref  
relative-xri-ref  = relative-xri-part [ "?" iquery ] [ "#" ifragment ]
relative-xri-part = xri-path-abs
                  / xri-path-noscheme
                  / ipath-empty
xri-hier-part     = xri-authority xri-path-abempty
xri-authority     = global-subseg *subseg
subseg            = global-subseg
                  / local-subseg
                  / xref
global-subseg     = gcs-char [ local-subseg / xref / literal ]
local-subseg      = lcs-char [ xref / literal ]
gcs-char          = "=" / "@" / "+" / "$"
lcs-char          = "*" / "!"
literal           = 1*xri-pchar
literal-nc        = 1*xri-pchar-nc
xref              = "(" [ xref-value ] ")"
xref-value        = xri-reference
                  / iri
xri-path          = xri-path-abempty
                  / xri-path-abs
                  / xri-path-noscheme
                  / ipath-empty
xri-path-abempty  = *( "/" xri-segment )
xri-path-abs      = "/" [ xri-segment-nz *( "/" xri-segment ) ]
xri-path-noscheme = xri-segment-nc *( "/" xri-segment )
xri-segment       = [ literal ] *subseg
xri-segment-nz    = ( literal / subseg ) *subseg
xri-segment-nc    = ( literal-nc / subseg ) *subseg
xri-pchar         = iunreserved / pct-encoded / xri-sub-delims / ":"
xri-pchar-nc      = iunreserved / pct-encoded / xri-sub-delims
xri-reserved      = xri-gen-delims / xri-sub-delims
xri-gen-delims    = ":" / "/" / "?" / "#" / "[" / "]" / "(" / ")"
                  / gcs-char / lcs-char
xri-sub-delims    = "&" / ";" / "," / "'"

Current ABNF for XRI Syntax 2.0

XRI ABNF

XRI               = [ "xri://" ] xri-hier-part [ "?" iquery ]
                  [ "#" ifragment ]  
xri-hier-part     = ( xri-authority / iauthority ) xri-path-abempty
XRI-reference     = XRI
                  / relative-XRI-ref  
absolute-XRI      = [ "xri://" ] xri-hier-part [ "?" iquery ]
relative-XRI-ref  = relative-XRI-part [ "?" iquery ] [ "#" ifragment ]
relative-XRI-part = xri-path-absolute
                  / xri-path-noscheme
                  / ipath-empty
xri-value         = xri-no-scheme / relative-XRI-ref
xri-no-scheme     = xri-hier-part [ "?" iquery ]
                  [ "#" ifragment ]  
xri-authority     = gcs-authority
                  / xref-authority
gcs-authority     = pgcs-authority / rgcs-authority
pgcs-authority    = "!" xri-subseg-pt-nz *xri-subseg
rgcs-authority    = rgcs-char xri-segment
rgcs-char         = "=" / "@" / "+" / "$" 
xref-authority    = xref *xri-subseg
xref              = "(" ( XRI-reference / IRI ) ")"
xri-path          = xri-path-abempty
                  / xri-path-absolute
                  / xri-path-noscheme
                  / ipath-empty  
xri-path-abempty  = *( "/" xri-segment )
xri-path-absolute = "/" [ xri-segment-nz *( "/" xri-segment ) ]
xri-path-noscheme = xri-subseg-od-nx *xri-subseg-nc *( "/" xri-segment )
xri-segment       = xri-subseg-od *xri-subseg
xri-segment-nz    = xri-subseg-od-nz *xri-subseg
xri-subseg        = ( "*" / "!" ) (xref / *xri-pchar)
xri-subseg-nc     = ( "*" / "!" ) (xref / *xri-pchar-nc)
xri-subseg-od     = [ "*" / "!" ] (xref / *xri-pchar)
xri-subseg-od-nz  = [ "*" / "!" ] (xref / 1*xri-pchar)
xri-subseg-od-nx  = [ "*" / "!" ] 1*xri-pchar-nc
xri-subseg-pt-nz  = "!" (xref / 1*xri-pchar)
xri-pchar         = iunreserved / pct-encoded / xri-sub-delims / ":"
xri-pchar-nc      = iunreserved / pct-encoded / xri-sub-delims
xri-reserved      = xri-gen-delims / xri-sub-delims
xri-gen-delims    = ":" / "/" / "?" / "#" / "[" / "]" / "(" / ")"
                  / "*" / "!" / rgcs-char
xri-sub-delims    = "&" / ";" / "," / "'"

IRI ABNF

Note: for reference only -- this is copied verbatim from the IRI specification, RFC 3987.

IRI               = scheme ":" ihier-part [ "?" iquery ]
                  [ "#" ifragment ]
scheme            = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
ihier-part        = "//" iauthority ipath-abempty
                  / ipath-abs
                  / ipath-rootless
                  / ipath-empty
iauthority        = [ iuserinfo "@" ] ihost [ ":" port ]
iuserinfo         = *( iunreserved / pct-encoded / sub-delims / ":" )
ihost             = IP-literal / IPv4address / ireg-name
IP-literal        = "[" ( IPv6address / IPvFuture  ) "]"
IPvFuture         = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
IPv6address       =                            6( h16 ":" ) ls32
                  /                       "::" 5( h16 ":" ) ls32
                  / [               h16 ] "::" 4( h16 ":" ) ls32
                  / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
                  / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
                  / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
                  / [ *4( h16 ":" ) h16 ] "::"              ls32
                  / [ *5( h16 ":" ) h16 ] "::"              h16
                  / [ *6( h16 ":" ) h16 ] "::"
ls32              = ( h16 ":" h16 ) / IPv4address
h16               = 1*4HEXDIG
IPv4address       = dec-octet "." dec-octet "." dec-octet "." dec-octet
dec-octet         = DIGIT                ; 0-9
                  / %x31-39 DIGIT        ; 10-99
                  / "1" 2DIGIT           ; 100-199
                  / "2" %x30-34 DIGIT    ; 200-249
                  / "25" %x30-35         ; 250-255
ireg-name         = *( iunreserved / pct-encoded / sub-delims )
port              = *DIGIT
ipath-abempty     = *( "/" isegment )
ipath-abs         = "/" [ isegment-nz *( "/" isegment ) ]
ipath-rootless    = isegment-nz *( "/" isegment )
ipath-empty       = 0<ipchar>
isegment          = *ipchar
isegment-nz       = 1*ipchar
iquery            = *( ipchar / iprivate / "/" / "?" )
iprivate          = %xE000-F8FF / %xF0000-FFFFD / %x100000-10FFFD
ifragment         = *( ipchar / "/" / "?" )
ipchar            = iunreserved / pct-encoded / sub-delims / ":" / "@"
iunreserved       = ALPHA / DIGIT / "-" / "." / "_" / "~" / ucschar
pct-encoded       = "%" HEXDIG HEXDIG
ucschar           = %xA0-D7FF / %xF900-FDCF / %xFDF0-FFEF
                  / %x10000-1FFFD / %x20000-2FFFD / %x30000-3FFFD
                  / %x40000-4FFFD / %x50000-5FFFD / %x60000-6FFFD
                  / %x70000-7FFFD / %x80000-8FFFD / %x90000-9FFFD
                  / %xA0000-AFFFD / %xB0000-BFFFD / %xC0000-CFFFD
                  / %xD0000-DFFFD / %xE1000-EFFFD
reserved          = gen-delims / sub-delims
gen-delims        = ":" / "/" / "?" / "#" / "[" / "]" / "@"
sub-delims        = "!" / "$" / "&" / "'" / "(" / ")"
                  / "*" / "+" / "," / ";" / "="
unreserved        = ALPHA / DIGIT / "-" / "." / "_" / "~"

Revision Log

Draft 19 – 2008-12-18

Draft 18 - 2008-11-06

xri               = xri-scheme
                  / xri-noscheme
xri-scheme        = "xri:" xri-noscheme

Draft 17 – 2007-06-14

Draft 16 – 2007-06-04

Draft 15 – 2007-05-29

Draft 14 – 2007-05-06

Draft 13 – 2007-05-02

Draft 12 – 2007-04-08

Draft 11 – 2007-04-03

Draft 10 – 2007-04-02

Draft 9 – 2007-04-01

Draft 8 – 2007-03-27

Draft 7 – 2007-03-22

Draft 6 – 2007-03-21

Draft 5 - 2007-03-17

Draft 4 - 2007-03-07

Draft 3 - 2007-03-05

Draft 2 – 2007-02-26

Draft 1 - 2007-02-20

XriThree/SyntaxAbnf (last edited 2009-05-12 17:44:31 by drummond.reed)