query-f3a3c7e93c41a88eca785e279a6754c1
Lakes in Wales
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#>
#defaultView:Map
SELECT DISTINCT ?place (?waterLabel as ?layer) ?placeURI ?loc WHERE { { ?cooncil wdt:P131 wd:Q25} ?cooncil rdfs:label ?cooncilName. FILTER(LANG(?cooncilName) = "en").
{{?place wdt:P31 wd:Q23397 } UNION {?place wdt:P31 wd:Q131681 }}
?place wdt:P31 ?watertype.
?place wdt:P131 ?cooncil .
?place wdt:P625 ?loc .
?place wdt:P31 ?placeDescQ. ?placeDescQ rdfs:label ?placeDesc. FILTER(LANG(?placeDesc) = "en").
?place rdfs:label ?placeLabel. FILTER(LANG(?placeLabel) = "en").
?watertype rdfs:label ?waterLabel. FILTER(LANG(?waterLabel) = "en").
optional { ?place wdt:P18 ?placeURI } .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?cooncil")
v4("?cooncilName")
v11("?layer")
v8("?loc"):::projected
v6("?place"):::projected
v3("?placeDesc")
v9("?placeDescQ")
v2("?placeLabel")
v10("?placeURI"):::projected
v1("?waterLabel"):::projected
v7("?watertype")
c6(["wd:Q23397"]):::iri
c7(["wd:Q131681"]):::iri
c3(["wd:Q25"]):::iri
f0[["?waterLabel = 'en'"]]
f0 --> v1
f1[["?placeLabel = 'en'"]]
f1 --> v2
f2[["?placeDesc = 'en'"]]
f2 --> v3
f3[["?cooncilName = 'en'"]]
f3 --> v4
v5 --"wdt:P131"--> c3
v5 --"rdfs:label"--> v4
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v6 --"wdt:P31"--> c7
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v6 --"wdt:P31"--> c6
end
union0r <== or ==> union0l
end
v6 --"wdt:P31"--> v7
v6 --"wdt:P131"--> v5
v6 --"wdt:P625"--> v8
v6 --"wdt:P31"--> v9
v9 --"rdfs:label"--> v3
v6 --"rdfs:label"--> v2
v7 --"rdfs:label"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v6 -."wdt:P18".-> v10
end
bind4[/"?waterLabel"/]
v1 --o bind4
bind4 --as--o v11