query-4d2679291fb1f5aae922e4b755fc0eee
Get sitelinks for list of itemsI am trying to add (optional) Wikipedia sitelinks to a list of people for an article writing contest. The base query is:
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?image ?birthDate ?deathDate ?birthPlaceLabel ?deathPlaceLabel ?citizenshipLabel WHERE {
VALUES (?item) {
(wd:Q2059942)(wd:Q1894824)(wd:Q28503684)(wd:Q6773400)(wd:Q6698168)(wd:Q89137)(wd:Q584832)
(wd:Q11708569)(wd:Q2802434)(wd:Q2278761)(wd:Q226122)(wd:Q31819218)(wd:Q32786159)
(wd:Q27452283)(wd:Q254858)(wd:Q2377908)(wd:Q12279745)(wd:Q12274957)(wd:Q20717303)
(wd:Q159876)(wd:Q3574447)(wd:Q3065252)(wd:Q6417417)(wd:Q19830022)(wd:Q1496757)
(wd:Q19593654)(wd:Q233584)(wd:Q7145701)(wd:Q20268943)(wd:Q20732235)(wd:Q15731842)
(wd:Q15733755)(wd:Q18001239)(wd:Q459081)(wd:Q457705)(wd:Q9026469)(wd:Q127328)
(wd:Q20795960)(wd:Q13574559)(wd:Q4225202)(wd:Q5441759)(wd:Q3393862)(wd:Q5697580)
(wd:Q12017742)(wd:Q12756492)(wd:Q1136761)(wd:Q16429109)(wd:Q18706087)(wd:Q1568145)
(wd:Q17627766)(wd:Q970044)(wd:Q457418)(wd:Q6485256)(wd:Q5414994)(wd:Q19893493)
(wd:Q19892940)(wd:Q4117209)(wd:Q24285964)(wd:Q782501)(wd:Q18001140)(wd:Q7934819)
(wd:Q1226805)(wd:Q16732998)(wd:Q22583016)(wd:Q526932)(wd:Q51772)(wd:Q853932)(wd:Q949744)
(wd:Q6558163)(wd:Q20717409)(wd:Q6288450)(wd:Q281501)(wd:Q32786223)(wd:Q354476)(wd:Q69810)
(wd:Q32638574)(wd:Q267335)(wd:Q32640912)(wd:Q18207033)(wd:Q5252903)(wd:Q5363475)
(wd:Q27978652)(wd:Q23701408)(wd:Q32655397)(wd:Q32663033)(wd:Q32662312)(wd:Q1907896)
(wd:Q30583472)(wd:Q553943)(wd:Q2967768)(wd:Q26436220)(wd:Q12326428)(wd:Q26791455)
(wd:Q12040314)(wd:Q4980986)(wd:Q4173120)(wd:Q936422)(wd:Q94108)(wd:Q538068)(wd:Q242608)
}
OPTIONAL { ?item wdt:P18 ?image . }
OPTIONAL { ?item wdt:P19 ?birthPlace . }
OPTIONAL { ?item wdt:P20 ?deathPlace . }
OPTIONAL { ?item wdt:P569 ?birthDate . }
OPTIONAL { ?item wdt:P570 ?deathDate . }
#OPTIONAL { ?place wdt:P625 ?coord . }
OPTIONAL { ?item wdt:P625 ?coord . }
OPTIONAL { ?item wdt:P27 ?citizenship . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?birthDate"):::projected
v3("?birthPlace")
v8("?citizenship")
v7("?coord")
v6("?deathDate"):::projected
v4("?deathPlace")
v2("?image"):::projected
v1("?item"):::projected
c9(["bd:serviceParam"]):::iri
c11(["en"]):::literal
bind0[/VALUES ?item/]
bind0-->v1
bind00(["wd:Q2059942"])
bind00 --> bind0
bind01(["wd:Q1894824"])
bind01 --> bind0
bind02(["wd:Q28503684"])
bind02 --> bind0
bind03(["wd:Q6773400"])
bind03 --> bind0
bind04(["wd:Q6698168"])
bind04 --> bind0
bind05(["wd:Q89137"])
bind05 --> bind0
bind06(["wd:Q584832"])
bind06 --> bind0
bind07(["wd:Q11708569"])
bind07 --> bind0
bind08(["wd:Q2802434"])
bind08 --> bind0
bind09(["wd:Q2278761"])
bind09 --> bind0
bind010(["wd:Q226122"])
bind010 --> bind0
bind011(["wd:Q31819218"])
bind011 --> bind0
bind012(["wd:Q32786159"])
bind012 --> bind0
bind013(["wd:Q27452283"])
bind013 --> bind0
bind014(["wd:Q254858"])
bind014 --> bind0
bind015(["wd:Q2377908"])
bind015 --> bind0
bind016(["wd:Q12279745"])
bind016 --> bind0
bind017(["wd:Q12274957"])
bind017 --> bind0
bind018(["wd:Q20717303"])
bind018 --> bind0
bind019(["wd:Q159876"])
bind019 --> bind0
bind020(["wd:Q3574447"])
bind020 --> bind0
bind021(["wd:Q3065252"])
bind021 --> bind0
bind022(["wd:Q6417417"])
bind022 --> bind0
bind023(["wd:Q19830022"])
bind023 --> bind0
bind024(["wd:Q1496757"])
bind024 --> bind0
bind025(["wd:Q19593654"])
bind025 --> bind0
bind026(["wd:Q233584"])
bind026 --> bind0
bind027(["wd:Q7145701"])
bind027 --> bind0
bind028(["wd:Q20268943"])
bind028 --> bind0
bind029(["wd:Q20732235"])
bind029 --> bind0
bind030(["wd:Q15731842"])
bind030 --> bind0
bind031(["wd:Q15733755"])
bind031 --> bind0
bind032(["wd:Q18001239"])
bind032 --> bind0
bind033(["wd:Q459081"])
bind033 --> bind0
bind034(["wd:Q457705"])
bind034 --> bind0
bind035(["wd:Q9026469"])
bind035 --> bind0
bind036(["wd:Q127328"])
bind036 --> bind0
bind037(["wd:Q20795960"])
bind037 --> bind0
bind038(["wd:Q13574559"])
bind038 --> bind0
bind039(["wd:Q4225202"])
bind039 --> bind0
bind040(["wd:Q5441759"])
bind040 --> bind0
bind041(["wd:Q3393862"])
bind041 --> bind0
bind042(["wd:Q5697580"])
bind042 --> bind0
bind043(["wd:Q12017742"])
bind043 --> bind0
bind044(["wd:Q12756492"])
bind044 --> bind0
bind045(["wd:Q1136761"])
bind045 --> bind0
bind046(["wd:Q16429109"])
bind046 --> bind0
bind047(["wd:Q18706087"])
bind047 --> bind0
bind048(["wd:Q1568145"])
bind048 --> bind0
bind049(["wd:Q17627766"])
bind049 --> bind0
bind050(["wd:Q970044"])
bind050 --> bind0
bind051(["wd:Q457418"])
bind051 --> bind0
bind052(["wd:Q6485256"])
bind052 --> bind0
bind053(["wd:Q5414994"])
bind053 --> bind0
bind054(["wd:Q19893493"])
bind054 --> bind0
bind055(["wd:Q19892940"])
bind055 --> bind0
bind056(["wd:Q4117209"])
bind056 --> bind0
bind057(["wd:Q24285964"])
bind057 --> bind0
bind058(["wd:Q782501"])
bind058 --> bind0
bind059(["wd:Q18001140"])
bind059 --> bind0
bind060(["wd:Q7934819"])
bind060 --> bind0
bind061(["wd:Q1226805"])
bind061 --> bind0
bind062(["wd:Q16732998"])
bind062 --> bind0
bind063(["wd:Q22583016"])
bind063 --> bind0
bind064(["wd:Q526932"])
bind064 --> bind0
bind065(["wd:Q51772"])
bind065 --> bind0
bind066(["wd:Q853932"])
bind066 --> bind0
bind067(["wd:Q949744"])
bind067 --> bind0
bind068(["wd:Q6558163"])
bind068 --> bind0
bind069(["wd:Q20717409"])
bind069 --> bind0
bind070(["wd:Q6288450"])
bind070 --> bind0
bind071(["wd:Q281501"])
bind071 --> bind0
bind072(["wd:Q32786223"])
bind072 --> bind0
bind073(["wd:Q354476"])
bind073 --> bind0
bind074(["wd:Q69810"])
bind074 --> bind0
bind075(["wd:Q32638574"])
bind075 --> bind0
bind076(["wd:Q267335"])
bind076 --> bind0
bind077(["wd:Q32640912"])
bind077 --> bind0
bind078(["wd:Q18207033"])
bind078 --> bind0
bind079(["wd:Q5252903"])
bind079 --> bind0
bind080(["wd:Q5363475"])
bind080 --> bind0
bind081(["wd:Q27978652"])
bind081 --> bind0
bind082(["wd:Q23701408"])
bind082 --> bind0
bind083(["wd:Q32655397"])
bind083 --> bind0
bind084(["wd:Q32663033"])
bind084 --> bind0
bind085(["wd:Q32662312"])
bind085 --> bind0
bind086(["wd:Q1907896"])
bind086 --> bind0
bind087(["wd:Q30583472"])
bind087 --> bind0
bind088(["wd:Q553943"])
bind088 --> bind0
bind089(["wd:Q2967768"])
bind089 --> bind0
bind090(["wd:Q26436220"])
bind090 --> bind0
bind091(["wd:Q12326428"])
bind091 --> bind0
bind092(["wd:Q26791455"])
bind092 --> bind0
bind093(["wd:Q12040314"])
bind093 --> bind0
bind094(["wd:Q4980986"])
bind094 --> bind0
bind095(["wd:Q4173120"])
bind095 --> bind0
bind096(["wd:Q936422"])
bind096 --> bind0
bind097(["wd:Q94108"])
bind097 --> bind0
bind098(["wd:Q538068"])
bind098 --> bind0
bind099(["wd:Q242608"])
bind099 --> bind0
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P18".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P19".-> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P20".-> v4
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P569".-> v5
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P570".-> v6
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P625".-> v7
end
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P27".-> v8
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end