query-498d00faa9018886257a7ecf8ab30916
mendatory properties
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select (replace(str(?stolperstein), str(wd:), "") as ?qid) ?pid ?vid where {
?stolperstein wdt:P31 ?class. values ?class { wd:Q26703203 wd:Q43638585 }
# ?stolperstein rdfs:label ?Lde. filter(lang(?Lde) = "de")
{
values (?p ?v) {
(wdt:P170 wd:Q195796)
(wdt:P186 wd:Q39782)
(wdt:P361 wd:Q314003)
}
filter not exists {
?stolperstein ?p ?v.
}
bind(replace(str(?p), str(wdt:), "") as ?pid)
bind(replace(str(?v), str(wd:), "") as ?vid)
} union {
?stolperstein wdt:P131 ?adminstrative.
?adminstrative wdt:P17 ?country.
filter not exists {
?stolperstein wdt:P17 [].
}
bind("P17" as ?pid)
bind(replace(str(?country), str(wd:), "") as ?vid)
} union {
?stolperstein wdt:P276 ?place.
?place wdt:P131 ?adminstrative.
filter not exists {
?stolperstein wdt:P131 [].
}
bind("P131" as ?pid)
bind(replace(str(?adminstrative), str(wd:), "") as ?vid)
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?adminstrative")
v3("?class")
v8("?country")
v5("?p")
v10("?pid"):::projected
v9("?place")
v10("?qid")
v1("?stolperstein"):::projected
v5("?v")
v10("?vid"):::projected
a1((" "))
a2((" "))
v1 --"wdt:P31"--> v3
bind0[/VALUES ?class/]
bind0-->v3
bind00(["wd:Q26703203"])
bind00 --> bind0
bind01(["wd:Q43638585"])
bind01 --> bind0
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
f1[["not "]]
subgraph f1e0["Exists Clause"]
e0v1 --"wdt:P131"--> e0a1
e0v1("?stolperstein"):::projected
e0a1((" ")):::projected
end
f1--EXISTS--> f1e0
f1 --> v1
f1 --> c3
f1 --> a2
v1 --"wdt:P131"--> a2
v1 --"wdt:P276"--> v9
v9 --"wdt:P131"--> v7
bind2[/"'P131'"/]
bind2 --as--o v10
bind3[/"replace(str(?adminstrative),str('wd:'),'')"/]
v7 --o bind3
bind3 --as--o v10
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
f4[["not "]]
subgraph f4e1["Exists Clause"]
e1v1 --"wdt:P17"--> e1a1
e1v1("?stolperstein"):::projected
e1a1((" ")):::projected
end
f4--EXISTS--> f4e1
f4 --> v1
f4 --> c2
f4 --> a1
v1 --"wdt:P17"--> a1
v1 --"wdt:P131"--> v7
v7 --"wdt:P17"--> v8
bind5[/"'P17'"/]
bind5 --as--o v10
bind6[/"replace(str(?country),str('wd:'),'')"/]
v8 --o bind6
bind6 --as--o v10
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
f7[["not "]]
subgraph f7e2["Exists Clause"]
e2v1 -->e2v2--> e2v3
e2v2("?p"):::projected
e2v1("?stolperstein"):::projected
e2v3("?v"):::projected
end
f7--EXISTS--> f7e2
f7 --> v1
f7 --> v5
f7 --> v5
v1 -->v5--> v5
bind8[/VALUES ?p ?v/]
bind8-->v5
bind8-->v5
bind80(["wdt:P170"])
bind80 --> bind8
bind81(["wd:Q195796"])
bind81 --> bind8
bind82(["wdt:P186"])
bind82 --> bind8
bind83(["wd:Q39782"])
bind83 --> bind8
bind84(["wdt:P361"])
bind84 --> bind8
bind85(["wd:Q314003"])
bind85 --> bind8
bind9[/"replace(str(?p),str('wdt:'),'')"/]
v5 --o bind9
bind9 --as--o v10
bind10[/"replace(str(?v),str('wd:'),'')"/]
v5 --o bind10
bind10 --as--o v10
end
union0r <== or ==> union0l
end
bind11[/"replace(str(?stolperstein),str('wd:'),'')"/]
v1 --o bind11
bind11 --as--o v10