query-bdfbf80a49cc89d20ab15e82803d3d5c
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 # wdt:P279/wdt:P31/wdt:P17 = 100981 # wdt:P31/wdt:P279/wdt:P17 = 101035 #seems optimal # wdt:P31/wdt:P17 = 100856 # wdt:P17 = 99224 } Q155:wd P17:wdt/P31:wdt/P279:wdt ?item { WHERE )?count AS )?item DISTINCT(COUNT( SELECT # ... seems all = 5580 # wdt:P279/wdt:P31/wdt:P17 = 5580 # wdt:P31/wdt:P279/wdt:P17 = 5580 # wdt:P31/wdt:P17 = 5580 #seems optimal # wdt:P17 = 5579 } Q155:wd P17:wdt/P31:wdt ?item . :b0 P402:wdt ?item { WHERE )?count AS )?item DISTINCT(COUNT( SELECTI'm not sure what you are trying to count. In general, P17=Q155 should be present on all relevant items. So doing the below should be sufficient (currently 5581): } . Q155:wd P17:wdt ?item .:b0 P402:wdt ?item { WHERE )?count AS )?item DISTINCT(COUNT( SELECT 21:41, 2 August 2018 (UTC) Jura--- So, there are a way to submit query where we can wait by a result?https://stackoverflow.com/q/51660914/287948: Thanks (!). Sorry, your query is not what I need, the problem is described in Jura1@ Oops, sorry, edited with DISTINCT as you remember!: QueryHints) with (wdt:P31|wdt:P279), problem solved by Stanislav Kralin (see END
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 bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?osm_relid ?name {
?itemi wdt:P17 wd:Q155 .
?item (wdt:P31|wdt:P279)* ?itemi .
?item wdt:P625 []. # or P402
OPTIONAL { ?item wdt:P1448 ?name. }
OPTIONAL { ?item wdt:P402 ?osm_relid .}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en,[AUTO_LANGUAGE]".
}
}