query-93e23e1a3e7e7824387f1ca29e2ba261

rq turtle/ttl

Propertiesinstance of (P31)continent (P30)locator map image (P242)population (P1082)flag image (P41)

Use at

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:Tree
SELECT ?continent ?continentLabel (CONCAT("(",STR(?continentPop/1e6)," M)") as ?continentPopM) ?continentMap
       ?country   ?countryLabel   (CONCAT("(",STR(?countryPop  /1e6)," M)") as ?countryPopM)   ?countryFlag
WHERE {
  {
    SELECT * WHERE {
      ?continent wdt:P31 wd:Q5107   .
      ?country   wdt:P30 ?continent .
      ?country   wdt:P31 wd:Q6256   .
      OPTIONAL {
        ?continent wdt:P242  ?continentMap .
        ?continent wdt:P1082 ?continentPop .
        ?country   wdt:P41   ?countryFlag  .
        ?country   wdt:P1082 ?countryPop   .
      }
    }
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?continent"):::projected v3("?continentMap"):::projected v4("?continentPop"):::projected v7("?continentPopM") v2("?country"):::projected v5("?countryFlag"):::projected v6("?countryPop"):::projected v8("?countryPopM") c9(["bd:serviceParam"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal c4(["wd:Q6256"]):::iri c2(["wd:Q5107"]):::iri v1 --"wdt:P31"--> c2 v2 --"wdt:P30"--> v1 v2 --"wdt:P31"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P242".-> v3 v1 --"wdt:P1082"--> v4 v2 --"wdt:P41"--> v5 v2 --"wdt:P1082"--> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end bind0[/"concat('(',str(?continentPop / '1e6^^xsd:double'),' M)')"/] v4 --o bind0 bind0 --as--o v7 bind1[/"concat('(',str(?countryPop / '1e6^^xsd:double'),' M)')"/] v6 --o bind1 bind1 --as--o v8