query-17cb730c7507cb8201dd0a1219fe18fe
rq turtle/ttl
by CamelCaseNick
select (replace(str(?stolperstein), str(wd:), "") as ?qid) ("Dde" as ?pid) (concat("\"", ?description, "\"") as ?vid) where {
values (?city ?quarterClass ?prefix ?conn) {
(wd:Q1055 wd:Q15830667 "Hamburg-" wdt:P276)
(wd:Q64 wd:Q35034452 "Berlin-" wdt:P276)
(wd:Q24879 wd:Q17278559 "Bremen-" wdt:P131)
(wd:Q365 wd:Q15632166 "Köln-" wdt:P131)
(wd:Q1718 wd:Q1852178 "Düsseldorf-" wdt:P131)
(wd:Q1022 wd:Q2740635 "Stuttgart-" wdt:P131)
(wd:Q1720 wd:Q26703203 "Mainz-" wdt:P131)
(wd:Q1794 wd:Q79416466 "Frankfurt-" wdt:P131)
}
?stolperstein wdt:P31 wd:Q26703203; wdt:P131+ ?city; ?conn ?quarter.
filter exists { ?quarter wdt:P31 ?quarterClass. }
?quarter rdfs:label ?qDe. filter(lang(?qDe) = "de")
bind(concat("Stolperstein in ", if(strstarts(?qDe, ?prefix), "", ?prefix), ?qDe) as ?description)
optional { ?stolperstein schema:description ?de. filter(lang(?de) = "de") }
filter not exists { ?stolperstein schema:description ?de. filter(lang(?de) = "de") }
}
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
#by CamelCaseNick
select (replace(str(?stolperstein), str(wd:), "") as ?qid) ("Dde" as ?pid) (concat(""", ?description, """) as ?vid) where {
values (?city ?quarterClass ?prefix ?conn) {
(wd:Q1055 wd:Q15830667 "Hamburg-" wdt:P276)
(wd:Q64 wd:Q35034452 "Berlin-" wdt:P276)
(wd:Q24879 wd:Q17278559 "Bremen-" wdt:P131)
(wd:Q365 wd:Q15632166 "Köln-" wdt:P131)
(wd:Q1718 wd:Q1852178 "Düsseldorf-" wdt:P131)
(wd:Q1022 wd:Q2740635 "Stuttgart-" wdt:P131)
(wd:Q1720 wd:Q26703203 "Mainz-" wdt:P131)
(wd:Q1794 wd:Q79416466 "Frankfurt-" wdt:P131)
}
?stolperstein wdt:P31 wd:Q26703203; wdt:P131+ ?city; ?conn ?quarter.
filter exists { ?quarter wdt:P31 ?quarterClass. }
?quarter rdfs:label ?qDe. filter(lang(?qDe) = "de")
bind(concat("Stolperstein in ", if(strstarts(?qDe, ?prefix), "", ?prefix), ?qDe) as ?description)
optional { ?stolperstein schema:description ?de. filter(lang(?de) = "de") }
filter not exists { ?stolperstein schema:description ?de. filter(lang(?de) = "de") }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?city")
v8("?conn")
v1("?de")
v9("?description")
v11("?pid")
v7("?prefix")
v3("?qDe")
v10("?qid")
v4("?quarter")
v7("?quarterClass")
v2("?stolperstein"):::projected
v12("?vid")
c4(["wd:Q26703203"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0f0[["?de = 'de'"]]
e0f0 --> e0v1
e0v2 --"schema:description"--> e0v1
e0v1("?de"):::projected
e0v2("?stolperstein"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> v2
f0 --> c2
f1[["?de = 'de'"]]
f1 --> v1
v2 --"schema:description"--> v1
f2[["?qDe = 'de'"]]
f2 --> v3
f3[[" "]]
subgraph f3e1["Exists Clause"]
e1v1 --"wdt:P31"--> e1v2
e1v1("?quarter"):::projected
e1v2("?quarterClass"):::projected
end
f3--EXISTS--> f3e1
f3 --> v4
f3 --> c3
f3 --> v7
v4 --"wdt:P31"--> v7
bind4[/VALUES ?city ?conn ?prefix ?quarterClass/]
bind4-->v6
bind4-->v7
bind4-->v7
bind4-->v8
bind40(["wd:Q1055"])
bind40 --> bind4
bind41(["wd:Q15830667"])
bind41 --> bind4
bind42(["Hamburg-"])
bind42 --> bind4
bind43(["wdt:P276"])
bind43 --> bind4
bind44(["wd:Q64"])
bind44 --> bind4
bind45(["wd:Q35034452"])
bind45 --> bind4
bind46(["Berlin-"])
bind46 --> bind4
bind47(["wdt:P276"])
bind47 --> bind4
bind48(["wd:Q24879"])
bind48 --> bind4
bind49(["wd:Q17278559"])
bind49 --> bind4
bind410(["Bremen-"])
bind410 --> bind4
bind411(["wdt:P131"])
bind411 --> bind4
bind412(["wd:Q365"])
bind412 --> bind4
bind413(["wd:Q15632166"])
bind413 --> bind4
bind414(["Köln-"])
bind414 --> bind4
bind415(["wdt:P131"])
bind415 --> bind4
bind416(["wd:Q1718"])
bind416 --> bind4
bind417(["wd:Q1852178"])
bind417 --> bind4
bind418(["Düsseldorf-"])
bind418 --> bind4
bind419(["wdt:P131"])
bind419 --> bind4
bind420(["wd:Q1022"])
bind420 --> bind4
bind421(["wd:Q2740635"])
bind421 --> bind4
bind422(["Stuttgart-"])
bind422 --> bind4
bind423(["wdt:P131"])
bind423 --> bind4
bind424(["wd:Q1720"])
bind424 --> bind4
bind425(["wd:Q26703203"])
bind425 --> bind4
bind426(["Mainz-"])
bind426 --> bind4
bind427(["wdt:P131"])
bind427 --> bind4
bind428(["wd:Q1794"])
bind428 --> bind4
bind429(["wd:Q79416466"])
bind429 --> bind4
bind430(["Frankfurt-"])
bind430 --> bind4
bind431(["wdt:P131"])
bind431 --> bind4
v2 --"wdt:P31"--> c4
v2 --"wdt:P131"--> v6
v2 -->v8--> v4
v4 --"rdfs:label"--> v3
bind5[/"concat('Stolperstein in ',if(starts-with(?qDe,?prefix),'',?prefix),?qDe)"/]
v3 --o bind5
v7 --o bind5
bind5 --as--o v9
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."schema:description".-> v1
end
bind6[/"replace(str(?stolperstein),str('wd:'),'')"/]
v2 --o bind6
bind6 --as--o v10
bind7[/"'Dde'"/]
bind7 --as--o v11
bind8[/"concat(', ?description, ')"/]
bind8 --as--o v12