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

Can spaCy link only named entities?

Here's excerpt from a (supposedly) funny review of a restaurant: I'd like to personally shake Mr Tofu's hand. While I cannot medically prove it, I am 100% certain that their soondubu contains undefined healing properties. Some how some way, I…
dzieciou
  • 4,049
  • 8
  • 41
  • 85
0
votes
1 answer

Wikidata entries that can't be retrieved by SPARQL queries?

I am trying to run a simple query, looking up an item by its English label. For some reason, some entries are not showing. Most are fine, but some aren't. I can't pinpoint why. An example: oyster bed. Here is the entry:…
Vadim Berman
  • 1,932
  • 1
  • 20
  • 39
0
votes
2 answers

How to access wikidata revision history?

Is there a way to access wikidata revision history page using SPARQL or wikimedia-API for the Item Eden Hazard (Q214204) as an example, to get the latest and oldest timestamps values?
user5721551
0
votes
1 answer

Retrieving all Wikipedia articles about people

I'm trying to retrieve all articles from Wikipedia that are about people. More specifically, I'm looking for: only the page title (and perhaps the page ID) of articles that are about people, separated by gender (for the sake of simplicity, male and…
vvye
  • 1,208
  • 1
  • 10
  • 25
0
votes
0 answers

Python: select Wikipedia pages of locations and places using Wikidata

I have a list of Wikipedia pages related to some entities and I want to select only geographical places and locations (cities, provinces, but also regions, mountains, rivers and so on). I can easily select pages with coordinates but this is not…
0
votes
0 answers

sparql query group by optional param

Query: select instance of human whose profession is singer/musician wd:Q177220 (Singer) wd:Q639669 (Musician) SELECT DISTINCT ?human ?humanLabel ?genre ?genreLabel WHERE { VALUES ?professions { wd:Q177220 wd:Q639669 } ?human wdt:P31…
Puni
  • 1,214
  • 2
  • 18
  • 34
0
votes
0 answers

How to simplify JSON result for SPARQL queries

I'm querying Wikidata using SPARQLWrapper. The JSON result I'm receiving has this structure: "title":{"xml:lang":"en","type":"literal","value":"natural language processing"} I would like to get a simple JSON result with only the 'value'…
kambi
  • 3,291
  • 10
  • 37
  • 58
0
votes
1 answer

Sitelinks for files on commons.wikimedia: is it possible to query them with SPARQL or API?

I know how to query sitelinks for wikidata items with SPARQL (see below), is there some similar way to get sitelinks for files on commons.wikimedia? For example, if we open this image info page, at the bottom of the page we have two lists "File…
0
votes
0 answers

How to get Links from Wikivoyage Json extract

Given the Wikivoyage page: https://en.wikivoyage.org/wiki/Flores_(Indonesia) There is a section called "Cities" which is a list that links to other pages within Wikivoyage. Using the API to retrieve the JSON:…
James
  • 458
  • 1
  • 6
  • 18
0
votes
0 answers

Get correct image from Wikidata

I use the following query: SELECT DISTINCT (SAMPLE(?image)as ?image) ?item ?itemLabel ?itemDescription (SAMPLE(?DR) AS ?DRSample) (SAMPLE(?article) AS ?articleSample) WHERE{ ?article schema:about ?item ; schema:inLanguage "en" ;…
Alexan
  • 8,165
  • 14
  • 74
  • 101
0
votes
1 answer

extracting data from wikipedia soccer player infoboxes

I want to retrieve informations from soccer player wikipedia inforboxes with the following properties (name, team, team number, apperances, goals) using the URIs returned by this wikidata query: SELECT ?SoccerPlayer ?SoccerPlayerLabel ?Team…
amine4392
  • 79
  • 6
0
votes
0 answers

Retrieve wikidata related data entities from wikipedia

I used this request to retrieve soccer players and some of their properties (name, team, team number, apperances, goals) since the last two years: SELECT ?SoccerPlayer ?SoccerPlayerLabel ?Team ?TeamLabel ?TeamNumber ?numMatches ?numGoals ?startTime…
amine4392
  • 79
  • 6
0
votes
0 answers

list of all soccer players from wikidata since 1 August 2019

I tried to get soccer players from wikidata since 1 August 2019 with additional information (name, team, team number, apperances, goals) from wikidata with this query: SELECT ?SoccerPlayerLabel (group_concat(distinct ?TeamLabel;separator=", ") as…
amine4392
  • 79
  • 6
0
votes
0 answers

How to follow a path depend on qualifier SPARQL

I like to query out all people who is connected to each other but filter by qualifier value of the path For example, the query below will get all human related to Putin. But his spouse, whose in statement get the qualifier "endtime" should not be…
Loredra L
  • 1,485
  • 2
  • 16
  • 32
0
votes
1 answer

ETIMEDOUT error on wikidata api call using request promise

Below is the snippet of nodejs to call wikidata api using request-promise module var rp = require('request-promise'); var wikidataURL="http://www.wikidata.org/w/api.php?action=wbgetentities&props=labels|claims&languages=en&format=json&ids=Q1" …
Loredra L
  • 1,485
  • 2
  • 16
  • 32