On 07.09.2015 21:45, Stas Malyshev wrote:
Hi!
I'm wondering if there is a way (SQL, api, tool or otherwise) for finding out how often a particular source is used on Wikidata.
Something like this probably would work:
This runs the following query:
prefix prov: http://www.w3.org/ns/prov# prefix pr: http://www.wikidata.org/prop/reference/ PREFIX wd: http://www.wikidata.org/entity/ SELECT (count(?ref) as ?mentions) WHERE { ?statement prov:wasDerivedFrom ?ref . ?ref pr:P248 wd:Q216047 . ?ref pr:P577 ?date . }
For Q216047 which is "Le Figaro". This counts how many statements reference Le Figaro and also have dates (drop the last clause if non-dated ones are fine too).
Yes, that's the best technique if you already know which reference you are looking for. And it also supports more general patterns, like the Le Figaro one, which is also very interesting.
A small fix though: I think you should better use count(?statement) rather than count(?ref), right?
I have tried a similar query on the public test endpoint on labs earlier, but it timed out for me (I was using a very common reference though ;-). For rarer references, live queries are definitely the better approach.
Markus