The query
[{
limit: 100,
type: '/location/location',
name: [{
value: null,
lang: {
name: {
value: null,
lang: '/lang/en',
},
}
}],
}];
returns for every location and every language, the name of that location in that language. The results are organized by language. For example, here is a very small segment of the return value:
{
'lang': {
'name': {
'lang': '/lang/en',
'value': 'Russian'
}
},
'value': 'Сан-Франциско'
},
{
'lang': {
'name': {
'lang': '/lang/en',
'value': 'Swedish'
}
},
'value': 'San Francisco'
},
{
'lang': {
'name': {
'lang': '/lang/en',
'value': 'Portuguese'
}
},
'value': 'São Francisco (Califórnia)'
},
For a no-programming solution, copy-paste the following into an HTML file and open it with your browser:
<html><head>
<script type="text/javascript" src="http://mjtemplate.org/dist/mjt-0.6/mjt.js"></script>
</head>
<body onload="mjt.run()">
<div mjt.task="q">
mjt.freebase.MqlRead([{
limit: 10,
type: '/location/location',
name: [{
value:null,
lang:{
name:{
value:null,
lang:'/lang/en',
},
}
}],
}])
</div>
<table><tr mjt.for="topic in q.result"><td>
<table><tr mjt.for="(var rowi = 0; rowi < topic.name.length; rowi++)"
mjt.if="rowi < topic.name.length" style="padding-left:2em"><td>
<pre mjt.script="">
var name = topic.name[rowi];
</pre>
${(name.lang['q:name']||name.lang.name).value}:
</td><td>$name.value</td></tr></table></td></tr></table></body></html>
Of course, that will only include the first 10 results. Up the limit above if you want more. (By the way, not only is Freebase cool, so is this mjt templating language!)