wikidata-api

get wikidata first and last revision timestamp

不问归期 提交于 2020-04-16 02:29:14
问题 I want to get the first and the last revision timestamp of a wikidata Item (for example Kevin Kratz), I tried with the wikidata api: -first timestamp: https://www.wikidata.org/w/api.php?action=query&titles=Kevin+Kratz&prop=revisions&rvdir=newer&rvlimit=1&format=json -last timestamp: https://www.wikidata.org/w/api.php?action=query&prop=revisions&rvlimit=1&rvprop=timestamp&titles=Kevin+Kratz&format=json but it didn't return the timestamps: {"batchcomplete":"","query":{"pages":{"-1":{"ns":0,

get wikidata first and last revision timestamp

ぐ巨炮叔叔 提交于 2020-04-16 02:28:50
问题 I want to get the first and the last revision timestamp of a wikidata Item (for example Kevin Kratz), I tried with the wikidata api: -first timestamp: https://www.wikidata.org/w/api.php?action=query&titles=Kevin+Kratz&prop=revisions&rvdir=newer&rvlimit=1&format=json -last timestamp: https://www.wikidata.org/w/api.php?action=query&prop=revisions&rvlimit=1&rvprop=timestamp&titles=Kevin+Kratz&format=json but it didn't return the timestamps: {"batchcomplete":"","query":{"pages":{"-1":{"ns":0,

Extract related articles in different languages using Wikidata Toolkit

随声附和 提交于 2020-01-23 17:57:07
问题 I'm trying to extract interlanguage related articles in Wikidata dump. After searching on the internet, I found out there is a tool named Wikidata Toolkit that helps to work with these type of data. But there is no information about how to find related articles in different languages. For example, the article: "Dresden" in the English language is related to the article: "Dresda" in the Italiano one. I mean the second one is the translated version of the first one. I tried to use the toolkit,

How to get Wikipedia page from Wikidata Id?

大憨熊 提交于 2020-01-14 08:00:29
问题 How to get Wikipedia page (in a particular language, say French) from the Wikidata Id (ex: Q19675)? The question seems obvious but strangely, I find nothing on the web. I'm looking for a url command that I could use with requests Python module, something like: url = "https://www.wikidata.org/w/api.php?action=some_method&ids=Q19675" r = requests.post(url, headers={"User-Agent" : "Magic Browser"}) Someone can help me? 回答1: You have to use MediaWiki API with action=wbgetentities : https://www

Get alias values from wikidata for a given property?

对着背影说爱祢 提交于 2020-01-14 03:25:15
问题 For a given property like 'occupation (P106)', I want to retrieve all its aliases like: profession, job, work, career, employment, craft. All of this is present on the properties wikidata page, under 'Also known as'. How can I go about retrieving this using SPARQL? I tried using the following query. SELECT ?predicate ?object WHERE { wdt:P106 wdt:P1449 ?predicate . //Nickname wdt:P106 wdt:P734 ?predicate . //Family Name wdt:P106 wdt:P735 ?predicate . //Given Name wdt:P106 skos:altLabel

Get all Wikidata items that are an instance of a given item

心不动则不痛 提交于 2019-12-30 06:27:48
问题 Wikidata has an item called smartphone model. I want to get all instances of it. QUESTION: How to get the identifiers of the instances programmatically, using the live server? Preferably not including false positives that show up in WhatLinksHere but are in the "Wikidata:" namespace rather than the main namespace. 回答1: Your question specifies the "Mediawiki API" but this is not possible. Wikidata has a SPARQL query service at https://query.wikidata.org The query that you want is: PREFIX wd:

Getting search results from wikidata website, but not API

橙三吉。 提交于 2019-12-23 20:17:45
问题 I'm trying out the wikidata API but have some trouble with the search query "Jas 39 C Gripen". It returns results on the wikidata website, but not if I use the API. On The wikidata website I get two search results for the query https://www.wikidata.org/w/index.php?search=Jas+39+C+Gripen&title=Special:Search&fulltext=1 The same query using the API, does not return a result https://www.wikidata.org/w/api.php?action=wbsearchentities&format=json&language=en&type=item&continue=0&search=Jas%2039

MediaWiki Query and/or WikidataQuery to find Wikipedia article

一笑奈何 提交于 2019-12-22 11:34:07
问题 This isn't so much a question abut AngularJS as it is about the Wikimedia and Wikidata query API's. Although I am trying to display the content of a Wikipedia article in AngularJS after doing a certain query that isn't the problem. I already know how to display it... the problem is the search for an article or articles. I'm trying to query Wikipedia by historical event date as well as by geo-location. Let's pick a random event, any event. Let's say " 1986 Mozambican Tupolev Tu-134 crash ".

How to get list of statements for a given Wikidata ID?

纵然是瞬间 提交于 2019-12-22 07:46:25
问题 The only thing I managed to do is this link: https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q568&format=jsonfm But this produces lots of useless data. What I need is to get all the statements for the given item, but I can't see any of the statements in the query above. here it will be: { "instance of" : "chemical element", "element symbol" : "Li", "atomic number" : 3, "oxidation state" : 1, "subclass of" : ["chemical element", "alkali metal"] // etc... } Is there an API for this

How to get image URL property from Wikidata item by API?

自作多情 提交于 2019-12-17 16:23:26
问题 I've made an android app that uses the JSON Google image search API to provide images but I have noticed that Google have stopped supporting it. I have also discovered that Wikidata sometimes provides a image property on some items, however I can't seem to get the URL location of the image using the Wikidata API. Is there any way to get the image URL property from items in Wikidata? 回答1: If some Wikidata item (with ID: Qxxx ) has image (P18) property, you can access it by MediaWiki API: https