I would like to be able to count the number of bindings on any possible
select query. The best I could come up with so far is the following:

select count(?cnt) as ?ret where {
     { select distinct count(*) as ?cnt ?v1 ?v2 ?v3 ... where {
      ?v1 ...
      ?v2 ... }
     }
}

Where the plain query that I would like to count looks as follows:
select distinct ?v1 ?v2 ?v3 ... where {
  ?v1 ...
  ?v2 ... }

This seems to work in many situations. But then I always use distinct
queries and I think that the above query would could duplicates, too.

So is there a "correct" way to simply count the number of binding rows
that would be returned by a query?

Thanks,
Sebastian Trüg

Reply via email to