query-306bb27c5d7a534d37a431c624bb693b

rq turtle/ttl

TODO

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 ?property ?propertyLabel ?count WHERE {
   {
  SELECT ?property (COUNT(?statement) AS ?count) WHERE {
    ?volcano wdt:P31/wdt:P279* wd:Q8072;
             ?p ?statement. # only counting main statement properties, not properties used in qualifiers and references
    ?property wikibase:claim ?p.
  }
  GROUP BY ?property
  ORDER BY ASC(?count)
  LIMIT 100
}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ASC(?count) LCASE(?propertyLabel) # adding the label to the sort key makes the “transition” from one “group” of properties to the next more obvious (e.g. jumping from Z/1 to A/2)
# note that we didn’t order by label in the subquery, and applied the limit there,
# so there are probably some properties that have the same number of uses as the last returned ones but “didn’t make it”,
# and their labels will be arbitrary, not just at the end of the alphabet
LIMIT 100 # sometimes the label service is weird and the query times out if the limit from the inner query isn’t copied to the outer one, so copy it just in case

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?count"):::projected v4("?p") v6("?property"):::projected v2("?propertyLabel"):::projected v5("?statement") v3("?volcano") a1((" ")) c6(["bd:serviceParam"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal c3(["wd:Q8072"]):::iri v3 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 v3 -->v4--> v5 v6 --"wikibase:claim"--> v4 bind1[/"count(?statement)"/] v5 --o bind1 bind1 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end