query-148f28421f3258f1e7e5d8c8f8a3c8fc
Need for a simple count that is time-consuming https://github.com/OSMBrasil/semantic-bridgeGenerating "time out" error. I need this counting query to
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:P279*)/wdt:P17 wd:Q155 .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?count")
v1("?item"):::projected
a1((" "))
a2((" "))
c5(["wd:Q155"]):::iri
v1 --"wdt:P402"--> a1
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P279"--> a2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> a2
end
union0r <== or ==> union0l
end
a2 --"wdt:P17"--> c5
bind1[/"count(?item)"/]
v1 --o bind1
bind1 --as--o v2