query-b91b05985e62296bd62672e0468ba3f8
How to filter away properties that have 'no value' set?Hi
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wdno: <http://www.wikidata.org/prop/novalue/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?municipalityLabel ?gkz ?tkk ?monument ?monumentLabel WHERE {
?monument wdt:P1435 wd:Q1188447.
?monument wdt:P131 ?municipality.
?municipality wdt:P131* wd:Q42880 .
?municipality wdt:P964 ?gkz.
#?municipality wdt:P131* wd:Q665605.
?municipality wdt:P31 wd:Q667509.
filter not exists { ?monument wdt:P4219 ?tkk}
#filter (?tkk != wdno:P4219) # no value for tkk
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?gkz"):::projected
v1("?monument"):::projected
v3("?municipality")
v2("?tkk"):::projected
c10(["bd:serviceParam"]):::iri
c5(["wd:Q42880"]):::iri
c8(["wd:Q667509"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q1188447"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P4219"--> e0v2
e0v1("?monument"):::projected
e0v2("?tkk"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
v1 --"wdt:P4219"--> v2
v1 --"wdt:P1435"--> c3
v1 --"wdt:P131"--> v3
v3 --"wdt:P131"--> c5
v3 --"wdt:P964"--> v4
v3 --"wdt:P31"--> c8
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end