query-cf9ad87a7ed170f0f07331add4a0ca79

rq turtle/ttl

TODO

Use at

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 (MAX(?pop) as ?population)
WHERE 
{
  ?item wdt:P31/wdt:P279* wd:Q515.
  ?item wdt:P1082 ?pop.
  filter (?pop > 300000)
  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". }
} GROUP BY ?item ?itemLabel ?country ?countryLabel ORDER BY ?countryLabel ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?article") v6("?country"):::projected v1("?countryLabel"):::projected v4("?item"):::projected v2("?itemLabel"):::projected v5("?pop"):::projected v7("?population") 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 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P17".-> v6 v6 --"wdt:P463"--> c11 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end bind3[/"max(?pop)"/] v5 --o bind3 bind3 --as--o v7