[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [xdi] Downsides of the notation shift
Markus, I'm just boarding my plane to London, but in looking this over, my reaction was that we just need to adjust the serialization rules so that the "beautiful pattern" is exactly how we DO continue to serialize inner graphs.In other words, even though we've changed inner graph syntax notation to eliminate the "short notation" and standardize on one notation, the serialization rules should serialize full statements inside an inner graph as a nested JSON object.In other words, the NEW syntax notation would still produce the OLD serialization (with it's beautiful nested pattern).Am I missing anything, or can we just "make it so" (with an update to our next Working Draft of the Core spec, of course)?=Drummond
On Monday, June 16, 2014, Markus Sabadello <markus.sabadello@xdi.org> wrote:
Here in the XDI/JSON "short notation", we have the beautiful rule that statements that are the target of the $set operation are all encapsulated within a single nested JSON object. This pattern completely disappears with the "notation shift".Current "short notation":In XDI/JSON, this difference can also be observed (during the XDI TC call, we only did XDI DISPLAY).After the "notation shift":As I tried to illustrate in the last XDI TC minutes, sometimes XDI messages don't quite look as nice and consistent after the "notation shift" as they look in the current "short notation":Current "short notation":
[=]!:uuid:1111[$msg]!:uuid:1234$do/$set/([=]!:uuid:1111/#friend/[=]!:uuid:2222)
[=]!:uuid:1111[$msg]!:uuid:1234$do/$set/([=]!:uuid:1111<#email>&/&/"alice@test.com")
[=]!:uuid:1111[$msg]!:uuid:1234$do/$set/[=]!:uuid:1111<#phone>([=]!:uuid:1111[$msg]!:uuid:1234$do/$set)[=]!:uuid:1111/#friend/[=]!:uuid:2222
People may ask here, why are there parentheses around the message in the first two lines, but not in the last line.
([=]!:uuid:1111[$msg]!:uuid:1234$do/$set)[=]!:uuid:1111<#email>&/&/"alice@test.com"
[=]!:uuid:1111[$msg]!:uuid:1234$do/$set/[=]!:uuid:1111<#phone>
{
"[=]!:uuid:1111[$msg]!:uuid:1234$do/$set": [
{
"[=]!:uuid:1111/#friend": [
"[=]!:uuid:2222"
],
"[=]!:uuid:1111<#email>&/&": "alice@test.com"
},
"[=]!:uuid:1111<#phone>"
]
}
Besides not being as readable, there is another problem: Size.
After the "notation shift":
{
"([=]!:uuid:1111[$msg]!:uuid:1234$do/$set)[=]!:uuid:1111/#friend": [
"[=]!:uuid:2222"
],
"([=]!:uuid:1111[$msg]!:uuid:1234$do/$set)[=]!:uuid:1111<#email>&/&":
"alice@test.com",
"[=]!:uuid:1111[$msg]!:uuid:1234$do/$set": [
"[=]!:uuid:1111<#phone>"
]
}
This is about 50% bigger than the previous "short notation" (not counting whitespace).
Keep in mind that we consider XDI/JSON the default format when sending XDI over the wire.All of the above doesn't just apply to messages, but also to link contracts and policies and everything else that uses inner roots.
Markus
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]