query-5d96ca071db2a0670f3a30bc7fc8bd1a
The 50 United States
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX v: <http://www.wikidata.org/prop/statement/>
SELECT ?ordinal ?state ?iso ?stateLabel ?capitalLabel ?joining ?inception WHERE {
?state p:P31 ?stateBlock .
?stateBlock v:P31 wd:Q35657 .
OPTIONAL {?stateBlock pq:P1545 ?ordinal} .
OPTIONAL {?stateBlock pq:P580 ?joining} .
#?memberBlock pq:P580 ?start .
?state wdt:P571 ?inception .
?state wdt:P36 ?capital .
?state wdt:P300 ?iso
SERVICE wikibase:label{bd:serviceParam wikibase:language "en"}
}
ORDER BY ?iso
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?capital")
v6("?inception"):::projected
v1("?iso"):::projected
v5("?joining"):::projected
v4("?ordinal"):::projected
v2("?state"):::projected
v3("?stateBlock")
c10(["bd:serviceParam"]):::iri
c12(["en"]):::literal
c3(["wd:Q35657"]):::iri
v2 --"p:P31"--> v3
v3 --"p:statement/P31"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P1545".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P580".-> v5
end
v2 --"p:direct/P571"--> v6
v2 --"p:direct/P36"--> v7
v2 --"p:direct/P300"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end