buda-base / lds-pdi

http://purl.bdrc.io BDRC Linked Data Server
Apache License 2.0
2 stars 0 forks source link

max number of results per query configuration #170

Closed eroux closed 4 years ago

eroux commented 4 years ago

For some queries, a relatively low limit in the number of results is necessary, but for others it makes no sense (example) as they give very small result sets and perform well even if the number of results is high.

There are several leads we could explore to have finer grain restrictions:

  1. have the possibility of having the restriction overriden in the query parameters, like
#QueryLimitIndication=5000
  1. have the query indicate its own performance and size:
#QueryPerfIndication=5
#QuerySizeIndication=1

and then the configuration in ldspdi.properties could be something like (where -1 is no limit):

sparql.results.limit.default=2000
sparql.results.limit.perfInd.1=500
sparql.results.limit.perfInd.2=1000
sparql.results.limit.perfInd.4=3000
sparql.results.limit.perfInd.5=-1
sparql.results.limit.sizeInd.1=-1
sparql.results.limit.sizeInd.2=3000

and then the actual limit would be computed according to that (combining the default, sizeInd, perfInd, etc.) by ldspdi

eroux commented 4 years ago

@MarcAgate I'm starting to think the first option wouldn't be too complex to implement... do you think you could do it? The algorithm would be:

MarcAgate commented 4 years ago

I think it's not that difficult. I am going to look at it.

eroux commented 4 years ago

thanks!

MarcAgate commented 4 years ago

Done as of commit 47fe2fa

eroux commented 4 years ago

that works, thanks a lot!