query-77570f5a37c3862f74b843bf47d038c4
TODO
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 schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?country ?countryLabel ?population
WHERE
{
{SELECT DISTINCT ?item ?country (MAX(?pop) as ?population)
WHERE
{
?item wdt:P31/wdt:P279* wd:Q515.
?item wdt:P1082 ?pop.
filter (?pop > 300000)
} GROUP BY ?item ?country } FILTER NOT EXISTS {
?article schema:about ?item ;
schema:isPartOf <https://he.wikivoyage.org/> . }
OPTIONAL {?item wdt:P17 ?country .
?country wdt:P463 wd:Q1065 .}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],he,en". }
} ORDER BY ?countryLabel ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?article")
v7("?country"):::projected
v1("?countryLabel"):::projected
v4("?item"):::projected
v2("?itemLabel"):::projected
v5("?pop")
v6("?population"):::projected
a1((" "))
c15(["#91;AUTO_LANGUAGE#93;,he,en"]):::literal
c3([https://he.wikivoyage.org/]):::iri
c13(["bd:serviceParam"]):::iri
c7(["wd:Q515"]):::iri
c11(["wd:Q1065"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"schema:about"--> e0v2
e0v1 --"schema:isPartOf"--> e0c3
e0v1("?article"):::projected
e0v2("?item"):::projected
e0c3([https://he.wikivoyage.org/]):::iri
end
f0--EXISTS--> f0e0
f0 --> v3
f0 --> c1
f0 --> v4
f0 --> c2
f0 --> c3
v3 --"schema:about"--> v4
v3 --"schema:isPartOf"--> c3
f1[["?pop > '300000^^xsd:integer'"]]
f1 --> v5
v4 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c7
v4 --"wdt:P1082"--> v5
bind3[/"max(?pop)"/]
v5 --o bind3
bind3 --as--o v6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P17".-> v7
v7 --"wdt:P463"--> c11
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c15
end