Addshore added a comment.

You above query is slightly off somewhere and the below is actually correct!

  PREFIX wikibase: <http://wikiba.se/ontology#>
  PREFIX wd: <http://www.wikidata.org/entity/> 
  PREFIX wdt: <http://www.wikidata.org/prop/direct/>
  PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
  PREFIX prov: <http://www.w3.org/ns/prov#>
  prefix p: <http://www.wikidata.org/prop/>
  
  SELECT ?nrefs (COUNT(?wds) AS ?count) WHERE {
    {
      SELECT ?wds (COUNT(DISTINCT(?ref)) AS ?nrefs)
      WHERE {
          ?item p:P227 ?wds .
          OPTIONAL { ?wds prov:wasDerivedFrom ?ref } .
      } GROUP BY ?wds
    }
  } GROUP BY ?nrefs 
  ORDER BY ?nrefs

So this is listing the number of statements that have n number of references?

> In addition to tracking aggregates, it would also be useful to show all 
> property counts in a table like I did for here 
> http://wdm.wmflabs.org/?t=wikidata_property_usage_count.

Table support is in the next version of grafana

I can look at adding this query to our collection next week!


TASK DETAIL
  https://phabricator.wikimedia.org/T117234

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Christopher, Addshore
Cc: Lydia_Pintscher, StudiesWorld, Addshore, Christopher, Aklapper, 
Wikidata-bugs, aude, Mbch331



_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to