Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The query</p> <pre><code>[{ limit: 100, type: '/location/location', name: [{ value: null, lang: { name: { value: null, lang: '/lang/en', }, } }], }]; </code></pre> <p>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 <em>very</em> small segment of the return value:</p> <pre><code> { '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)' }, </code></pre> <p>For a no-programming solution, copy-paste the following into an HTML file and open it with your browser:</p> <pre><code>&lt;html&gt;&lt;head&gt; &lt;script type="text/javascript" src="http://mjtemplate.org/dist/mjt-0.6/mjt.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body onload="mjt.run()"&gt; &lt;div mjt.task="q"&gt; mjt.freebase.MqlRead([{ limit: 10, type: '/location/location', name: [{ value:null, lang:{ name:{ value:null, lang:'/lang/en', }, } }], }]) &lt;/div&gt; &lt;table&gt;&lt;tr mjt.for="topic in q.result"&gt;&lt;td&gt; &lt;table&gt;&lt;tr mjt.for="(var rowi = 0; rowi &amp;lt; topic.name.length; rowi++)" mjt.if="rowi &amp;lt; topic.name.length" style="padding-left:2em"&gt;&lt;td&gt; &lt;pre mjt.script=""&gt; var name = topic.name[rowi]; &lt;/pre&gt; ${(name.lang['q:name']||name.lang.name).value}: &lt;/td&gt;&lt;td&gt;$name.value&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt; </code></pre> <p>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!)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload