query-7e28f8df023fdc1969dfacaa7dbf20ba

rq turtle/ttl

Propertiesinstance of (P31)continent (P30)contains the administrative territorial entity (P150)locator map image (P242)flag image (P41)capital (P36)image (P18)population (P1082)head of government (P6)twinned administrative body (P190)inception (P571)located in or next to body of water (P206)has part(s) (P527) Propertiesinstance of (P31)continent (P30)contains the administrative territorial entity (P150)locator map image (P242)flag image (P41)capital (P36)image (P18)population (P1082)head of government (P6)twinned administrative body (P190)inception (P571)located in or next to body of water (P206)has part(s) (P527) Propertiesinstance of (P31)continent (P30)contains the administrative territorial entity (P150)locator map image (P242)flag image (P41)capital (P36)image (P18)population (P1082)head of government (P6)twinned administrative body (P190)inception (P571)located in or next to body of water (P206)has part(s) (P527) Propertiesinstance of (P31)continent (P30)contains the administrative territorial entity (P150)locator map image (P242)flag image (P41)capital (P36)image (P18)population (P1082)head of government (P6)twinned administrative body (P190)inception (P571)located in or next to body of water (P206)has part(s) (P527) Propertiesinstance of (P31)continent (P30)contains the administrative territorial entity (P150)locator map image (P242)flag image (P41)capital (P36)image (P18)population (P1082)head of government (P6)twinned administrative body (P190)inception (P571)located in or next to body of water (P206)has part(s) (P527) Propertiesinstance of (P31)continent (P30)contains the administrative territorial entity (P150)locator map image (P242)flag image (P41)capital (P36)image (P18)population (P1082)head of government (P6)twinned administrative body (P190)inception (P571)located in or next to body of water (P206)has part(s) (P527) Propertiesinstance of (P31)continent (P30)contains the administrative territorial entity (P150)locator map image (P242)flag image (P41)capital (P36)image (P18)population (P1082)head of government (P6)twinned administrative body (P190)inception (P571)located in or next to body of water (P206)has part(s) (P527) Propertiesinstance of (P31)continent (P30)contains the administrative territorial entity (P150)locator map image (P242)flag image (P41)capital (P36)image (P18)population (P1082)head of government (P6)twinned administrative body (P190)inception (P571)located in or next to body of water (P206)has part(s) (P527) Propertiesinstance of (P31)continent (P30)contains the administrative territorial entity (P150)locator map image (P242)flag image (P41)capital (P36)image (P18)population (P1082)head of government (P6)twinned administrative body (P190)inception (P571)located in or next to body of water (P206)has part(s) (P527) Propertiesinstance of (P31)continent (P30)contains the administrative territorial entity (P150)locator map image (P242)flag image (P41)capital (P36)image (P18)population (P1082)head of government (P6)twinned administrative body (P190)inception (P571)located in or next to body of water (P206)has part(s) (P527)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Tree
SELECT ?continent ?continentFlag ?continentLabel ?country ?countryLabel ?countryFlag ?region ?regionLabel ?regionFlag ?city ?cityLabel ?cityImage ?property ?propertyLabel ?value ?valueLabel WHERE {
  {
    SELECT * WHERE {
      ?continent wdt:P31 wd:Q5107.
      ?country wdt:P30 ?continent.
      ?country p:P31/ps:P31 wd:Q6256.
      ?country wdt:P150 ?region.
      OPTIONAL {
        ?continent wdt:P242 ?continentFlag.
        ?country wdt:P41 ?countryFlag.
        ?region wdt:P41 ?regionFlag.
      }
      OPTIONAL {
        ?region wdt:P36 ?city.
        ?city wdt:P31 wd:Q515.
        ?city wdt:P18 ?cityImage.
        OPTIONAL {
          VALUES (?prop) {
            (wdt:P1082)
            (wdt:P6)
            (wdt:P190)
            (wdt:P31)
            (wdt:P571)
            (wdt:P150)
            (wdt:P206)
            (wdt:P527)
          }
          ?city ?prop ?value.
          ?property ?ref ?prop.
          ?property rdf:type wikibase:Property.
        }
      }
    }
  }
  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; v7("?city"):::projected v8("?cityImage"):::projected v1("?continent"):::projected v4("?continentFlag"):::projected v2("?country"):::projected v5("?countryFlag"):::projected v9("?prop") v11("?property"):::projected v12("?ref") v3("?region"):::projected v6("?regionFlag"):::projected v10("?value"):::projected a1((" ")) c14(["wikibase:Property"]):::iri c16(["bd:serviceParam"]):::iri c11(["wd:Q515"]):::iri c18(["#91;AUTO_LANGUAGE#93;,en"]):::literal c6(["wd:Q6256"]):::iri c2(["wd:Q5107"]):::iri v1 --"p:direct/P31"--> c2 v2 --"p:direct/P30"--> v1 v2 --"p:P31"--> a1 a1 --"p:statement/P31"--> c6 v2 --"p:direct/P150"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P242".-> v4 v2 --"p:direct/P41"--> v5 v3 --"p:direct/P41"--> v6 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P36".-> v7 v7 --"p:direct/P31"--> c11 v7 --"p:direct/P18"--> v8 subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; bind0[/VALUES ?prop/] bind0-->v9 bind00(["p:direct/P1082"]) bind00 --> bind0 bind01(["p:direct/P6"]) bind01 --> bind0 bind02(["p:direct/P190"]) bind02 --> bind0 bind03(["p:direct/P31"]) bind03 --> bind0 bind04(["p:direct/P571"]) bind04 --> bind0 bind05(["p:direct/P150"]) bind05 --> bind0 bind06(["p:direct/P206"]) bind06 --> bind0 bind07(["p:direct/P527"]) bind07 --> bind0 v7 -->v9--> v10 v11 -->v12--> v9 v11 -."a".-> c14 end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 end