; https://github.com/mwherman2000/did-uri-spec/tree/master/abnf/did-uri-spec-diddoc-2019-03-28.abnf

; !syntax("abnf")
did                       = did-method method-specific-idstring
did-method                = did-root method ":"
did-root                  = "did" ":" 

method                    = 1*methodchar
methodchar                = %x61-7A / DIGIT
method-specific-idstring  = idstring *( ":" idstring )
idstring                  = 1*idchar
idchar                    = ALPHA / DIGIT / "." / "-"

did-uri                   = did [ transform ] [ path-abempty ] [ "?" query ] [ "#" fragment ]

transform                 = TRANSFORM transformer *( "&" transformer )
transformer               = transformer-optiononly / transformer-namevalue
transformer-nameonly      = "$" transformer-option
transformer-namevalue     = "$" transformer-option "=" DQUOTE transformer-value DQUOTE
transformer-option        = transformer-options
transformer-value         = *transformer-char
transformer-char          = ALPHA / DIGIT / "." / "-"

ALPHA                     =  %x41-5A / %x61-7A   ; A-Z / a-z
DIGIT                     =  %x30-39             ; 0-9
TRANSFORM                 =  %x21                ; !
DQUOTE                    =  %x22                ; "

generic-option            = ALPHA 1*transformer-char

transformer-options       = selectid-option
                          / serviceid-option
                          / generic-option
selectid-option           = "selectId"
serviceid-option          = "serviceId"
exists-option             = "exists"

