query-ed7956544617e4ea2a0abfe0c05297ba
Small settlements in Scotland
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT ?loc ?city ?cityLabel ?cityauthLabel ?population WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
VALUES ?typesOfPlaces {
wd:Q3957
wd:Q515
wd:Q532
wd:Q7543008
wd:Q5124673
}
?city (wdt:P31/(wdt:P279*)) ?typesOfPlaces;
wdt:P17 wd:Q145. #Q22
?city wdt:P131 ?cityauth. ?cityauth wdt:P31 wd:Q15060255.
OPTIONAL { ?city wdt:P1082 ?population. }
FILTER (?population > 100). FILTER (?population < 1500).
OPTIONAL { ?city wdt:P625 ?loc .}
}
ORDER BY ?cityauthLabel ?population
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?city"):::projected
v5("?cityauth")
v1("?cityauthLabel"):::projected
v6("?loc"):::projected
v2("?population"):::projected
v3("?typesOfPlaces")
a1((" "))
c12(["wd:Q15060255"]):::iri
c4(["bd:serviceParam"]):::iri
c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c10(["wd:Q145"]):::iri
f0[["?population < '1500^^xsd:integer'"]]
f0 --> v2
f1[["?population > '100^^xsd:integer'"]]
f1 --> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
end
bind2[/VALUES ?typesOfPlaces/]
bind2-->v3
bind20(["wd:Q3957"])
bind20 --> bind2
bind21(["wd:Q515"])
bind21 --> bind2
bind22(["wd:Q532"])
bind22 --> bind2
bind23(["wd:Q7543008"])
bind23 --> bind2
bind24(["wd:Q5124673"])
bind24 --> bind2
v4 --"wdt:P31"--> a1
a1 --"wdt:P279"--> v3
v4 --"wdt:P17"--> c10
v4 --"wdt:P131"--> v5
v5 --"wdt:P31"--> c12
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P1082".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P625".-> v6
end