query-bdfbf80a49cc89d20ab15e82803d3d5c

rq turtle/ttl

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

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]". 
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item"):::projected v1("?itemi") v3("?name"):::projected v4("?osm_relid"):::projected a1((" ")) c9(["bd:serviceParam"]):::iri c11(["en,#91;AUTO_LANGUAGE#93;"]):::literal c2(["wd:Q155"]):::iri v1 --"wdt:P17"--> c2 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P279"--> v1 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> v1 end union0r <== or ==> union0l end v2 --"wdt:P625"--> a1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P1448".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P402".-> v4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end