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

"EOFError: Ran out of input" while use Wikipedia Extractor as a parser for Wikipedia Data Dump File

I've tried to convert bz2 to text with "Wikipedia Extractor(https://github.com/attardi/wikiextractor). I've downloaded wikipedia dump with bz2 extension then on command line used this line of code: python Wikiextractor.py -b 85M -o extracted…
stacy1212
  • 3
  • 1
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

How to retrieve all properties of Wikidata ordered by their usage using SPARQL

I found a query retrieving all properties of Wikidata together with property id, label, description and aliases PREFIX bd: PREFIX schema: PREFIX skos: PREFIX…
Flaviu
  • 931
  • 11
  • 16
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
1 answer

string query in Wikidata

I want to find all the reruns of a specific production using a string in the query. I do not get any results. This is the query I am trying: SELECT ?item ?label WHERE { ?item wdt:P5935 ?id; rdfs:label ?label. FILTER(LANG(?label) =…
0
votes
0 answers

Sparql query works on wikidata endpoint but doesn't in JENA interface

I'm trying to create a local model using some information from wikidata, I started with simple queries to test the Jena interface but I found a problem, my queries doesn't show the same results when I use the endpoint www.query.wikidata.org/sparql…
0
votes
1 answer

Get all properties, sub-properties and label IDs from Wikidata item

I am trying to write a query that returns all possible information from a wikidata page, as https://www.wikidata.org/wiki/Q1299. Ideally I would like to retrieve all info that are present in that page in english language. So I am trying this…
0
votes
0 answers

Why this wikidata SPARQL query is missing country information?

This SPARQL query on Wikidata is missing the form of government for a lot of entries. My query: SELECT DISTINCT ?country ?countryLabel (group_concat(DISTINCT ?bfogLabel;separator=", ") as ?Government) WHERE { ?country wdt:P31 wd:Q3624078. …
Chaotic
  • 133
  • 7
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
2 answers

Wikidata/SPARQL, get distinct items (object id) in result

When I run the following query I get multiple rows of "Paul Gauguin" since there are multiple informations about his place/time of death, the same could of course happen on all other parameters as well. SELECT DISTINCT ?item ?itemLabel…
0
votes
1 answer

Wikidata Syntax for Querying commanders of kz dachau

i am new to wikidata and i have tried to query query the start/ end dates of the commander of the kz dachau using sparql. I have following code but i don't get any data. SELECT ?KZ_Dachau ?start ?end ?name WHERE {?KZ_Dachau p:P1037 ?leiter. …
MySt3rY
  • 11
  • 2
0
votes
0 answers

How to find wikidata entries with a property

I am trying to learn sparql by thinking of problems to solve, with a view to one day writing a wikidata bot, whilst I use SQL every day, I find sparql confusing. What I thought I would do is try to list everyone of a first name, that does not have…
back_ache
  • 382
  • 1
  • 13
0
votes
0 answers

Not getting the aggregated results I'm looking from Wikidata sparql query

I'm trying to get some data about Disneyland's hotels and I'm stuck here with architects. On of the hotels has two architects. As you can see I've tried to concatinate architects and group othe selected items. But I'm not getting their labels…
Mg10
  • 29
  • 4
0
votes
1 answer

Categorizing Wikidata Items as a "place"

I'm a little stuck on if a SPARQL query is possible for what I want to do: I get that ?human wdt:P31 wd:Q5 would give me all items that are an instance of human. Is there a similar way to find all items that are an instance of a place (e.g., town,…
0
votes
0 answers

Running SPARQL query against WikiData dump

I have a series of simple but exhaustive SPARQL queries. Running them against public SPARQL endpoint of WikiData results in timeouts. Setting up local instance of WikiData would be serious investment not worth this time. So I started with a simple…
dzieciou
  • 4,049
  • 8
  • 41
  • 85