query-263266dde15121b7e42358882b613caa
14:01, 15 December 2022 (UTC) pagetalk / TomT0m author (the optimiser needs to be hinted that "wikibase:sitelinks" is a way to big predicate to start with when there is several value, otherwise it timeouts) 17:05, 15 December 2022 (UTC)) talk (Geagea the ons that are redirect. or b. simply give me the ones that are not redirect. ora. in two columns. the original Q id and the redirect Q id . But the point is that I need also the original Q. I need that the output be:https://w.wiki/67Sp thanks. I have tried also TomT0m@ May I ask what you want to do with that in the end ? Geagea@I’m not sure I understand very well your needs, so it might be simpler if you gave your end goal, potentially it would save time to us all if there is a more direct solution you did not thought about, and would save us all headeaches :) But if I understood well this is what you seem to be looking for, just add a column to my query
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
select ?candidate ?item {
#
values ?candidate {
# replace with your list of item
wd:Q5991982 #redirect to Q488
wd:Q488
wd:Q13055412 #redirect to Q1008
wd:Q19747477 #redirect to Q1008
wd:Q19746706 #redirect to Q1008
}
?candidate owl:sameAs? ?item.
?item wikibase:sitelinks ?nb .
}