I am running a SELECT query which is expected to return no results. Using 'application/sparql-results+json' gives unexpected results.
SPARQL Query:
SELECT ?s ?g {
VALUES ?s { <https://example.com/person:unknown> }
GRAPH ?g {
?s ?p ?o .
}
}
GROUP BY ?s ?g
Response (application/sparql-results+json):
{
"head": {
"vars": [
"s",
"g"
]
},
"results": {
"bindings": [
{}
]
}
}
- The property 'results.bindings' returns an array of a single empty object when an array of length 0 is expected.
If we remove the 'GROUP BY' statement, the query returns expected results.
SPARQL Query:
SELECT ?s ?g {
VALUES ?s { <https://example.com/person:unknown> }
GRAPH ?g {
?s ?p ?o .
}
}
Response (application/sparql-results+json):
{
"head": {
"vars": [
"s",
"g"
]
},
"results": {
"bindings": []
}
}