query-f6e39a9f0abc0d47db59ea3d5e4f13cd

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?property ?propertyLabel ?count     # group this subquery to get a count
WHERE
{
   {
SELECT ?property (COUNT(?ppp) AS ?count)  # use a named subquery first to do the count
WHERE 
{

         # use a big hammer
  ?item p:P580 [?ppp [] ].               # P580 statement with a qualifier or reference
  ?property wikibase:qualifier ?ppp.     # it's a qualifier & we get the property name
        } GROUP BY ?property }                            # get the label for the property here once we have a list of properties and counts
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],es,en". }
} ORDER BY DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?count"):::projected v3("?item") v2("?ppp") v4("?property"):::projected a2((" ")) a1((" ")) c4(["bd:serviceParam"]):::iri c6(["#91;AUTO_LANGUAGE#93;,es,en"]):::literal a1 -->v2--> a2 v3 --"p:P580"--> a1 v4 --"wikibase:qualifier"--> v2 bind1[/"count(?ppp)"/] v2 --o bind1 bind1 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end