OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

xdi message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: Updated JSON serialization rule for literal values & new graph tree serialization proposal


Sorry I should have been more clear. Of course you can't have one arc pointing to multiple things. But you can have multiple arcs with the same identifier, e.g. $set. One could point to an inner graph and others else where.

Markus

On Friday, May 3, 2013, Joseph Boyle <boyle.joseph@gmail.com> wrote:
> In terms of the graph model - how can an arc point at more than one thing, if it only begins at one node and ends at another node?
> On May 3, 2013, at 8:36 AM, Markus Sabadello <markus.sabadello@gmail.com> wrote:
>
> One problem with the graph tree serialization is that it can't express the case when you have relational arcs (e.g. $set) that point to both an inner graph, and to one or more regular contexts. The solution is to make the inner graph an object in an array, rather than just an object.
>
> Markus
>
> On Thursday, April 25, 2013, Drummond Reed <drummond@connect.me> wrote:
>> Per Markus' feedback below, I updated https://wiki.oasis-open.org/xdi/JSONSerializationRules to eliminate the requirement that XDI literal values be enclosed in arrays.
>> Also, since Joseph has suggested at least one alternative JSON serialization, and I have suggested a third one, I suggest we refer to our current JSON serialization as key-value serialization, since it emulates the structure used by a key-value store.
>> I would suggest that we call the other two serializations:
>>
>> Parse-tree serialization - this is the format Joseph has suggested on the list which parses all the XDI statements into their syntax components.
>> Graph-tree serialization is what Joseph's format inspired me to suggest because his parse-tree serialization seem to naturally lead to a direct serialization of the directed graph, where each node of the XDI graph is represented as a single JSON object.
>>
>> After talking with Joseph this morning I was inspired to work out the rules and post some examples of graph-tree serialization. I just posted this to:
>>
>> https://wiki.oasis-open.org/xdi/GraphTreeSerialization
>>
>> To save you time, I'm pasting in both examples below so you can see what it looks like. The key (literally) is:
>>
>> All XDI contexts are nested JSON objects (one per XDI context).
>> Relational statements originating from a context are serialized using the special member key "/":
>> A literal statement originating from a context is serialized using the special member key "&":
>> An inner graph is serialized using the special member key "()":
>>
>> Examples
>>
>> Non-Recursive
>>
>> {
>>     "=drummond": {
>>         "[<+email>]": {
>>             "!1": {
>>                 "&": "drummond@example.com"
>>             },
>>             "!2": {
>>                 "&": "dsr@example.net"
>>             }
>>         },
>>         "<+email>": {
>>             "/": {
>>                 "$ref": [
>>                     "=drummond{<+email>]!1"
>>                 ]
>>             }
>>         },
>>         "+home": {
>>             "<+email>": {
>>                 "/": {
>>                     "$ref": [
>>                         "=drummond{<+email>]!2"
>>                     ]
>>                 }
>>             }
>>         },
>>         "+work": {
>>             "<+email>": {
>>                 "/": {
>>                     "$ref": [
>>                         "=drummond{<+email>]!1"
>>                     ]
>>                 }
>>             }
>>         },
>>         "/": {
>>             "+friend": [
>>                 "=markus",
>>                 "=joseph"
>>             ]
>>         }
>>     }
>> }
>>
>> Recursive (Inner Graph)
>>
>> This example represents a typical XDI message.
>>
>> {
>>     "([@]!9999)": {
>>         "/": {
>>             "$set": [
>>                 "[@]!9999[$msg]!1234"
>>             ]
>>         }
>>     },
>>     "[@]": {
>>         "!9999": {
>>             "[$msg]": {
>>                 "!1234": {
>>                     "/": {
>>                         "$is()": [
>>                             "([=]!3333)"
>>              

--
Project Danube: http://projectdanube.org
Personal Data Ecosystem Consortium: http://personaldataecosystem.org/



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]