Questions tagged [wdqs]
14 questions
2
votes
0 answers
How to define the triplets a SPARQL query consider during its execution? (creating self-contained examples)
Prologue
In SQL, it is possible to define the data a SELECT statement consider during its execution. I call these type of examples "self-contained examples" because they create the data the query runs on. The following are two examples of such…

rdrg109
- 265
- 1
- 8
2
votes
1 answer
Query to get first 3 images in Wikidata page
I'm trying to query data from species' pages on Wikidata with the following query :
SELECT ?animal ?animalLabel ?iucncode ?photo WHERE {
VALUES ?iucncode { "714" }
?animal wdt:P627 ?iucncode
OPTIONAL {
?animal wdt:P18 ?photo.
}
SERVICE…

GuitarExtended
- 787
- 2
- 11
- 32
2
votes
2 answers
Wikidata api how to get some attributes based on wikipedia page id
So i have this page id 12517871: https://fr.wikipedia.org/wiki?curid=12517871
I would like to get the identifiers from the bottom here https://www.wikidata.org/wiki/Q64007200
Using sparql, but i don't know how to do so.
I know i must use something…

user3416510
- 83
- 1
- 8
2
votes
1 answer
How to get all properties for only a specific category in Wikidata?
Is there an RDF data/other format that allow me to get all the properties that can exist in a category e.g. Person, then I should be returned properties like sex, date of birth.
How to query this information at https://query.wikidata.org/ ?
What I…

William
- 5,526
- 6
- 20
- 42
2
votes
1 answer
Wikidata SPARQL returns too many results
This is the query that can be executed in https://query.wikidata.org, I am supposed to get only 17 values, but it returns 289 results (17 * 17 = 289).
I want to get property value with its unit. I am specifying wdt:P2573 just to demonstrate the…

William
- 5,526
- 6
- 20
- 42
2
votes
1 answer
Capitalize the first letter of a result set
I have this SPARQL code that is meant to work on Wikidata:
SELECT
?game
(group_concat(distinct ?gameLabel ; separator = ", ") AS ?gameLabels)
(group_concat(distinct ?genreLabel ; separator = ", ") AS ?genreLabels)
WHERE {
…

posfan12
- 2,541
- 8
- 35
- 57
1
vote
1 answer
Get image summary with Wikidata SPARQL
I get some images from Wikidata, but I would like to get more information about the image.
By example, I get the image from Paris (Try it!):
SELECT ?itemLabel ?wdLabel ?ps_Label ?wdpqLabel ?pq_Label WHERE {
VALUES ?item { wd:Q90 }
?item p:P18…

Guylan DIEU
- 111
- 8
1
vote
1 answer
Identify entity of a Wikipedia page
My question is related to a similar question/comment which unfortunately never received an answer.
Given a list of multiple Wikipedia pages,…

meier_flo
- 136
- 9
1
vote
1 answer
BINDing to inlined data provided by VALUES, and braces
I tried the following query on WDQS:
SELECT ?item ?itemLabel ?string ?StringLabel ?iri ?iriLabel
WHERE {
VALUES ?item { wd:Q1339 }
BIND( STR(?item) AS ?string ).
BIND( IRI(?string) AS ?iri ).
SERVICE wikibase:label { bd:serviceParam…

CXuesong
- 552
- 5
- 12
0
votes
1 answer
SPARQL query to get several informations from a given wiki-ID
I have the information from several authors in a table. In this table, a column contains the wiki-id for each author. I want to use the wiki-ids to get further information, such as gender, place of birth, place of death, etc. My plan is to use a…

José
- 533
- 1
- 4
- 14
0
votes
0 answers
recover as humans from Wikidata the discoverers of the chemical elements?
I want to retrieve the discoverers of chemical elements, i have done this:
prefix wd:
prefix rdfs:
prefix wdt:
prefix wde:…

DamagedCyborg
- 3
- 3
0
votes
1 answer
Why the results are diffrent in SPARQLWrapper and Wikidata query editor in sparql
I am using the following sparql query in wikidata query editor:
SELECT ?s ?p WHERE {?s ?p wd:Q22673982 .}
Link to the query editor: https://w.wiki/5E7
I am getting 40 records for the above query.
However, when I try to do the same in python using…

EmJ
- 4,398
- 9
- 44
- 105
0
votes
1 answer
WDQS - Query is malformed
I started today with WDQS, so sorry if I'm missing something obvious
I'm trying to get all items that are an instance of Q9143 (programing language)
PREFIX wd:
SELECT ?item
WHERE
{
?item wd:Q9143
}
Error: Query…

nanquim
- 1,786
- 7
- 32
- 50
0
votes
0 answers
Inconsistent Wikidata query results
In Wikidata, Russia is marked as both instance of "sovereign state" (Q3624078) and instance of "country" (https://www.wikidata.org/wiki/Q159).
A SPARQL request to https://query.wikidata.org/ with the "sovereign state" in its condition returns…

gisly
- 673
- 1
- 8
- 30