query-45c61370d8452c59c9306dbddbd947b4
: This was what I came up to after fighting the query service, a lot more complicated than what I expected, I’ll try to simplifyGeagea@ Suboptimal solution: second attempt, way shorter : Geagea@
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 ?item {
#
values ?candidate {
# replace with your list of item
wd:Q14084 # redirect to Q68
wd:Q73661 # nonredirect item
}
?candidate owl:sameAs? ?item.
?item wikibase:sitelinks ?nb .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?candidate")
v2("?item"):::projected
v3("?nb")
bind0[/VALUES ?candidate/]
bind0-->v1
bind00(["wd:Q14084"])
bind00 --> bind0
bind01(["wd:Q73661"])
bind01 --> bind0
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"owl:sameAs"--> v2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
end
union0r <== or ==> union0l
end
v2 --"wikibase:sitelinks"--> v3