query-accac322a04a4f0f68c3685b7dc5a97f

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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
select ?countryLabel (group_concat(?capLabel;separator=", ") as ?capitalLabel) ?pop ?area ?headLabel ?imagehead ?currencyLabel ?flag ?coord
where{
  ?country wdt:P31 wd:Q6256;
           wdt:P463 wd:Q1065;
           optional {?country wdt:P36 ?cap. ?cap rdfs:label ?capLabel. filter(lang(?capLabel)="en")}
  optional {?country wdt:P1082 ?pop }
  optional {?country wdt:P2046  ?area }
  optional {?country wdt:P35 ?head.
           ?head wdt:P18 ?imagehead}
  optional {?country wdt:P38 ?currency }
  optional {?country wdt:P41 ?flag }
  optional {?country wdt:P625 ?coord } 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  } group by ?countryLabel ?pop ?area ?headLabel ?imagehead ?currencyLabel ?flag ?coord

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?area"):::projected v3("?cap") v1("?capLabel"):::projected v11("?capitalLabel") v10("?coord"):::projected v2("?country") v8("?currency") v9("?flag"):::projected v6("?head") v7("?imagehead"):::projected v4("?pop"):::projected c16(["bd:serviceParam"]):::iri c5(["wd:Q1065"]):::iri c18(["#91;AUTO_LANGUAGE#93;,en"]):::literal c3(["wd:Q6256"]):::iri v2 --"wdt:P31"--> c3 v2 --"wdt:P463"--> c5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P36".-> v3 v3 --"rdfs:label"--> v1 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P1082".-> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P2046".-> v5 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P35".-> v6 v6 --"wdt:P18"--> v7 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P38".-> v8 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P41".-> v9 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P625".-> v10 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 end bind1[/"?capLabel"/] v1 --o bind1 bind1 --as--o v11