Create custom warnings

Dear Virtuoso team,

Actually working on DBpedia Fr, i wanna create custom warning for reminding the current number of rows that was configured in the ini file. By this way a user asking more rows than possible could be aware of the limitation.

If you have any trick or advice for it i will be happy to know more !
All the Best,

To be clear, what are you seeking to do, is to essentially read the ResultSetMaxRows param in the [SPARQL] section of the INI file and display this on the SPARQL endpoint Form Page or other UI to the Virtuoso SPARQL engine, and display warning to user of the maximum number of rows that are allowed to be returned by the server ?

1 Like

Thank you @hwilliams simpler is better !

I don’t quite understand your response, are you saying that my assumptions as to what you are seeking is correct ?

Sorry, i wasn’t clear.
We have some trouble with this limitation, if we fixed the ResultSetMaxRows to 10000 (default value) it led this kind of query :
``` select (count(distinct ?p) as ?c) where { ?s ?p ?o . } LIMIT 10001``
to return false results. Some colleagues used it for example in federated queries in a SERVICE clause.
Is it existing a way for don’t limiting it ?
Precising it in the GUI will advertise users using interfaces. But not the others querying via API request…
How to make the users aware of the given limitation during a API request ? Can i via the conductor interface add a kind of warning for it ?

Querying a Virtuoso SPARQL endpoint like DBpedia , a ResultSetMaxRows restriction in the INI is returned in the HTTP reposnse headers as X-SPARQL-MaxRows: 10000 as per the query output below:

$ curl -i "https://dbpedia.org/sparql?query=SELECT+*+WHERE+%7B+%3Fs+%3Fp+%3Fo+.+%7D&format=text%2Fcsv" -o results.csv -D headers.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1435k  100 1435k    0     0  8875k      0 --:--:-- --:--:-- --:--:-- 56.0M
$
$ cat headers.txt 
HTTP/1.1 200 OK
Date: Fri, 17 Jun 2022 13:47:53 GMT
Content-Type: text/csv; charset=UTF-8
Content-Length: 1470159
Connection: keep-alive
Server: Virtuoso/08.03.3323 (Linux) x86_64-generic-linux-glibc25  VDB
X-SPARQL-MaxRows: 10000
Content-disposition: filename=sparql_2022-06-17_13-37-37Z.csv
Expires: Fri, 24 Jun 2022 13:47:53 GMT
Cache-Control: max-age=604800
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Depth,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Accept-Encoding
Accept-Ranges: bytes
$

Indicating the result set has been restricted to 10000 rows.

1 Like

Perfect, this is exactly what we were looking for ! Thank you @hwilliams