[Developers] query API - overuse and sanctions?
Michael Callaghan
john.michael.callaghan at gmail.com
Fri May 8 19:37:14 UTC 2009
Vishal
Well explained! Thanks for that.
Michael
2009/5/8 Vishal Talwar <vishal at metaweb.com>
> Ah, sorry, I didn't read the earlier emails carefully enough. The new query
> editor is smart enough to automatically prefix the duplicated keys (eg. in
> Kirrily's query, it's "ns0:name"). In the old query editor, you would
> actually see the duplicates disappear before your eyes after hitting the
> "Format" button. As the MQL reference guide explains:
>
> """
> Unfortunately, this query is not valid JSON: it includes the same property
> name twice, which means that cannot be parsed into object form. (To put this
> another way, you could not represent this query in a dictionary or hash data
> structure in a programming language like Python, Ruby or JavaScript.)
> """ http://mql.freebaseapps.com/ch03.html#id2952288
>
> So since keys must be unique, there has to be one winner. With MQL it seems
> that the last key wins and the query can thus be rewritten as:
>
> {
> "id": null,
> "name": null,
> "limit": 1,
> "type": "/people/person"
> }
>
> Freebase simply returns the first person it finds, and it happens to be
> Jack Abramoff.
>
> Vishal
>
> ----- Original Message -----
> From: "Michael Callaghan" <john.michael.callaghan at gmail.com>
> To: "For discussions about MQL, Freebase API and apps built on Freebase" <
> developers at freebase.com>
> Sent: Friday, May 8, 2009 12:12:50 PM GMT -08:00 US/Canada Pacific
> Subject: Re: [Developers] query API - overuse and sanctions?
>
>
> Vishal
>
> Thanks but I'm quite aware of the error in the query. I only included it
> out of interest given the odd result it returns...
>
> Michael
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freebase.com/pipermail/developers/attachments/20090508/fdf69386/attachment.htm
More information about the Developers
mailing list