Open joernhees opened 10 years ago
Here's an idea regarding this matter:
When “Anytime Query” is deemed enabled, the following occurs:
- HTTP Requests (comprising Range Header) sent to server
- HTTP 206 Response returned from server
Thoughts and comments welcome.
This will not work out for the following reasons:
If clients only want specific rows, they would use the SPARQL keywords LIMIT
and OFFSET
. Range request header and 206 Partial Content are meant for the partitioning of responses on byte level. An example use case is the resumption of large downloads. Partitioning on byte level in SPARQL context would result in sending incomplete rows and invalid responses.
Once again:
I think it would be the best to respond the results with HTTP status 200 in case of complete results and with some fixed, custom 3xx status in case of partial results due to time (Anytime Query) or size (MaxRows) constraints. This way, adapted SPARQL clients will be able to exploit the partial result, but other clients will not treat the partial result as complete result and all clients get what they expect. Making the status code for partial results configurable would prevent the implementation of generic, adapted clients making use of the partial result features.
Thoughts and comments welcome. I didn't saw any argument against this approach yet.
There's a new note about changes we've made to the "Anytime Query" feature of Virtuoso.
Goal: To reduce confusion by offering more configuration options and use of HTTP response code.
That is little progress, but it does not really solve the problems:
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?test1
WHERE {
SERVICE <https://dbpedia.org/sparql> {
SELECT (SUM(xsd:integer(CONCAT(?v1,?v2,?v3,?v4,?v5,?v6,?v7,?v8,?v9))) AS ?test1)
WHERE {
VALUES ?v1 {0 1 2 3 4 5 6 7 8 9}
VALUES ?v2 {0 1 2 3 4 5 6 7 8 9}
VALUES ?v3 {0 1 2 3 4 5 6 7 8 9}
VALUES ?v4 {0 1 2 3 4 5 6 7 8 9}
VALUES ?v5 {0 1 2 3 4 5 6 7 8 9}
VALUES ?v6 {0 1 2 3 4 5 6 7 8 9}
VALUES ?v7 {0 1 2 3 4 5 6 7 8 9}
VALUES ?v8 {0 1 2 3 4 5 6 7 8 9}
VALUES ?v9 {0 1 2 3 4 5 6 7 8 9}
}
}
}
Accept: application/sparql-results+json
Accept: application/sparql-results+json
Accept: application/sparql-results+json
Accept: application/sparql-results+json
Thank you for the detailed update, @jmkeil. I'll leave a detailed response to others.
Please do be aware that when providing Virtuoso version info, it's important to include the git_head
value which pins down the exact code from which a running binary was built. Without this value, the binary may have been built from any codepoint over weeks or even months. You can get the git_head
with the SPARQL query on this page or from the footer of recent versions of /sparql
, /fct
, or various other hosted applications, as can today be seen on demo.openlinksw.com/sparql
(9566ba38b4
) and dbpedia.org/sparql
(5ca4dd4f09
).
I'm trying to get a top type count for DBpedia (Virtuoso version 07.00.3207 on Linux (x86_64-redhat-linux-gnu), Single Server Edition):
returns (apart from other rows) this row 1:
http://dbpedia.org/ontology/Place 89498
Out of curiosity i checked this again with the query below:
tells me it's
754450
2There's an order of magnitude difference in these 2 counts. Please tell me I'm doing it wrong.
PS: i tried the first query without the group by, order by and limit clause, doesn't make a difference.