query-a8527c4a1c0e47ef9bc0b35988658f07

rq turtle/ttl

added before 2016-10

SELECT ?capital ?capitalLabel ?ofLabel ?start ?end WHERE { ?capital p:P31 ?capitalStat. ?capitalStat ps:P31 wd:Q5119. OPTIONAL { ?capitalStat pq:P642 ?of. } OPTIONAL { ?capitalStat pq:P580 ?start. } OPTIONAL { ?capitalStat pq:P582 ?end. } MINUS { [] wdt:P36 ?capital. } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } added before 2016-10

SELECT ?capital ?capitalLabel ?ofLabel ?start ?end WHERE { ?capital p:P31 ?capitalStat. ?capitalStat ps:P31 wd:Q5119. OPTIONAL { ?capitalStat pq:P642 ?of. } OPTIONAL { ?capitalStat pq:P580 ?start. } OPTIONAL { ?capitalStat pq:P582 ?end. } MINUS { [] wdt:P36 ?capital. } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } added before 2016-10

SELECT ?capital ?capitalLabel ?ofLabel ?start ?end WHERE { ?capital p:P31 ?capitalStat. ?capitalStat ps:P31 wd:Q5119. OPTIONAL { ?capitalStat pq:P642 ?of. } OPTIONAL { ?capitalStat pq:P580 ?start. } OPTIONAL { ?capitalStat pq:P582 ?end. } MINUS { [] wdt:P36 ?capital. } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } added before 2016-10

SELECT ?capital ?capitalLabel ?ofLabel ?start ?end WHERE { ?capital p:P31 ?capitalStat. ?capitalStat ps:P31 wd:Q5119. OPTIONAL { ?capitalStat pq:P642 ?of. } OPTIONAL { ?capitalStat pq:P580 ?start. } OPTIONAL { ?capitalStat pq:P582 ?end. } MINUS { [] wdt:P36 ?capital. } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } added before 2016-10

SELECT ?capital ?capitalLabel ?ofLabel ?start ?end WHERE { ?capital p:P31 ?capitalStat. ?capitalStat ps:P31 wd:Q5119. OPTIONAL { ?capitalStat pq:P642 ?of. } OPTIONAL { ?capitalStat pq:P580 ?start. } OPTIONAL { ?capitalStat pq:P582 ?end. } MINUS { [] wdt:P36 ?capital. } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } added before 2016-10

SELECT ?capital ?capitalLabel ?ofLabel ?start ?end WHERE { ?capital p:P31 ?capitalStat. ?capitalStat ps:P31 wd:Q5119. OPTIONAL { ?capitalStat pq:P642 ?of. } OPTIONAL { ?capitalStat pq:P580 ?start. } OPTIONAL { ?capitalStat pq:P582 ?end. } MINUS { [] wdt:P36 ?capital. } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } added before 2016-10

SELECT ?capital ?capitalLabel ?ofLabel ?start ?end WHERE { ?capital p:P31 ?capitalStat. ?capitalStat ps:P31 wd:Q5119. OPTIONAL { ?capitalStat pq:P642 ?of. } OPTIONAL { ?capitalStat pq:P580 ?start. } OPTIONAL { ?capitalStat pq:P582 ?end. } MINUS { [] wdt:P36 ?capital. } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } added before 2016-10

SELECT ?capital ?capitalLabel ?ofLabel ?start ?end WHERE { ?capital p:P31 ?capitalStat. ?capitalStat ps:P31 wd:Q5119. OPTIONAL { ?capitalStat pq:P642 ?of. } OPTIONAL { ?capitalStat pq:P580 ?start. } OPTIONAL { ?capitalStat pq:P582 ?end. } MINUS { [] wdt:P36 ?capital. } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } added before 2016-10

SELECT ?capital ?capitalLabel ?ofLabel ?start ?end WHERE { ?capital p:P31 ?capitalStat. ?capitalStat ps:P31 wd:Q5119. OPTIONAL { ?capitalStat pq:P642 ?of. } OPTIONAL { ?capitalStat pq:P580 ?start. } OPTIONAL { ?capitalStat pq:P582 ?end. } MINUS { [] wdt:P36 ?capital. } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } added before 2016-10

SELECT ?capital ?capitalLabel ?ofLabel ?start ?end WHERE { ?capital p:P31 ?capitalStat. ?capitalStat ps:P31 wd:Q5119. OPTIONAL { ?capitalStat pq:P642 ?of. } OPTIONAL { ?capitalStat pq:P580 ?start. } OPTIONAL { ?capitalStat pq:P582 ?end. } MINUS { [] wdt:P36 ?capital. } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10

SELECT ?capital ?capitalLabel ?ofLabel ?start ?end
WHERE
{
  ?capital p:P31 ?capitalStat.
  ?capitalStat ps:P31 wd:Q5119.
  OPTIONAL { ?capitalStat pq:P642 ?of. }
  OPTIONAL { ?capitalStat pq:P580 ?start. }
  OPTIONAL { ?capitalStat pq:P582 ?end. }
  MINUS { [] wdt:P36 ?capital. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?capital"):::projected v2("?capitalStat") v5("?end"):::projected v3("?of") v4("?start"):::projected a1((" ")) c9(["bd:serviceParam"]):::iri c11(["en"]):::literal c3(["wd:Q5119"]):::iri v1 --"p:P31"--> v2 v2 --"p:statement/P31"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:qualifier/P642".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:qualifier/P580".-> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:qualifier/P582".-> v5 end subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; a1 --"p:direct/P36"--> v1 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end