query-27ca369a357c3e8045a89ae5f3c413c0
by CamelCaseNick select (replace(str(?stolperstein), str(wd:), "") as ?qid) ("Dde" as ?pid) (concat("\"", ?description, "\"") as ?vid) ?de where { ?stolperstein wdt:P31 wd:Q26703203; wdt:P131+ wd:Q1055; wdt:P276 ?quarter. filter exists { ?quarter wdt:P31 wd:Q15830667. } ?quarter rdfs:label ?qDe. filter(lang(?qDe) = "de") bind(concat("Stolperstein in ", if(strstarts(?qDe, "Hamburg-"), "", "Hamburg-"), ?qDe) as ?description) optional { ?stolperstein schema:description ?de. filter(lang(?de) = "de") } filter not exists { ?stolperstein schema:description ?de. filter(lang(?de) = "de" && (strstarts(?de, ?description) || strstarts(?de, concat("ehemaliger ", ?description)))) } }
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) ?de where {
?stolperstein wdt:P31 wd:Q26703203;
wdt:P131+ wd:Q1055;
wdt:P276 ?quarter.
filter exists {
?quarter wdt:P31 wd:Q15830667.
}
?quarter rdfs:label ?qDe.
filter(lang(?qDe) = "de")
bind(concat("Stolperstein in ", if(strstarts(?qDe, "Hamburg-"), "", "Hamburg-"), ?qDe) as ?description)
optional {
?stolperstein schema:description ?de.
filter(lang(?de) = "de")
}
filter not exists {
?stolperstein schema:description ?de.
filter(lang(?de) = "de" && (strstarts(?de, ?description) || strstarts(?de, concat("ehemaliger ", ?description))))
}
}