Questions tagged [wikidata-api]

Related to the use of the MediaWiki API on Wikidata. Consider also the tags [wikidata] if your question isn't about the API or [mediawiki-api] if your question isn't about Wikidata.

Documentation for the API is available at mediawiki.org; a summary of all available parameters and short help is available by accessing the API endpoint on the wiki.

Please be sure to read the Etiquette page for best practices and general usage guidelines of using the API.

165 questions
1
vote
0 answers

general question: working with wikidata and RDF

I have the following problem with editing ontology data. i can query the data at wikidata per sparql, but they only return json files. These files only contain the s p o format. But i want to extend this data with my own stuff (using owl from…
ozz
  • 175
  • 1
  • 11
1
vote
1 answer

get wikidata oldest and latest revision timestamp

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:…
user5721551
1
vote
0 answers

How do I retrieve all properties of an item with all qualifiers from Wikidata with SPARQL?

I'm looking for a way to perform, with a single SPARQL query, a complete lookup of a Wikidata item and to return a JSON representation very similar to what Wikidata returns when you add .json to the entity URL (i.e.…
The Coding Monk
  • 7,684
  • 12
  • 41
  • 56
1
vote
0 answers

How to add a numeric value with unit (eg. 1500 kW) using WbQuantity() function, unsuccessful using tutorial

I'm creating a semi-automated tool in Python, using pywikibot, to import data from TOP500 database into Wikidata, following this and this tutorial. (Is my first time programming in Python). It ran fine, until the script attempts to commit a numeric…
Amitie 10g
  • 81
  • 1
  • 7
1
vote
0 answers

Wikidata Toolkit: Is it possible to access properties of entities?

First of all, I want to clarify that my experience working with wikidata is very limited, so feel free to correct if any of my terminology is wrong. I've been playing with wikidata toolkit, more specifically their wdtk-wikibaseapi. This allows you…
p192
  • 518
  • 1
  • 6
  • 19
1
vote
0 answers

Approximate matches from Wikidata

How do I call an API to query Wikidata for all matching results? E.g., if I query "Washington", I'll get back, among others, the entries for "Washington D.C.", "George Washington" and "Washington Irving"? Assuming this is possible, can I also do…
David Goldfarb
  • 1,796
  • 3
  • 18
  • 32
1
vote
1 answer

why i only get one result of keyword by wikidata python package?

I want to get all entities that the text contains the keyword "tweet about", this is my python code:`import wikidata import requests API_ENDPOINT="https://www.wikidata.org/w/api.php" query="tweet about" params={ 'action':'wbsearchentities', …
chloe
  • 31
  • 7
1
vote
0 answers

Is there a way to query Wikidata for company details from official web page?

I would like to query Wikidata for a company based on its domain url. For instance if I query facebook.com, it should return Facebook Inc. I have the below query which works fine but doesn't return the Ticker symbol. SELECT distinct ?item…
Srini
  • 53
  • 8
1
vote
0 answers

How to have summary API in my own wikidata

I would like to have the summary API to show in the tooltip just like in wikipedia page. The example could be https://en.wikipedia.org/api/rest_v1/page/summary/Fixed_point_(mathematics) But then this is not one of the default end point. Is there…
Loredra L
  • 1,485
  • 2
  • 16
  • 32
1
vote
0 answers

Retrieve item, its pageview and geographical attribution in one Mediawiki API call

This is a comprehensive and complete version of the answer I've already asked a while ago at Get location with Wikimedia API. I happened to dig through all the Mediawiki API, GeoData API and Wikidata Query SPARQL Service documentation for days,…
chainastole
  • 85
  • 1
  • 3
  • 11
1
vote
1 answer

Getting all the children of a Wikidata item (but not instances)

For example, take these three cases: Triangle Shirtwaist Factory fire (Q867316) : instance of (P31): disaster (Q3839081) disaster: subclass of (P279) : occurrence (Q1190554) occurrence (Q1190554) : subclass of: temporal entity (Q26907166)…
zadrozny
  • 1,631
  • 3
  • 22
  • 27
1
vote
1 answer

How to find entities which are cities with Wikidata API?

I try to find a city based on a part of its name (typically https://en.wikipedia.org/wiki/Lavo%C3%BBte-sur-Loire, a French city) The only way I found is to first request for "Lavoute" (without accent) through the following…
William R
  • 37
  • 12
1
vote
1 answer

Extract related articles in different languages using Wikidata Toolkit

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…
1
vote
1 answer

How to get a list of image file names from Wikimedia Commons with just a Wikidata ID

So the linked answer said how to get one image from Wikidata property P18: https://stackoverflow.com/a/34402875/1448813 But how do I get a list of images from wikimedia commons? We have the property P935 which gives us the gallery category name (or…
Janjko
  • 71
  • 6
1
vote
1 answer

Wikidata values and properties given a Unique Identifier?

I am not quite sure how to do this but I have 22,000 unique identifiers for game titles from Wikipedia. I got them through their Public API but now I'm stuck. I need to use those identifiers to get all the properties for each article they point to.…
OmniOwl
  • 5,477
  • 17
  • 67
  • 116