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
0
votes
1 answer

Pass continue param to MWAPI inside Wikidata query

Is it possible to pass the continue parameter to a MWAPI call inside a Wikidata SPARQL query? For instance, I have this query which uses the MWAPI EntitySearch and that always returns at most 50 results. I want to be able to set continue hoping that…
0
votes
1 answer

getting labels from Wikidata in graphDB

I have a list of artstyles in graphDB, i am trying to use the SERVICE function to get their labels from Wikidata with this query: PREFIX gp: PREFIX rdfs:…
0
votes
0 answers

Filter search in Wikidata API

I am trying to get filtered data from the Wikidata API, currently I can do a general search using this API, but now there have been specific cases where I have to filter this information, for example, I need to get a list of only authors to get the…
0
votes
0 answers

Is it possible to retrieve external identifier URLs through the wikidata API or does that need SPARQL?

I'd like to retrieve the URLs of the external identifiers from wikidata entities. I found a solution using SPARQL, but I'm wondering if this is possible to do using the mediawiki API also?
0
votes
0 answers

Return cities in Wikidata SPARQL Query, similar to a Wikipedia page

I'm not sure what I'm doing wrong. I have a nice list, but not only are the cities duplicating, but I'm unsure how they're defined as cities. I would expect to see London in the results and have similar results to this Wikipedia page. These results…
Dol
  • 944
  • 3
  • 10
  • 25
0
votes
0 answers

How to get a list of Wikidata entity IDs from Wikiquote

I would like to get a list of the Q-item entity IDs for every individual person who has a wikiquote page. There is not much in the way of information on how wikiquote is integrated with wikidata and I can't find a wikidata property of "has a…
aloea
  • 191
  • 1
  • 12
0
votes
0 answers

Wikidata Query - Health Specialty of a Disease name

I want to query the "instance of P31" and "health specialty P115" for a disease name "left bundle branch hemiblock (Q2143688)" I want an output like : left bundle branch hemiblock (Q2143688) instance of : thoracic disease health specialty…
A Developer
  • 1,001
  • 3
  • 12
  • 32
0
votes
0 answers

Wikidata: order by last updated item in specific date time range

I noticed that when a query does not have an 'order by' statement at the end, the results are ordered in a last-updated-first manner. SELECT ?subjectLabel ?subject WHERE { ?subject wdt:P31 wd:Q11424. SERVICE wikibase:label { bd:serviceParam…
0
votes
1 answer

Create a claim on Wikidata with a specific type of value

I am trying to ingest data to a local Wikibase, which I installed following the steps described in https://docs.docker.com/compose/install/. I'm using the API of wikibase/wikidata for the ingestion and it works as expected. For instance, I could…
henryr
  • 169
  • 1
  • 15
0
votes
0 answers

How to find number of [instanceOf OR subclass of] hops between any two wikidata entities?

For example, if I want to find number of hops between Politician (Q82955) and President of the US (Q11696), the answer should be 2. POTUS (Q11696) – subclassOf -> HeadOfGovernment (Q2285706) – subclassOf -> Politician (Q82955) How can I write a…
0
votes
0 answers

Get list of cities for Belgium via Wikidata

I'm a fairly new programmer and would like to get the cities of Belgian via Wikidata. The problem I'm having is that I can't seem to find an endpoint of how to get it. The documentation URL is https://www.wikidata.org/wiki/Q6984567?
0
votes
1 answer

How to retrive full Wikidata info of an entity

I'm using different kind of queries to retrive wikidata info of an entity like, for Berlin: https://www.wikidata.org/wiki/Special:EntityData/Q64.json https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q64&format=json but all of these did…
Luca
  • 848
  • 1
  • 14
  • 33
0
votes
1 answer

Swift: Parsing a JSON file where you don't know the key values

I'm building an app that queries wikidata using json. It works so far, but the issue I'm running into is the response I get from wikidata isn't the actual data, but an identifier. Then, to convert that identifier, I need to send it to another url…
Benjamin B.
  • 521
  • 7
  • 15
0
votes
1 answer

Retrieve Wikipedia page title when performing full text search in Wikidata API

I want to search a term using Wikidata API, and retrieve a list of corresponding entities identifiers and related Wikipedia page titles (if available). I'm currently using the following…
0
votes
1 answer

Access statements of Wikidata entities by id

I would like to know if there's a way to find a Wikidata entity by specified property using their API. This is my request:https://www.wikidata.org/w/api.php?action=wbgetclaims&format=json&entity=Q85670252 Output…