Suppose I make the following query in freebase,
[{
"mid": "/m/02y7vp",
"name": null
}]
The answer that I get back is,
{ "result": [{
"name": "G\u00fcnter Verheugen",
"mid": "/m/02y7vp"
}]
}
I want to construct the reverse query in MQL,
[{
"mid": null,
"name": "G\u00fcnter Verheugen"
}]
But this query does not work. I also tried the encoding suggested by freebase here, but that did not work either.
Is there something wrong in the unicode encoding that I use?
EDIT
This is what I am doing:
1) Copy paste the query in the url
https://www.googleapis.com/freebase/v1/mqlread?query=[{"mid": "/m/02y7vp","name": null}]
2) Download the results in "mqlread" file. less mqlread
shows the following:
{ "result": [{
"name": "G\u00fcnter Verheugen",
"mid": "/m/02y7vp"
}]
}
3) Replace the query field in the query url with the desired reverse query.
Eventually, I would like to make similar queries using Java.
The MQLread API returns JSON and it needs to be decoded as such. You can find the definition on json.org, but most languages can decode it easily. The \u escape introduces a four digit encoding of a Unicode code point. The Unicode code point denoted by \u00fc is "ü" (http://www.fileformat.info/info/unicode/char/fc/index.htm)
Although the API returns the name encoded this way, it will accept both the character and the Unicode code point in queries. You don't provide the second URL that you are using, making it impossible to debug, whatever issue you're having is unrelated to the API because both of these work:
https://www.googleapis.com/freebase/v1/mqlread/?lang=/lang/en&query=[{"mid":null, "name":"G\u00fcnter Verheugen"}]
https://www.googleapis.com/freebase/v1/mqlread/?lang=/lang/en&query=[{"mid":null, "name":"Günter Verheugen"}]