query-2bb0ef652b1210f89e3abb58c98bf5cf

rq turtle/ttl

Country dataset query

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#>
SELECT ?country ?countryLabel ?headOfStateLabel ?positionLabel ?currencyLabel ?capitalLabel ?coord 
WHERE {
VALUES ?country { wd:Q965 wd:Q115 wd:Q117 wd:Q114 wd:Q1037 wd:Q924 wd:Q945 wd:Q1036 wd:Q902 wd:Q252 wd:Q928 wd:Q854 wd:Q869 wd:Q786 wd:Q792 wd:Q774 wd:Q790 wd:Q783 wd:Q96 wd:Q811 wd:Q750 wd:Q155 wd:Q739 wd:Q736 wd:Q419 wd:Q424 wd:Q1020 wd:Q836 wd:Q953 }   
OPTIONAL { ?country wdt:P35 ?headOfState.
?country wdt:P1906 ?position.
?country wdt:P38 ?currency.
?country wdt:P36 ?capital.
OPTIONAL {?capital wdt:P625 ?coord . } }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } 
ORDER BY ASC(?countryLabel)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?capital") v7("?coord"):::projected v2("?country"):::projected v1("?countryLabel"):::projected v5("?currency") v3("?headOfState") v4("?position") c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/VALUES ?country/] bind0-->v2 bind00(["wd:Q965"]) bind00 --> bind0 bind01(["wd:Q115"]) bind01 --> bind0 bind02(["wd:Q117"]) bind02 --> bind0 bind03(["wd:Q114"]) bind03 --> bind0 bind04(["wd:Q1037"]) bind04 --> bind0 bind05(["wd:Q924"]) bind05 --> bind0 bind06(["wd:Q945"]) bind06 --> bind0 bind07(["wd:Q1036"]) bind07 --> bind0 bind08(["wd:Q902"]) bind08 --> bind0 bind09(["wd:Q252"]) bind09 --> bind0 bind010(["wd:Q928"]) bind010 --> bind0 bind011(["wd:Q854"]) bind011 --> bind0 bind012(["wd:Q869"]) bind012 --> bind0 bind013(["wd:Q786"]) bind013 --> bind0 bind014(["wd:Q792"]) bind014 --> bind0 bind015(["wd:Q774"]) bind015 --> bind0 bind016(["wd:Q790"]) bind016 --> bind0 bind017(["wd:Q783"]) bind017 --> bind0 bind018(["wd:Q96"]) bind018 --> bind0 bind019(["wd:Q811"]) bind019 --> bind0 bind020(["wd:Q750"]) bind020 --> bind0 bind021(["wd:Q155"]) bind021 --> bind0 bind022(["wd:Q739"]) bind022 --> bind0 bind023(["wd:Q736"]) bind023 --> bind0 bind024(["wd:Q419"]) bind024 --> bind0 bind025(["wd:Q424"]) bind025 --> bind0 bind026(["wd:Q1020"]) bind026 --> bind0 bind027(["wd:Q836"]) bind027 --> bind0 bind028(["wd:Q953"]) bind028 --> bind0 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P35".-> v3 v2 --"wdt:P1906"--> v4 v2 --"wdt:P38"--> v5 v2 --"wdt:P36"--> v6 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v6 -."wdt:P625".-> v7 end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end