query-8551c6778fdc743ddf47158a5394aafa
Need for a simple count that is time-consuming https://github.com/OSMBrasil/semantic-bridgeGenerating "time out" error. I need this counting query to } . Q155:wd P17:wdt/)P279:wdt|P31:wdt( ?item ._:b0 P402:wdt ?item { WHERE )?count AS )?item DISTINCT(COUNT( SELECT 21:14, 2 August 2018 (UTC)) talk (Krauss--. I try with "similar but not the same" operations, ≥ 5580PS: expected
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT (COUNT(DISTINCT ?item) AS ?count)
WHERE {
?item wdt:P402 _:b0 .
?item wdt:P31*/wdt:P17 wd:Q155
}
# wdt:P17 = 5579
# wdt:P31*/wdt:P17 = 5580 #seems optimal
# wdt:P31*/wdt:P279*/wdt:P17 = 5580
# wdt:P279*/wdt:P31*/wdt:P17 = 5580
# ... seems all = 5580
SELECT (COUNT(DISTINCT ?item) AS ?count)
WHERE {
?item wdt:P279*/wdt:P31*/wdt:P17 wd:Q155
}
# wdt:P17 = 99224
# wdt:P31*/wdt:P17 = 100856
# wdt:P31*/wdt:P279*/wdt:P17 = 101035 #seems optimal
# wdt:P279*/wdt:P31*/wdt:P17 = 100981