freebase

Array of Freebase MIDs and sending multiple queries to freebase

这一生的挚爱 提交于 2019-12-09 22:59:20
问题 I want to loop through the MySQL results which is an array of Freebase MIDs and I want the output to be the names of the Freebase article! Here's my code: $query = "SELECT `mid` FROM `items`"; $result = mysql_query($query); $count = 1; while ($row = mysql_fetch_array($result)) { $mid = $row['mid']; $simple_query = array('name'=> null, 'mid'=>$mid); $q_array = array('q'.$count=>array('query'=>$simple_query)); array_push ($query_array, $q_array ); $count++; } $jsonquerystr = json_encode($query

Can browsers react to Set-Cookie specified in headers in an XSS jquery.getJSON() request?

喜欢而已 提交于 2019-12-08 09:39:48
问题 (Note: This is a follow up to my question Can jQuery.getJSON put a domain's cookies in the header of the request it makes? and covers the XSS case of Setting a cookie in an AJAX request?) I've been told I'm unable to set cookies to be read by other domains that are not subdomains of the current domain using $.cookie(..., ..., {domain: ...}) . But in a comment on a response to my last question, @zanlok said "The server's reply, however, can definitely set a cookie" and it got two upvotes. So I

Freebase search_api and excluding results by specified type

僤鯓⒐⒋嵵緔 提交于 2019-12-08 04:46:38
问题 is anyone know, how to exclude some topics with specified type(s) using search api and mql? For example i'm try to find all topics "Voodoo People", and exclude only those, that have composition and release types, and sort result by score desc: http://tinyurl.com/3tjkb7y. Sorting work perfect, but i can't find functionality for excluding :( I'm try to use mql_filter: http://tinyurl.com/644xkow, but releases still there. And one more question: i see in type_strict param possible values: "all",

Multiple Queries in MQL on Freebase

核能气质少年 提交于 2019-12-08 02:18:24
问题 I am trying to get a list of results from Freebase. I have an array of MIDs. Can someone explain how I would structure the query and pass it to the API in PHP? I'm new to MQL - I can't even seem to get the example to work: $simplequery = array('id'=>'/topic/en/philip_k_dick', '/film/writer/film'=>array()); $jsonquerystr = json_encode($simplequery); // The Freebase API requires a query envelope (which allows you to run multiple queries simultaneously) so we need to wrap our original,

[Freebase]: Finding relationship between nodes

拟墨画扇 提交于 2019-12-07 18:55:02
问题 I am new to Freebase and I have been trying to find relationships between 2 nodes without success. For example, I want to find if there is link between Lewis Hamilton(/en/lewis_hamilton) and Formula One(/en/formula_one), which there is in real life, but I can't seem to find it. I have tried the following MQL codes, alternating IDs as well : 1) [{ "type" : "/type/link", "source" : { "id" : "/en/lewis_hamilton" }, "master_property" : null, "target" : { "id" : "/en/formula_one" }, "target_value"

Freebase API call works in browser but fails with curl

大憨熊 提交于 2019-12-07 16:50:06
问题 I'm trying to receive data from the Freebase API. I manually built a working API call which gave me a valid JSON response in my browser. So I wrote a PHP Function which should do exactly that: $service_url = 'https://www.googleapis.com/freebase/v1/search'; $params = array( 'filter' => '(all name:"Avatar")', 'lang' => 'en', 'type' => 'film/film', 'key' => Configure::read('Api.Key') ); $url = $service_url . '?' . http_build_query($params); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url);

Can I export translations of place names from freebase.com

我们两清 提交于 2019-12-07 16:39:43
问题 So I've looked at this use of the freebase API and I was really impressed with the translations of the name that it found. IE Rome, Roma, Rom, Rzym, Rooma,로마, 罗马市. This is because I have a database of some 5000+ location names and I would very much like all French, German or Korean translations for these English names. The problem is I spent about two hours clicking around freebase, and could find no way to get a view of city/location names in a different language mapped to English. So I'd

Using freebase vectors with gensim

梦想与她 提交于 2019-12-07 12:32:04
问题 I am trying to use the freebase word embeddings released by Google, but I have a hard time getting the words from the freebase name. model = gensim.models.Word2Vec.load_word2vec_format('freebase-vectors-skipgram1000.bin',binary=True) model.vocab.keys()[:10] Out[22]: [u'/m/026tg5z', u'/m/018jz8', u'/m/04klsk', u'/m/08gd39', u'/m/0kt94', u'/m/05mtf0t', u'/m/05tjjb', u'/m/01m3vn', u'/m/0h7p35', u'/m/03ggvg3'] Does anyone know if it exist some kind of table to map the freebase representations

How can I query wikidata with a freebase id from a youtube video?

六月ゝ 毕业季﹏ 提交于 2019-12-07 10:31:43
问题 I am using the youtube API to retrieve the freebase topic details of particular videos. Since freebase is closing down how do I use wikidata to query for a specific topic id? For example the following topic id /m/0181lj should give the following information I have tried playing with the wikidata REST API but I haven't found a request which matches what I need. Update Freebase have released the Knowledge graph which allows you to query via topicId as so https://kgsearch.googleapis.com/v1

google api for glorious info box? [closed]

ⅰ亾dé卋堺 提交于 2019-12-07 06:41:19
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I'm guessing this info is privileged since I couldn't find anything on Google's listed APIs. In fact I'd be amazed if it wasn't proprietary securely fastened Google magic, but thought I'd ask anyway. Is there an Google API for the information appearing when you do a basic search for say an Actress or Rockband? You