query-fdc510ab23cc65fdff84108cf9b3112a

rq turtle/ttl

Current sovereign states with capital by continent (in German)

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 ?continentLabel ?unicode ?iso2 ?iso3 ?countryLabel ?capitalLabel ?capital WHERE {
  ?country wdt:P31 wd:Q3624078 .
  FILTER NOT EXISTS {?country wdt:P31 wd:Q3024240} .
  FILTER NOT EXISTS {?country wdt:P31 wd:Q1145276} .
  OPTIONAL{?country wdt:P36 ?capital}
  OPTIONAL{?country wdt:P30 ?continent}
  OPTIONAL{?country wdt:P487 ?unicode}
  OPTIONAL{?country wdt:P297 ?iso2}
  OPTIONAL{?country wdt:P298 ?iso3}
  SERVICE wikibase:label{bd:serviceParam wikibase:language "de"}
} ORDER BY ?iso3 ?countryLabel ?countryLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?capital"):::projected v5("?continent") v3("?country"):::projected v2("?countryLabel"):::projected v7("?iso2"):::projected v1("?iso3"):::projected v6("?unicode"):::projected c13(["de"]):::literal c3(["wd:Q3024240"]):::iri c4(["wd:Q3624078"]):::iri c11(["bd:serviceParam"]):::iri c2(["wd:Q1145276"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P31"--> e0c2 e0v1("?country"):::projected e0c2(["wd:Q1145276"]):::iri end f0--EXISTS--> f0e0 f0 --> v3 f0 --> c1 f0 --> c2 v3 --"wdt:P31"--> c2 f1[["not "]] subgraph f1e1["Exists Clause"] e1v1 --"wdt:P31"--> e1c2 e1v1("?country"):::projected e1c2(["wd:Q3024240"]):::iri end f1--EXISTS--> f1e1 f1 --> v3 f1 --> c1 f1 --> c3 v3 --"wdt:P31"--> c3 v3 --"wdt:P31"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P36".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P30".-> v5 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P487".-> v6 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P297".-> v7 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P298".-> v1 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end