Hi!
A small fix though: I think you should better use count(?statement) rather than count(?ref), right?
Yes, of course, my mistake - I modified it from different query and forgot to change it.
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.
Works for me for Q216047, didn't check others though. For a popular references, labs one may be too slow, indeed. A faster one is coming "real soon now" :)