query-a87e937901d27b17460c4eeaf1238889

rq turtle/ttl

Count all items with a property SELECT (COUNT (DISTINCT ?item) AS ?count) WHERE { ?item wdt:P402 ?value . # change P402 to another property SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Count all items with a property
SELECT (COUNT (DISTINCT ?item) AS ?count)
WHERE
{
  ?item wdt:P402 ?value .
  # change P402 to another property
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?count") v1("?item"):::projected v2("?value") c3(["bd:serviceParam"]):::iri c5(["#91;AUTO_LANGUAGE#93;,en"]):::literal v1 --"wdt:P402"--> v2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c3 --"wikibase:language"--> c5 end bind1[/"count(?item)"/] v1 --o bind1 bind1 --as--o v3