[Developers] query API - overuse and sanctions?

Nick Thompson nix at metaweb.com
Sat May 9 18:29:25 UTC 2009


Kurt's reading of the RFC is correct: having multiple
properties with the same name is useless and ambiguous
but not actually "invalid" JSON.  The sentence in the MQL
manual should be reworded.

Freebase services use existing open-source JSON parsing
libraries, and so far these libraries haven't provided
a "strict property name checking" option.  We actually
submitted a patch for one parser and it was turned down.
So far, it hasn't been enough of an issue to justify
maintaining patched versions.  It's also cleaner from a
specification point of view to say that MQL is layered
over JSON.

My guess is that the reason for using SHOULD vs MUST in
the JSON spec is to make better allowance for "streaming"
parsers that don't remember all the properties they've
seen.  This style is popular in the XML world but haven't
caught on in JSON yet since streaming is mostly useful in
dealing with extremely large datasets.

     nick

Kurt Bollacker wrote:
> On Fri, May 08, 2009 at 11:33:21PM -0700, Alexander Botero-Lowry wrote:
>> Umm. SpiderMonkey can't grok that. Rhino can't grok it either.
>> Which means it's not valid JSON. period.
> 
> But wait!  Pedantic man to the resuce!
> 
> If you look at the RFC that defines JSON :
> 
> http://www.ietf.org/rfc/rfc4627.txt
> 
> you'll see the relevant phrase : 
> 
>    "The names within an object SHOULD be unique."
> 
> blocking the bullet of common sense with my bare hands, I looked up
> the def of "SHOULD" in RFC 2119 :
> 
>  "3. SHOULD   This word, or the adjective "RECOMMENDED", mean that there
>      may exist valid reasons in particular circumstances to ignore a
>      particular item, but the full implications must be understood and
>      carefully weighed before choosing a different course. "
> 
> So I wonder what the "valid reasons" are for Freebase?  My guess is
> that there are none, and so Freebase should return an error when
> presented with invalid JSON.
> 
> 
> 
> 								Kurt ;-)
> 
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers


More information about the Developers mailing list