[oslc-core] [oslc-cm] Problem with OSLC v1 style JSON representations

Ian Green1 ian.green at uk.ibm.com
Thu Mar 4 11:07:30 EST 2010


Hello all,

Is this encoding different from the talis one (
http://n2.talis.com/wiki/RDF_JSON_Specification)?

Just wanted to check this had been considered.  My understanding is that 
the talis representation is a de facto standard.  Cross-language library 
support etc.

best wishes,
    -ian

ian.green at uk.ibm.com (Ian Green1/UK/IBM at IBMGB)
Chief Software Architect, Requirements Definition and Management
IBM Rational



From:
Dave <snoopdave at gmail.com>
To:
oslc-core at open-services.net
Cc:
oslc-cm at open-services.net
Date:
04/03/2010 14:03
Subject:
Re: [oslc-core] [oslc-cm] Problem with OSLC v1 style JSON representations
Sent by:
oslc-core-bounces at open-services.net



Thanks Steve, Patrick and Andre. That addresses both of my concerns. I
will make sure the core spec matches the CM JSON representation.

- Dave


On Thu, Mar 4, 2010 at 8:54 AM, Andre Weinand <weinand at acm.org> wrote:
> Hi Dave,
>
> The following page shows how multi-valued attributes translate into JSON 
arrays:
>        http://open-services.net/bin/view/Main/CmJsonFormatV1
>
> The use of JSON arrays results in a nice isomorphism to the collection 
construct we use for multi-valued attributes in the XML format.
>
> Regards,
> --andre
>
>
> On 04.03.2010, at 12:00, Patrick Streule wrote:
>
>> Hi Dave,
>>
>>>   nicejson = "({\"foo\" \: \"bar\"})";
>>>   niceobject = eval(nicejson);
>>>   document.write("<p>niceobject.foo=" + niceobject.foo + "</p>");
>>
>> I agree that this nice, but allowing this in general would impose JS
>> language restrictions on property names. Not only the prefix notation 
is
>> problematic, also fully qualified identifiers like
>> 'com.example.properties.foo' would not work, and there may also be
>> conflicts with reserved words in JS.
>>
>>>   // colons in JSON field names does not work (prefixed property
>> isundefined)
>>>   annoyingjson = "({\"prefix:foo\" \: \"bar\"})";
>>>   annoyingobject = eval(annoyingjson);
>>>   document.write("<p>annoyingobject.prefix:foo=" + annoyingobject.foo
>>> + "</p>");
>>
>> You would write
>>   document.write("<p>annoyingobject.prefix:foo=" + annoyingobject
>> ["prefix:foo"] + "</p>");
>>
>> This is only slightly longer than the dot notation.
>>
>>>   // two properties with same name does not work (eval will fail)
>>>   annoyingjson2 = "({\"foo\" \: \"bar\", \"foo\" \: \"baz\"})";
>>>   annoyingobject2 = eval(annoyingjson2);
>>>   document.write("<p>annoyingobject1.foo=" + annoyingobject1.foo +
>> "</p>");
>>
>> IMO, we should leverage JSON's support for arrays here, and not try to
>> translate an XML or RDF representation too literally to JSON. So the
>> example would be:
>>
>>   annoyingjson2 = "({\"foo\" : [\"bar\", \"baz\"]})";
>>   annoyingobject2 = eval(annoyingjson2);
>>   document.write("<p>annoyingobject1.foo=" + annoyingobject1.foo +
>> "</p>");
>>   for (var i= 0; i < annoyingobject1.foo.length; i++) {
>>       document.write(annoyingobject1.foo[i]);
>>   }
>>
>> Regards,
>> Patrick
>>
>>
>> _______________________________________________
>> Oslc-Cm mailing list
>> Oslc-Cm at open-services.net
>> http://open-services.net/mailman/listinfo/oslc-cm_open-services.net
>
>

_______________________________________________
Oslc-Core mailing list
Oslc-Core at open-services.net
http://open-services.net/mailman/listinfo/oslc-core_open-services.net








Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU










More information about the Oslc-Core mailing list