query-e18e33857eeab6c7b3ee62d84263154a
: Oh thank you, I want to show optional coordinates, too, but only the value in the parentheses. Tagishsimon@
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?BLfD_ID ?item ?itemLabel ?itemDescription ?coords ?address WHERE {
?item wdt:P4244 ?BLfD_ID . # item has a P4244
MINUS { ?item wdt:P18 [] } . # item has no image
MINUS { ?item wdt:P373 [] } . # item has no Commonscat
OPTIONAL { ?item wdt:P625 ?coords . } # show coordinates
OPTIONAL { ?item wdt:P969 ?address . } # show address
FILTER(SUBSTR(?BLfD_ID,1,11)="D-5-64-000-") # P4244 value starts with D-5-64-000-
SERVICE wikibase:label { bd:serviceParam wikibase:language "de,[AUTO_LANGUAGE]". }
}
ORDER BY ?BLfD_ID
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?BLfD_ID"):::projected
v4("?address"):::projected
v3("?coords"):::projected
v2("?item"):::projected
a1((" "))
a2((" "))
c10(["bd:serviceParam"]):::iri
c12(["de,#91;AUTO_LANGUAGE#93;"]):::literal
f0[["substring(?BLfD_ID,'1^^xsd:integer','11^^xsd:integer') = 'D-5-64-000-'"]]
f0 --> v1
v2 --"wdt:P4244"--> v1
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P18"--> a1
end
subgraph minus2["MINUS"]
style minus2 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P373"--> a2
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P625".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P969".-> v4
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end