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

Extracting page text from Wikidata

I might be misunderstanding the point of Wikidata, but I would like to obtain the textual content associated with this Wikipage https://en.wikipedia.org/wiki/Public_holidays_in_Albania which has this associated Wikidata entry…
trajan
  • 1,093
  • 2
  • 12
  • 15
0
votes
0 answers

wikidata SPARQL query to determine if a thing is a museum exponate

Let's say that I have a name. How can I write a sparql query to wikidata to determine if it is a museum exponate? For example this query returns all the items on wikidata matching the name "The PREFIX rdfs:…
cristid9
  • 1,070
  • 1
  • 17
  • 37
0
votes
0 answers

Query Wikidata for all attributes based on name

I want that given an object name, to write a Sparql query which queries Wikidata for all the attributes of the resulted object. For example: SELECT ?thing where { ?thing schema:name "Pyramid"@en } Will return 2…
cristid9
  • 1,070
  • 1
  • 17
  • 37
0
votes
1 answer

How to get labels from wikidata?

I want to use wikidata for MultiLabelClassify. I don't understand the struct of wikidata, I want get all the labels from a entity of wikidata. Could you give me some suggestion?
0
votes
1 answer

How to get Wikidata ID for an entity of a property ? Is there an API available for python?

The MediaWiki API is able to find ID for an item with the request URL: /w/api.php?action=query&format=json&prop=pageprops&titles=skype&formatversion=2&ppprop=wikibase_item The result is: { "batchcomplete": true, "query": { …
Xue Li
  • 1
0
votes
0 answers

JSON decoding error when querying Wikidata

I get a decoding error trying to decode my json data obtained from wikidata. I've read it may be because I'm trying to decode bytes instead of UTF-8 but I've tried to decode into UTF-8 and I can't seem to find the way to do so... Here's my method…
mrkxs
  • 9
  • 1
0
votes
1 answer

How to SPARQL select all living politicians from EU political parties on Wikidata?

Can somebody, please help me write a SPARQL query, which would select all currently living politicians, whose political institutions are from a country within the EU? Currently I have 3 queries, but I don't know how to combine them The first one…
Nils Riga
  • 90
  • 2
  • 15
0
votes
0 answers

Check name of the city on equality/find city not by code

I'm trying to make a system where user can for example write name of the city, like Berlin and maybe he wants to get its population. So, i could not know what certain city he wants so here is a problem that i can't use certain code that (for…
Andrew
  • 145
  • 1
  • 1
  • 6
0
votes
0 answers

How to find the correct property for Wikidata Sparql queries?

How should I find the correct property for a query? Say I want to find all the kings in wikidata. My first attempt was this: SELECT ?king ?kingLabel WHERE { #all result where occupation is king ?king wdt:P106 wd:Q12097. SERVICE…
beatrice
  • 3,684
  • 5
  • 22
  • 49
0
votes
0 answers

sparql query on wikidata

i am very new to sparql and i am trying to run 3 queries on wikidata: Persons who are not painters and who are students of painters. Persons who are not painters and who are academic offspring or children of painters (note: an academic offspring…
0
votes
1 answer

given a name of a person, how to query wikidata properties about this person?

i am doing a mall project in python. i have a table with the columns: "author", "title", "text". What i need is: for a given author name, i want somehow to get a table with the columns: "property", "value", containing the information (rows) about…
anavarro
  • 35
  • 4
0
votes
1 answer

Extract entities from text using Knowledge Bases in Python

I have an entity extraction tasks which needs KBs like wikidata, freebase, DBpedia. Given the huge size of them, it is hard to download and extract entities from them. Is there a python client which can make API calls to get the extractions through…
Amogh Mishra
  • 1,088
  • 1
  • 16
  • 25
0
votes
1 answer

Accessing the properties of an item contained in the value of a parent item

Is it possible to access values of an item which exists in the property of another item. For example in the case of the Matterhorn. There is a property 'significant event' P793. This property's value is the item 'first ascent' Q1194369 which has the…
alkey
  • 986
  • 4
  • 16
  • 33
0
votes
1 answer

Mapping Wikidata QID to Wikipedia CurID

Two questions: How can I map QID from Wikidata to English Wikipedia CurID using dumps? Which dump to use? I am not looking for an API based solution, as I want to generate this mapping for all wikipedia entities.
The Wanderer
  • 3,051
  • 6
  • 29
  • 53
0
votes
1 answer

Show all Wikidata descendants, uniquely

I have the following working query with the aim of showing all subclasses of Q3314483 [1]: SELECT ?item (SAMPLE(?itemLabel) AS ?itemLabel) (SAMPLE(?subclass) as ?subklass) (SAMPLE(?subclassLabel) AS ?subLabel) WHERE { ?item wdt:P279* wd:Q3314483…
mahemoff
  • 44,526
  • 36
  • 160
  • 222