wikidata-api

Retrieve linked wikidata entities having a wikipedia page

泄露秘密 提交于 2021-02-10 20:37:50
问题 I want to query wikidata by free text or by category, to return entities who has a corresponding wikipedia page. For each page (or for a selected page) I want to fetch all the linked wikidata entities who have a corresponding wikipedia article. Note that: for each wikipedia page and linked pages, I want to fetch the corresponding Wikidata Id a linked wikidata entity may exist on other wikipedias, not necessarily in the queried language (e.g. a page in French History is available in multiple

Retrieve linked wikidata entities having a wikipedia page

痞子三分冷 提交于 2021-02-10 20:32:05
问题 I want to query wikidata by free text or by category, to return entities who has a corresponding wikipedia page. For each page (or for a selected page) I want to fetch all the linked wikidata entities who have a corresponding wikipedia article. Note that: for each wikipedia page and linked pages, I want to fetch the corresponding Wikidata Id a linked wikidata entity may exist on other wikipedias, not necessarily in the queried language (e.g. a page in French History is available in multiple

how to programmatically get all available information from a Wikidata entity?

怎甘沉沦 提交于 2021-02-08 06:52:22
问题 I'm really new to wikidata. I just figured that wikidata uses a lot of reification. Suppose we want to get all information available for Obama. If we are going to do it from DBpedia, we would just use a simple query: select * where {<http://dbpedia.org/resource/Barack_Obama> ?p ?o .} This would return all the properties and values with Obama being the subject. Essentially the result is the same as this page: http://dbpedia.org/page/Barack_Obama while the query result is in a format I needed.

how to programmatically get all available information from a Wikidata entity?

*爱你&永不变心* 提交于 2021-02-08 06:51:39
问题 I'm really new to wikidata. I just figured that wikidata uses a lot of reification. Suppose we want to get all information available for Obama. If we are going to do it from DBpedia, we would just use a simple query: select * where {<http://dbpedia.org/resource/Barack_Obama> ?p ?o .} This would return all the properties and values with Obama being the subject. Essentially the result is the same as this page: http://dbpedia.org/page/Barack_Obama while the query result is in a format I needed.

how to programmatically get all available information from a Wikidata entity?

此生再无相见时 提交于 2021-02-08 06:50:17
问题 I'm really new to wikidata. I just figured that wikidata uses a lot of reification. Suppose we want to get all information available for Obama. If we are going to do it from DBpedia, we would just use a simple query: select * where {<http://dbpedia.org/resource/Barack_Obama> ?p ?o .} This would return all the properties and values with Obama being the subject. Essentially the result is the same as this page: http://dbpedia.org/page/Barack_Obama while the query result is in a format I needed.

How to reliably get the image used in the Wikipedia Infobox?

大憨熊 提交于 2021-02-07 22:42:20
问题 How do I (reliably) get the main image(s) used in the Wikipedia Infobox from the API? This question has been asked before and the accepted answer admits that it is just a guess. Subsequent answers seem like a hack, at best and don't return the correct image. For instance, the Jimi Hendrix Wikipedia entry uses "File:Jimi Hendrix 1967.png" as the main image in the InfoBox. The updated answers suggest using this url but for Jimi Hendrix (and other topics) it often returns the wrong image. If I

How to reliably get the image used in the Wikipedia Infobox?

人盡茶涼 提交于 2021-02-07 22:42:19
问题 How do I (reliably) get the main image(s) used in the Wikipedia Infobox from the API? This question has been asked before and the accepted answer admits that it is just a guess. Subsequent answers seem like a hack, at best and don't return the correct image. For instance, the Jimi Hendrix Wikipedia entry uses "File:Jimi Hendrix 1967.png" as the main image in the InfoBox. The updated answers suggest using this url but for Jimi Hendrix (and other topics) it often returns the wrong image. If I

How to query Wikidata for “also known as”

给你一囗甜甜゛ 提交于 2020-05-27 04:32:12
问题 I would like to know how to query Wikidata by using the alias ("also known as"). Right now I am trying SELECT ?item WHERE { ?item rdfs:aliases ?alias. FILTER(CONTAINS(?alias, "Angela Kasner"@en)) } LIMIT 5 This is simply a query that works if I replace rdfs:aliases by rdfs:labels . I am trying this, because Help:Aliases says that aliases are searchable in the same way as labels, but I can't find any other resource on that nor can I find an example. 回答1: This query might be helpful for someone

get wikidata oldest and latest revision timestamp

依然范特西╮ 提交于 2020-05-17 06:14:48
问题 Yesterday, I asked a question about how to get wikidata oldest and latest timestamp for "Kevin Kratz (Q939047)", someone suggested using API sandbox to create the query like this: oldest timestamp: https://www.wikidata.org/w/api.php?action=query&format=json&list=allrevisions&titles=Kevin%20Kratz&arvprop=ids|timestamp|flags|comment|user&arvlimit=1&arvdir=newer latest timestamp: https://www.wikidata.org/w/api.php?action=query&format=json&list=allrevisions&titles=Kevin%20Kratz&arvprop=ids

get wikidata oldest and latest revision timestamp

时光毁灭记忆、已成空白 提交于 2020-05-17 06:14:07
问题 Yesterday, I asked a question about how to get wikidata oldest and latest timestamp for "Kevin Kratz (Q939047)", someone suggested using API sandbox to create the query like this: oldest timestamp: https://www.wikidata.org/w/api.php?action=query&format=json&list=allrevisions&titles=Kevin%20Kratz&arvprop=ids|timestamp|flags|comment|user&arvlimit=1&arvdir=newer latest timestamp: https://www.wikidata.org/w/api.php?action=query&format=json&list=allrevisions&titles=Kevin%20Kratz&arvprop=ids