← Prev in month ← Prev in thread

JSON parse tree example Re: [xdi] Agenda: XDI TC Telecon Friday 09:00 - 10:30AM PT 2013-04-05

From
Joseph Boyle <>
Date
2013-04-05T16:08:06+00:00
ID
Thread
JSON parse tree example Re: [xdi] Agenda: XDI TC Telecon Friday 09:00 - 10:30AM PT 2013-04-05
This is an example of the kind of parse tree I naturally get from _javascript_ code I'm writing to parse XDI.
It is probably similar to the Java data structures Markus's XDI2 creates from parsing XDI.

If we can simply JSON-serialize a parse tree that is convenient for programmers, then they can simply JSON-deserialize and use it without more complicated parsing steps.

On Apr 4, 2013, at 11:33 PM, Drummond Reed <> wrote:

JSON SERIALIZATION OPTIONS
Today (Thursday) Joseph and Drummond were able to meet and go over new options for the JSON serialization that could be more “developer friendly” by not requiring parsing of the subject/predicate keys in order to build an XDI graph object model (GOM).

Joseph will present an example of what the GOM could look like an how to serialize it.

=drummond<+email>!uuid:f81d4fae-7dec-11d0-a765-00a0c91e0001<<$string>>/<>/
""

Version 1:  Separate context symbol and identifier

Compact: [[{"cs":"=","id":"drummond"},{"cs":"<","id":{"cs":"+","id":"email"}},{"cs":"!","id":"uuid:f81d4fae-7dec-11d0-a765-00a0c91e0001"},{"cs":"<<","id":{"cs":"$","id":"string"}}],{"cs":"<","id":""},""]

Formatted:

[   [      {         "cs":"=",         "id":"drummond"      },      {         "cs":"<",         "id":{            "cs":"+",            "id":"email"         }      },      {         "cs":"!",         "id":"uuid:f81d4fae-7dec-11d0-a765-00a0c91e0001"      },      {         "cs":"<<",         "id":{            "cs":"$",            "id":"string"         }      }   ],   {      "cs":"<",      "id":""   },   ""]

Version 2: Bottom-level context symbol - identifier sequence left in one string. Context functions still (usually>) require separate object.

Compact: [["=drummond",{"cs":"<","id":"+email"},"!uuid:f81d4fae-7dec-11d0-a765-00a0c91e0001",{"cs":"<<","id":"$string"}],{"cs":"<"},""]

Formatted:

[   [      "=drummond",      {         "cs":"<",         "id":"+email"      },      "!uuid:f81d4fae-7dec-11d0-a765-00a0c91e0001",      {         "cs":"<<",         "id":"$string"      }   ],   {      "cs":"<"   },   ""]
← Prev in month ← Prev in thread