We had similar case with paging and also recommend COUNT, since it's usually much faster than returning the data so it won't affect performance so much.

On 09/03/2021 10.56, Martynas Jusevičius wrote:
COUNT(*) / LIMIT should give you the number of pages.

On Tue, Mar 9, 2021 at 9:52 AM Donald McIntosh
<dmcint...@opentechnology.net> wrote:
Hi..

I have an implementation where I would like to page through data retrieved via 
a SPARQL query on Apache Jena on a UI.  offset and limit features take me some 
of the way there but do not tell me the full size of the overall result set so 
that users can skip to the end or to page x knowing that it will exist.  I am 
guessing that internally Jena will know the result set size from a query but 
perhaps this not available to the caller, as the full set will have been 
retrieved and sorted.

Is there a correct and efficient way to implement this type of use case 
inApache Jena ?

Thanks,
Donald

--
Lingsoft - 30 years of Leading Language Management

www.lingsoft.fi

Speech Applications - Language Management - Translation - Reader's and Writer's 
Tools - Text Tools - E-books and M-books

Mikael Pesonen
System Engineer

e-mail: mikael.peso...@lingsoft.fi
Tel. +358 2 279 3300

Time zone: GMT+2

Helsinki Office
Eteläranta 10
FI-00130 Helsinki
FINLAND

Turku Office
Kauppiaskatu 5 A
FI-20100 Turku
FINLAND

Reply via email to