xdi-graph = *( xdi-statement / CRLF ) xdi-statement = contextual-statement / literal-statement / relational-statement contextual-statement = direct-contextual / inverse-contextual direct-contextual = peer-root-direct / inner-root-direct / entity-direct / attr-direct peer-root-direct = *peer-root "//" peer-root inner-root-direct = root-address "//" inner-root entity-direct = entity-address "//" entity attr-direct = attr-address "//" attr inverse-contextual = peer-root-inverse / inner-root-inverse / entity-inverse / attr-inverse peer-root-inverse = peer-root "/$is()/" *peer-root inner-root-inverse = inner-root "/$is()/" root-address entity-inverse = entity "/$is()/" entity-address attr-inverse = attr "/$is()/" attr-address literal-statement = entity-address 1*attr "/&/" value literal-var-statement = entity-address 1*attr "/{&}/" value-variable value-variable = "{" attr-class "}" relational-statement = direct-relational / inverse-relational / relation-definition direct-relational = xdi-address "/" 1*entity "/" xdi-address inverse-relational = xdi-address "/$is" 1*entity "/" xdi-address relation-definition = direct-domain / inverse-domain / direct-range / inverse-range direct-domain = direct-entity-domain / direct-attr-domain direct-entity-domain = root-address 1*definition "/(/)/" root-address 1*definition direct-attr-domain = root-address *definition 1*attr-definition "/(/)/" root-address 1*definition inverse-domain = inverse-entity-domain / inverse-attr-domain inverse-entity-domain = root-address 1*definition "/$is(/)/" root-address 1*definition inverse-attr-domain = root-address 1*definition "/$is(/)/" root-address *definition 1*attr-definition direct-range = direct-entity-range / direct-attr-range direct-entity-range = root-address 1*definition "/(/)#/" root-address 1*definition direct-attr-range = root-address 1*definition "/(/)#/" root-address *definition 1*attr-definition inverse-range = inverse-entity-range / inverse-attr-range inverse-entity-range = root-address 1*definition "/$is(/)#/" root-address 1*definition inverse-attr-range = root-address *definition 1*attr-definition "/$is(/)#/" root-address 1*definition xdi-address = root-address / entity-address / attr-address / literal-address root-address = *peer-root *inner-root entity-address = root-address *entity attr-address = entity-address *attr literal-address = entity-address 1*attr "&" peer-root = peer-root-instance / peer-root-variable peer-root-instance = "(" entity ")" peer-root-variable = "{" peer-root-instance "}" inner-root = inner-root-instance / inner-root-variable inner-root-instance = inner-root-peer-root / inner-root-entity inner-root-peer-root = "(" *peer-root "/" *entity ")" inner-root-entity = "(" *entity "/" *entity ")" inner-root-variable = "{" inner-root-instance "}" entity = singleton / collection / definition / variable / meta-variable singleton = instance / class collection = "[" class "]" definition = "|" ( singleton / collection ) "|" variable = "{" ( singleton / collection / definition ) "}" meta-variable = "{" variable "}" instance = person / group / thing / ordinal person = "=" [ "!" ] [ "~" ] id-string group = "+" [ "!" ] [ "~" ] id-string thing = "*" [ "!" ] [ "~" ] id-string ordinal = "@" [ "!" ] [ "~" ] ordinal-string class = reserved-class / unreserved-class / "$" / "#" / "=" / "+" / "*" / "@" reserved-class = "$" xdi-name unreserved-class = "#" [ "~" ] id-string attr = attr-singleton / attr-collection / attr-definition / attr-variable / attr-meta-variable attr-singleton = attr-class / attr-instance attr-collection = "[" attr-class "]" attr-definition = "|" ( attr-singleton / attr-collection ) "|" attr-variable = "{" ( attr-singleton / attr-collection / attr-definition ) "}" attr-meta-variable = "{" attr-variable "}" attr-class = "<" class ">" attr-instance = "<" instance ">" id-string = xdi-name / xdi-scheme / encap-iri ordinal-string = int / other-scheme xdi-name = ID_Start *( ID_Continue / "_" / "-" / "." ) pct-encoded = "%" HEXDIG HEXDIG xdi-scheme = uuid-scheme / cid-scheme / other-scheme uuid-scheme = ":uuid:" 8HEXDIG "-" 4HEXDIG "-" 4HEXDIG "-" 2HEXDIG 2HEXDIG "-" 12HEXDIG cid-scheme = ":cid-" 1*DIGIT ":" xdi-name other-scheme = ":" ( lower-alpha / DIGIT ) *( lower-alpha / DIGIT / "_" / "-" / "." ) ":" xdi-name encap-iri = "(" absolute-iri ")" absolute-iri = iri-scheme ":" 1*iri-char iri-scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) iri-char = safe-char / %xA0-EFFFD / pct-encoded safe-char = unreserved / reserved / gen-delims / safe-sub-delims unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" reserved = gen-delims / safe-sub-delims gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" safe-sub-delims = "!" / "$" / "&" / "(" / "*" / "+" / "," / ";" / "=" value = "false" / "null" / "true" / object / array / number / string object = begin-object [ member *( value-separator member ) ] end-object member = string name-separator value array = begin-array [ value *( value-separator value ) ] end-array begin-array = ws %x5B ws ; [ left square bracket begin-object = ws %x7B ws ; { left curly bracket end-array = ws %x5D ws ; ] right square bracket end-object = ws %x7D ws ; } right curly bracket name-separator = ws %x3A ws ; : colon value-separator = ws %x2C ws ; , comma number = [ "-" ] int [ frac ] [ exp ] exp = [ "e" / "E" ] [ "-" / "+" ] 1*DIGIT frac = "." 1*DIGIT int = "0" / ( %x31-39 *DIGIT ) ; no leading zeros string = quotation-mark *char quotation-mark char = unescaped / backslash ( quotation-mark / backslash / "/" / "b" / "f" / "n" / "r" / "t" / "u" 4HEXDIG ) backslash = %x5C ; \ reverse solidus U+005C quotation-mark = %x22 ; " quotation mark U+0022 unescaped = %x20-21 / %x23-5B / %x5D-10FFFF ws = *( %x20 / %x09 / %x0A / %x0D ) ALPHA = %x41-5A / %x61-7A ; A-Z, a-z DIGIT = %x30-39 ; 0-9 HEXDIG = %x30-39 / %x41-46 / %x61-66 ; 0-9, a-f, A-F CRLF = %x0D / %x0A / ( %x0D %x0A )