query-dc680f2bdec38cd84d69ef173f0fc1f8
Countries of Europe (1900 to present)I wonder what would be a good way to query them. Based on the query, we can try to fix items that don't quite match it. 08:58, 11 January 2022 (UTC) JuraI used 1900 as starting point as it obviously gets harder further one goes back. --- 10:18, 11 January 2022 (UTC)) talk (Infrastruktur. Any former country without these two properties should be treated like an error. Likewise any current country without a replaces claim is an error. --(Q33946)Czechoslovakia I won't bore you with anything obvious, but if this is meant for maintenance, you might be interested in following the replaces/replaced-by chains as they appear to be broken in several places such as Maybe this as a start?
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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 p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel WHERE {
?item p:P31/wdt:P279* ?st ;
wdt:P30 wd:Q46 .
?st ps:P31/wdt:P279* wd:Q6256 .
OPTIONAL { ?item wdt:P576 ?dissolvedDate }
FILTER ( !BOUND(?dissolvedDate)|| ?dissolvedDate > "1900-01-01"^^xsd:date )
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?dissolvedDate")
v3("?item"):::projected
v1("?itemLabel"):::projected
v4("?st")
a1((" "))
a2((" "))
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c7(["wd:Q6256"]):::iri
c5(["wd:Q46"]):::iri
f0[["(not bound(?dissolvedDate) || ?dissolvedDate > '1900-01-01^^xsd:date')"]]
f0 --> v2
v3 --"p:P31"--> a1
a1 --"p:direct/P279"--> v4
v3 --"p:direct/P30"--> c5
v4 --"p:statement/P31"--> a2
a2 --"p:direct/P279"--> c7
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:direct/P576".-> v2
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end