Questions tagged [wikidata]

Wikidata is a free, collaborative, multilingual database, collecting structured data to provide support for Wikipedia, Wikimedia Commons, and the other wikis of the Wikimedia movement. One can retrieve all data using Wikidata Query Service (Wikidata SPARQL endpoint) or Wikidata API (Wikidata MediaWiki API extension). If you are completely new both to SPARQL and MediaWiki API, please consider to ask your question on opendata.stackexchange.com.

Wikidata is a free, collaboratively edited knowledge base operated by the Wikimedia Foundation. It is intended to provide a common source of certain data types (for example, birth dates) which can be used by Wikimedia projects such as Wikipedia. This is similar to the way Wikimedia Commons provides storage for media files and access to those files for all Wikimedia projects.

Concepts:

Wikidata is a document-oriented database, focused around items. Each item represents a topic (or an administrative page used to maintain Wikipedia) and is identified by a unique number, prefixed with the letter Q — for example, the item for the topic Politics is Q7163. This enables the basic information required to identify the topic the item covers to be translated without favouring any one language.

Information is added to items by creating statements. Statements take the form of key-value pairs, with each statement consisting of a property (the key) and a value linked to the property.

Wikidata statement

Further reference:

887 questions
0
votes
1 answer

How to retrieve a list using Wikidata's web API?

I need to simply retrieve this footballers list in JSON format : https://en.wikipedia.org/wiki/List_of_footballers_in_England_by_number_of_league_appearances So i'm trying out this wikidata query ( with the wikidata ID linked to this…
harmonius cool
  • 337
  • 1
  • 2
  • 23
0
votes
0 answers

SPARQL's FILTER() not working as expected

I'm trying to load a list of African countries from Wikidata together with their currency. This is my current query: SELECT DISTINCT ?item $itemLabel ?currency ?currencyLabel ?currencyEndDate WHERE { ?item wdt:P31 wd:Q3624078. …
Jonas Sourlier
  • 13,684
  • 16
  • 77
  • 148
0
votes
0 answers

How can I use SPARQL to "join table A to table B" and take only those rows in B with a MAX value?

The following SPARQL queries Wikidata for all European countries (sovereign states, Q3624078) and loads for each country the last few known population numbers (P:1082 population): SELECT DISTINCT ?item $itemLabel ?population ?popDate WHERE { …
Jonas Sourlier
  • 13,684
  • 16
  • 77
  • 148
0
votes
1 answer

Where / how to get the top 10,000 Wikipedia article titles, by pageview?

I would like to get the top ~10,000 Wikipedia article titles by page views in the English Wiki project. I do not need the pageviews to come with the data. I just need to know that I have the top 10,000 article titles. A list of the top 10,000 would…
Kenzo
  • 307
  • 2
  • 11
0
votes
0 answers

Filtering URL value

What I am trying to do is to select a certain entity for the certain condition. If the condition is url, then how I can make a proper query to get the only result that matches the v1 = "https://www.getmagicbullet.com/" . The commented sentences are…
Keanu Paik
  • 304
  • 2
  • 12
0
votes
0 answers

Filter by predicate attributes

How can I get all chairpersons, which are still holding this job (where the predicate has no end date?). My current version returns all chairpersons: SELECT ?chairperson ?x WHERE { ?university wdt:P488 ?chairperson. }
Querenker
  • 2,242
  • 1
  • 18
  • 29
0
votes
1 answer

What is profile in accept heading of wiki api request

For example, when you perform an call from summary api of wikipedia, there is this header in the request accept:application/json; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/Summary/1.3.7" What is the purpose of this particular…
Loredra L
  • 1,485
  • 2
  • 16
  • 32
0
votes
0 answers

Retrieve a list of top ten highest points on Earth

I need to retrieve a list of top ten highest points on Earth using SPARQL on Wikidata SELECT ?mountain ?mountainLabel WHERE { ?mountain wdt:P31 wd:Q8502. OPTIONAL { ?mountain wdt:P610 ?highest_point. } SERVICE wikibase:label {…
Baris
  • 1
0
votes
1 answer

How to check if a person exists on Wikipedia?

So I need a function. An example input would be like "donald trump" (I don't want it to be case-sensitive) If an article about the person exists on Wikipedia, function returns a summary and a picture. If not returns false Is this even possible? I…
Saadat
  • 163
  • 4
  • 15
0
votes
0 answers

Wikidata structure: how to get Start Times when they are under Point in Time

I ran queries to gain dates of instances of an incident, and used Point in Time (P585). Link SELECT DISTINCT ?incident ?label ?time WHERE { ?incident wdt:P31 wd:Q625994. ?incident rdfs:label ?label. ?incident wdt:P585 ?time. …
belle
  • 87
  • 6
0
votes
0 answers

Want to get only the statement properties excluding Identifier

I want to get all the properties in the statement section in the wikidata page. For example, South Korea there are statement, identifier and reference link (wikipedia or other link) sections respectively. I want to get the statement properties only…
Keanu Paik
  • 304
  • 2
  • 12
0
votes
0 answers

SPARQL query to return a statement qualifiers

I am using the below query to return the details of Google. SELECT ?property ?propertyLabel ?qval (GROUP_CONCAT(DISTINCT ?val_Label; separator="; ") AS ?val_Label) WHERE { ?property a wikibase:Property; wikibase:claim ?p;…
Srini
  • 53
  • 8
0
votes
0 answers

SPARQL - exclude one variable from results for a related variable

I am querying Wikidata with the objective of creating a set of Edinburgh or Glasgow University alumni who are current members of the Scottish Parliament. What I would then like to do is return a list of which other positions of office they have held…
Al Mac
  • 49
  • 1
0
votes
0 answers

SPARQL query - all items

I need the SPARQL query for all items (e.g. eBay (Q58024)) (=result) which have the headquarter location in e.g. San Jose (Q16553) and e.g. the country USA (Q30) (both input). I am completely new so I need an example to get a better…
0
votes
0 answers

Retrieving Property of A Class of Entities In SPARQL (wikidata) Not As Expected

Why does the following query: SELECT ?item ?itemLabel ?o ?oLabel WHERE { ?item wdt:P31 wd:Q3918. ?item wdt:P131 ?o. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } not return…
forgodsakehold
  • 870
  • 10
  • 26