Re: [JSON] PROPOSAL: Syntax structure should be object-based

Sandro Hawke wrote:
> On Wed, 2011-03-16 at 16:35 +0000, Andy Seaborne wrote:
>> On 16/03/11 14:57, Manu Sporny wrote:
>>> On 03/16/11 10:06, Andy Seaborne wrote:
>>>> While I can support a data-object style (providing a document is
>>>> self-contained and matters of coverage), the more important question to
>>>> me is whether we are designing to API access or direct datastructure
>>>> access, and within the latter whether there is translation between
>>>> on-the-wire and applications forms.
>>> We (our company) found that it is nearly impossible to generically
>>> address these two approaches at the same time without an API:
>>>
>>> 1. Use JSON as-is but translate it to RDF.
>>> 2. Support terms, CURIEs, datatypes or languages.
>>>
>>> I think we need a minimum API... and really, nobody uses eval() these
>>> days - they use jQuery, which uses the JSON API ->  JSON.parse()
>> Yes, I know direct eval() is not often done.  The point stands though - 
>> is it a call that is specific RDF of a call that any JS app might make. 
>>   You are describing a non-generic call in which case the relationship 
>> between javascript objects and serialization is open.
> 
> Agreed.   If users have to call rdf_in_json.parse() then why shouldn't
> they just use turtle.parse() instead?  Or, really, rdf.parse(), which
> understands turtle, rdf/xml, and RDFa.    
> 
> I'm wondering how terse and simple we can get the use cases here.

Exactly, this is what I meant by the simple boolean choice, you either 
need an API to work with the data or not. Where API means RDF or 
RDF-in-JSON specific tooling, not JSON.parse.

Personal opinion:

If we aren't prepared to do pure data objects with some form of mapping 
(plain old simple objects, ie so twitter could deploy without changing 
their existing data other than adding an IRI subject/id and mapping some 
properties) then an API is needed, so it may as well be optimized for 
the machine (simply trading off between bytesize and amount of 
processing to get an optimal mix).

If I ruled the RDF in JSON world then I'd do a heavily optimized variant 
as mentioned, and probably work with Kris Zyp who does JSON schema and 
some JSON API developers to get a good JSON schema-like mapping going 
that people can use on simple objects and existing data.

Best,

Nathan

Received on Wednesday, 16 March 2011 18:18:38 UTC