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
0 answers

Optimizing a SPARQL query

I'm trying to get the details of an organization based on the official website of the company using the below query. It constantly gets timed out. I require all the below fields. Is there a way to optimize it? I understand that OPTIONAL is…
Srini
  • 53
  • 8
0
votes
1 answer

How can I create a SPARQL query on Wikidata that gets all books that have a Project Gutenberg Ebook ID?

I notice that some books on Wikidata have Project Gutenberg ebook IDs. Is it possible to construct a query on the Wikidata Query Service that looks for all books that have this property? I'm new to SPARQL.
Jonathan
  • 10,571
  • 13
  • 67
  • 103
0
votes
1 answer

Set SPARQL of queries from a series of items

I currently have a set of ~100 Wikidata items on artists [Q1234, Q2345, Q3456, ... ] that I have to use in order to extract different properties (place/date of birth/death, labels etc.) I tried iterating through the list and creating a query for…
gabi906
  • 374
  • 1
  • 4
  • 15
0
votes
0 answers

How to get only Wikidata wdt (or other) predicates for an item via SPARQL?

Very new to this, so might have some terms wrong. I want to get a subset of triples for an entity (or entities). For example, this gives me 856 (as of now) triples for these two entities, including some labels and also /prop/direct/,…
joshl
  • 21
  • 3
0
votes
0 answers

How to query wikidata by name (fuzzysearch) and third-parties ID

I wish to leverage on wikidata (and learning a bit Sparql if necessary) for entity matching, and want to: query an entity by its name AND by name of a list of properties (both fuzzysearch) => so to be sure in case of disambiguations! (CATS as cats,…
user305883
  • 1,635
  • 2
  • 24
  • 48
0
votes
0 answers

Federated SPARQL query in dbpedia and wikidata: Few questions

I have following query: # endpoint used: https://query.wikidata.org/ # # PREFIX wd: # PREFIX wdt: PREFIX dbo: PREFIX dbp:…
RoRu
  • 15
  • 7
0
votes
0 answers

Accuracy of wbsearchentities in wikidata API

I am currently using the MediaWiki API (through SPARQL SERVICE wikidata:mwapi) to query entities from Wikidata, using the wbsearchentities endpoint. However, I have noticed that the search results are not that good (example searching for charlton or…
0
votes
1 answer

Select one publication date matching a given place of publication using wikidata + SPARQL for a given film

I'm trying to understand how to select one publication date from a list of place of publications from wikidata using SPARQL. I have a query that I think is close but I'm looking for some help in narrowing it down. What I have so far is the…
Damon Snyder
  • 1,362
  • 1
  • 11
  • 18
0
votes
1 answer

SPARQL query for finding films originating from and released in the United States

I have the following SPARQL query that appears to correctly produce the films produced in the US (country of origin) and released in the US (place of publication) in 2018. The issue I'm having is that one row is produced for each release even though…
Damon Snyder
  • 1,362
  • 1
  • 11
  • 18
0
votes
0 answers

Apparently simple Wikidata SPARQL filter query is slow

Absolute Wikidata and SPARQL beginner here. I am trying to find out the Q code of a particular female name, say Jennifer. I can get it with a query like this: SELECT ?name WHERE { ?name wdt:P31 wd:Q11879590. ?name rdfs:label ?label. …
Stefano
  • 251
  • 1
  • 9
0
votes
2 answers

How to check if a table sub-field exist in Lua?

I'm trying to use Wikidata's Lua models. I need to search for a specific ID in Wikidata's entities : subjectitemofthisproperty = 'Q' .. tostring( entity['claims']['P1629'][1]["mainsnak"]["datavalue"]["value"]["numeric-id"] ) The main problem is…
Xiiryo
  • 3,021
  • 5
  • 31
  • 48
0
votes
1 answer

Automatically assign Wikidata URIs to a list of names

I have a list a plant names in various languages (botanical names; English, German and loads of historical variants of these two languages) in XML (however, transforming it into whatever serialization won't be a problem). This is what it looks like…
0
votes
1 answer

Get categories from Wikipedia:Vital articles

I'm trying to get a "category tree" from wikipedia for a project I'm working on. The problem is I only want more common topics and fields of study, so the larger dumps I've been able to find have way too many peripheral articles included. I recently…
M.K.
  • 3
  • 2
0
votes
0 answers

List sub properties of a property from Wikidata

this is probably an easy one, and asked before but I couldnt find anything to help me on here or elsewhere online, man this syntax is messing with me! I want to get subpropeties of a property. so lets keep it simple with my man Bernie Sanders…
0
votes
0 answers

Wikidata Query list of languages spoken in a city

Can't seem to figure this out I want to generate a list from wiki data that shows all the languages found in a city E.G South African languages and their locations Country Language Province South Africa --- Afrikaans --------…
24thDan
  • 113
  • 1
  • 9