Questions tagged [wikidata-query-service]

Wikidata Query Service (WDQS) is a SPARQL endpoint that allows to publicly access to Wikidata's database.

Wikidata Query Service (WDQS) is a SPARQL public endpoint that allows to access to Wikidata's database.

It is accessible via:

Further documentation:

160 questions
3
votes
0 answers

OPTIONAL not working with SPARQL query on local YASGUI editor

I am once again having trouble with SPARQL. First off, a bit of background information: I have been using the Wikidata Query Service to retrieve data from Wikidata. As the Wikidata SPARQL endpoint is limited and timeouts occur for large tasks, I…
3
votes
1 answer

Duplicated results from Wikidata

I created the following SPARQL query to Wikidata. And the result of this query are records related to states in Germany. But as you can see, results are occurring four times in a row (you can test it here: https://query.wikidata.org/). I supposed…
chuckk
  • 33
  • 6
3
votes
0 answers

Retrieving labels when concatenating in a Wikidata SPARQL query

I am having an issue when concatenating in SPARQL using the Wikidata Query Service. https://query.wikidata.org/ What I want to do is retrieve all persons with a GTAA ID (?q wdt:P1741 ?GTAA_ID.) and specifically persons who have an occupation listed…
John
  • 61
  • 3
3
votes
1 answer

Wikidata:SPARQL, Soccer players number of games

I used this query at https://query.wikidata.org/ -- SELECT ?p ?pLabel (?oc as ?OC) (?sp as ?SP) WHERE { ?p wdt:P106/wdt:P279* wd:Q937857. # Soccer player SERVICE wikibase:label {bd:serviceParam wikibase:language "en" . } …
Not Me
  • 43
  • 3
3
votes
1 answer

How to project additional variables from SPARQL aggregates

I would like to know the most recent population of Swiss municipalities with the help of Wikidata. To get the ones which have the preferred rank would be easy but not helpful. I have the following SPARQL query but now I have the problem to project…
3
votes
1 answer

Problems getting all film titles from Wikidata using SPARQL

I'm trying to retrieve ALL movie titles, with their aliases. I'm using queries like these (with increasing OFFSET) and at first it seems to work: SELECT ?itemLabel ?itemAltLabel WHERE { ?item wdt:P31 wd:Q11424. SERVICE wikibase:label {…
Andrei O
  • 325
  • 3
  • 9
3
votes
2 answers

Get itemlabel in python from Wikidata API

I am trying to create a list with all Harry Potter characters names using the Wikidata API. I want to get itemlabels (character names) from the link below into my Python notebook. Here is the Wikidata Query Service query which runs as I want. import…
zfa
  • 105
  • 1
  • 2
  • 7
2
votes
1 answer

Wikidata query: how to get the "proportion" values under "owned by" property?

I need help with a query on query.wikidata.org. I'm trying to find a solution how to get the "proportion" (P1107) values under "owned by" (P127) property. For example for Audi (Q23317), which is owned by the Volkswagen Group, the proportion value…
Z_98765
  • 21
  • 1
2
votes
1 answer

Unexpected missing value from Wikidata query

I'm using the Wikidata query service to learn the SPARQL query language. I'm trying to get information on countries and their identifying information. Here is a simple query which is intended to return a list of countries…
Dan Lenski
  • 76,929
  • 13
  • 76
  • 124
2
votes
0 answers

How to find all related entities of another entity in Wikidata by SPARQL?

I want to find all entities related to another entity in wikidata, say matthew effect. How to query by SPARQL?
olo
  • 133
  • 1
  • 7
2
votes
0 answers

Format dates based on date precision

I am using Wikidata Query Service to get the dates of population of some places. The output gives a raw result in the format 2010-01-01T00:00:00Z (as an example). I have also retrieved the date precision of each date. The query results display the…
JAT86
  • 997
  • 12
  • 24
2
votes
1 answer

Retrieve latitude and longitude of a sample of coordinates from Wikidata using SPARQL

I am trying to retrieve samples of coordinates in Wikidata via SPARQL but am having a very difficult time trying to achieve it. I would want to get only a single pair of coordinates per place and display the result in a column, and the latitude and…
JAT86
  • 997
  • 12
  • 24
2
votes
1 answer

How to search a list of Wikidata IDs and return the P31 ("instance of") property using SPARQL?

How do I get the instance type(s) (i.e., property=P31 and associated labels) for multiple Wikidata IDs in a single query? Ideally, I want to output a list with the columns: Wikidata ID | P31 ID | P31 Label, with multiple rows used if a Wikidata ID…
cookie1986
  • 865
  • 12
  • 27
2
votes
0 answers

Display qualifier value as column and display only a single unique item

I am trying to get some municipalities and their population (P1082) over the years using SPARQL in Wikidata. The query I am using works, but I do not know how to convert the years of the population figures into columns, so that I only have a single…
JAT86
  • 997
  • 12
  • 24
2
votes
1 answer

How to return null results in SPARQL?

I'm using the Wikidata SPARQL Query Service with the following query: SELECT ?item ?itemLabel ?class ?classLabel ?projectLabel WHERE { VALUES ?item { wd:Q1 wd:Q367204 } ?item wdt:P31 ?class; wdt:P18 ?project. SERVICE wikibase:label {…
Bob van Luijt
  • 7,153
  • 12
  • 58
  • 101
1
2
3
10 11