mql

How can I get a list of all film ids from Freebase?

陌路散爱 提交于 2020-01-01 05:30:12
问题 On a project I was working on a couple of years back, I was building a set of data about movies from Freebase. A simple shell script downloaded the "film.tsv" file (from http://download.freebase.com/datadumps/latest/browse/film/film.tsv). I then used the "id" field in that file to build the necessary MQL requests for each of the films (retrieving the other properties I was interested in e.g. actors, genres). After looking at the developer's guide today I realise that Freebase has moved on a

How to get aliases from Freebase?

佐手、 提交于 2019-12-23 03:54:11
问题 I just want to get from Freebase the different aliases a person can have. My PHP query is : $query = array( array( 'id' => NULL, 'alias' => NULL, 'name' => "Barack Obama", 'type' => "/people/person" ) ); The result is: Array ( [code] => /api/status/error [messages] => Array ( [0] => Array ( [code] => /api/status/error/mql/type [info] => Array ( [expected_type] => /people/person [property] => alias ) [message] => Type /people/person does not have property alias [path] => [query] => Array ( [0]

Getting Wikipedia IDs in MQL

假装没事ソ 提交于 2019-12-23 01:58:40
问题 Freebase WEX dumps contain a wpid column corresponding to the page_id from the source MediaWiki database in the freebase_wpid table. This table provides a mapping between Wikipedia numeric article/redirect IDs and Freebase GUIDs (Global Unique IDs). guid use as foreign keys is deprecated by mid for lots of good reasons, but that doesn't change the fact that guids are still used at a system level so I'm going to call mid an accessor from here on. Using the mid accessor is flexible in MQL. One

How to configure a task to start a .ps1-script in VSC IDE (version 2.0.0)?

蓝咒 提交于 2019-12-23 00:27:00
问题 I want to use the Visual Studio Code IDE ("VSC") to develop in MQL (rather than in the native MetaEditor IDE) as described here: How to code & compile MQL5 in Visual Studio. My question refers to the compiling process, which consists of a VSC-task that calls a PowerShell script which in turn invokes MetaEditor.exe and dynamically passes to it the current .mq5-file to be compiled (that's why a task is used). Everything works fine when I run the PowerShell script directly (by selecting its code

How to configure a task to start a .ps1-script in VSC IDE (version 2.0.0)?

北战南征 提交于 2019-12-23 00:24:46
问题 I want to use the Visual Studio Code IDE ("VSC") to develop in MQL (rather than in the native MetaEditor IDE) as described here: How to code & compile MQL5 in Visual Studio. My question refers to the compiling process, which consists of a VSC-task that calls a PowerShell script which in turn invokes MetaEditor.exe and dynamically passes to it the current .mq5-file to be compiled (that's why a task is used). Everything works fine when I run the PowerShell script directly (by selecting its code

freebase api for sorting by city relevance

北城余情 提交于 2019-12-14 02:10:56
问题 I have a query where I would like to return all the cities for a given country. That works fine except I would like to also tweak so to sort it by size or any order of significance to avoid the 100 limit. I would like the first 100 cities to have the most likely cities a person might choose listed first. (population, or?) [{ "/location/country/iso3166_1_alpha2": "US", "/location/location/contains":[ "id" : null, "name" : null, "/location/statistical_region/population" : { "number" : null,

Using Freebase API in Java

怎甘沉沦 提交于 2019-12-13 19:43:22
问题 I am developing a GWT application to get the query results from the Freebase. This is the code of my EntryPoint class. package com.google.tracker.client; import com.freebase.api.Freebase; import com.freebase.json.JSON; import com.google.gwt.core.client.EntryPoint; public class Tracker implements EntryPoint{ public void onModuleLoad() { Freebase freebase = Freebase.getFreebase(); String query_str = "{" + "'id': null," + "'type': '/film/film'," + "'name': 'Blade Runner'," + "'directed_by': [{"

Compiler outputs the errors under Wine, but not on Windows

廉价感情. 提交于 2019-12-11 04:48:53
问题 I've got .mqh source code file with syntax error, for example created by the following command: echo some_error > fail.mqh Now, I'm using Metaeditor compiler to check the syntax and my goal is to print the errors to the standard output ( CON ), instead of logging them to the file ( /log:file.log ). See: Compiling. The following syntax works fine on Linux/macOS as follow (also under wine cmd.exe ): $ wine metaeditor.exe /s /log:CON /compile:fail.mqh ??fail.mqh : information: Checking 'fail.mqh

Obtain /common/topic/description in Freebase MQL

て烟熏妆下的殇ゞ 提交于 2019-12-10 23:31:08
问题 Good day, how can I obtain the topic text description in Freebase? For example, I ask MQL query about Chernobyl disaster: [{ "type": "/common/topic", "description": null, "mid": "/m/07q37w" }] but obtain null description. At the same time I can see non-null description at Freebase page: http://www.freebase.com/m/07q37w 回答1: /common/topic/description is a pseudo-property which is not accessible through MQL. You can use the Topic API as follows: https://www.googleapis.com/freebase/v1/topic/m

Non unique query with Freebase MQL read google api

不问归期 提交于 2019-12-10 17:36:22
问题 It seems I am only able to do unique queries (i.e. including an entity id in the query) with the new freebase MQL read api: The following searches on id and type: https://www.googleapis.com/freebase/v1/mqlread?query={"name":null,"id":"/en/bob_dylan","type":"/people/person"} and successfully returns: { "result": { "type": "/people/person", "id": "/en/bob_dylan", "name": "Bob Dylan" } } The following searches with type only: https://www.googleapis.com/freebase/v1/mqlread?query={"name":null,