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
26
votes
2 answers

How to extract information from a Wikipedia infobox?

There is this fancy infobox in . How do I get the value of ?
Tgr
  • 27,442
  • 12
  • 81
  • 118
25
votes
3 answers

How to get Wikidata ID for an Wikipedia article by API?

How to obtain Wikidata ID from English Wikipedia article name, also for redirects? Is there API call? Example: Karachi >> Q8660 Karaachi >> Q8660 How to approach changes in assignment? Now Media in Karachi is redirect to Media of Pakistan (Wikidata…
Shoussi Elbril
  • 261
  • 3
  • 5
22
votes
4 answers

How to query Wikidata items using its labels?

How can I query Wikidata to get all items that have labels contain a word? I tried this but didn't work; it retrieved nothing. SELECT ?item ?itemLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "en". ?item…
fattah.safa
  • 926
  • 2
  • 14
  • 36
21
votes
4 answers

How to get Wikipedia page from Wikidata Id?

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,…
Patrick
  • 2,577
  • 6
  • 30
  • 53
21
votes
3 answers

Wikidata entity value from name

Is there a way to get Wikidata page information based on the name of the entity for example if I wanted to get page data for Google. I think it has to be done using "entity" with the corresponding entity value however I am not sure of there is any…
Oroku
  • 443
  • 1
  • 3
  • 15
18
votes
3 answers

Querying WikiData, difference between p and wdt default prefix

I am new to wikidata and I can't figure out when I should use --> wdt prefix (http://www.wikidata.org/prop/direct/) and when I should use --> p prefix (http://www.wikidata.org/prop/). in my sparql queries. Can someone explain what each of these…
Bahar
  • 770
  • 5
  • 18
17
votes
1 answer

Freebase / DBpedia / wikidata.org -- differences

I'm looking to enhance several "objects" in my application with human-readable data. To that end, I've seen Freebase, DBpedia and wikidata.org, and am currently working with Freebase. I can't help but wonder, though, what I am missing. So: what's…
Nitzan Shaked
  • 13,460
  • 5
  • 45
  • 54
15
votes
2 answers

Wikidata results sorted by something similar to a PageRank

In Wikidata (Wikidata SPARQL endpoint), is there a way to order the SPARQL query results with something like a PageRank? SELECT DISTINCT ?entity ?entityLabel WHERE { ?entity wdt:P31 wd:Q5. SERVICE wikibase:label { bd:serviceParam…
jordipala
  • 193
  • 7
14
votes
3 answers

Getting readable results from Wikidata

Ok so I'm trying to get information from Wikidata about movies, take this movie for example: https://www.wikidata.org/wiki/Q24871 On the page the data is clearly displayed in a readable format, however when you trying to extract it via the API you…
Oliver at ontoit
  • 185
  • 1
  • 2
  • 13
12
votes
3 answers

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

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…
Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
11
votes
1 answer

wikidata get all properties with labels and values of an item

My question is how I can extract all properties and their respective labels that are also rendered on the webpage from wikidata preferably over SPARQL. Take for example the Google entry on wikidata. For the property P414 (stock exchange) or P159…
MrKaikev
  • 215
  • 3
  • 10
11
votes
1 answer

What does slash mean in a SPARQL property path?

In one of the samples for querying Wikidata, I found the following query, which includes p:P6/v:P6 in the line after SELECT. What does it mean? PREFIX wd: PREFIX wdt: PREFIX…
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
10
votes
1 answer

How to query Wikidata for "also known as"

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…
Junge
  • 437
  • 6
  • 14
10
votes
2 answers

How to get Wikidata labels in more than one language?

I'm traying to get the regions of Italy in both Italian and English. I can get then in one laguage with this query... PREFIX wikibase: PREFIX wd: PREFIX wdt:…
Ivo Velitchkov
  • 2,361
  • 11
  • 21
10
votes
3 answers

How to find a Wikidata entity by property?

I would like to know, is there a way to find a Wikidata entity by specified property using their API. For example, there are plenty entities that have Freebase ID property (Property:P646). It's unique identifier and I want to get an entity by this…
Ihor
  • 277
  • 4
  • 16
1
2 3
59 60