You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Subsequent INSERT DATA and DELETE DATA of the same triple with object "1234.56789e0"^^<http://www.w3.org/2001/XMLSchema#double> leads to response status 409 Conflict.
edit: The first request actually contained "1234.56789"^^<http://www.w3.org/2001/XMLSchema#double>, and the second one contained "1234.56789e0"^^<http://www.w3.org/2001/XMLSchema#double>. Please notice the e0 difference.
actual behavior
I send a patch request on an empty or non-existent resource (newlines added for easier readability):
Please note that typed literals were replaced with numbers.
Then i send another request (INSERT DATA changed to DELETE DATA):
edit: actually, there is additional small difference, the numbers also end with e0. when the e0 is removed, the request passes with 200 and data get deleted correctly. So NSS may behave consistently after all.
and the request fails with status code 409 Conflict and body
The patch could not be applied. Could not find to delete: <https://testuser.solidcommunity.net/path/to/resource#location> <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "60.235039190740146e0"^^<http://www.w3.org/2001/XMLSchema#double> .
or <https://testuser.solidcommunity.net/path/to/resource#location> <http://www.w3.org/2003/01/geo/wgs84_pos#long> "24.941368103027344e0"^^<http://www.w3.org/2001/XMLSchema#double> .
When typed literals are changed to numbers, response is 200.
expected behavior
Sending subsequent INSERT DATA {} and DELETE DATA {} with identical body should succeed.
Either the server should save the typed literal as typed literal, or it should treat typed literal "double" and number as identical for the purposes of DELETE DATA. Intuitively, the former feels more correct.
Name
solidcommunity.net
Description
An experimental solid server run by the community
Details
Running on [Node Solid Server 5.7.6](https://github.com/solid/node-solid-server/releases/tag/v5.7.6)
further note
Both requests were produced by Comunica. If we want to keep using the library, we have little control over the queries produced.
This may also be an issue with Comunica itself, since it might be creating incorrect DELETE DATA query - with typed literals, not numbers.
On the second look, the number in DELETE DATA request contained additional e0, e.g. "1234.56789e0"^^<http://www.w3.org/2001/XMLSchema#double>. When this e0 was removed, the request passed as expected and the data were correctly deleted.
So the NSS behaves consistently after all. Now, all that remains is the surprise that "123.456"^^xsd:double becomes 123.456e0.
So the remaining questions are:
is 123.456e0 equivalent to "123.456"^^xsd:double?
is 123.456e0 equivalent to "123.456e0"^^xsd:double? If not, why not?
In my usecase, i resolved the issue by using xsd:decimal instead of xsd:double, which was good enough. NSS then saved the number with the type tag, e.g. "123.456"^^xsd:decimal. And with this, Comunica didn't go funny... 🙂
I guess if someone can verify that 123.456e0 is equivalent to "123.456"^^xsd:double, and not equivalent to "123.456e0"^^xsd:double, then this can be closed as non-issue. My bad.
TL;DR
Subsequent
INSERT DATA
andDELETE DATA
of the same triple with object"1234.56789e0"^^<http://www.w3.org/2001/XMLSchema#double>
leads to response status409 Conflict
.edit: The first request actually contained
"1234.56789"^^<http://www.w3.org/2001/XMLSchema#double>
, and the second one contained"1234.56789e0"^^<http://www.w3.org/2001/XMLSchema#double>
. Please notice thee0
difference.actual behavior
I send a patch request on an empty or non-existent resource (newlines added for easier readability):
And a resource with the following content is produced:
Please note that typed literals were replaced with numbers.
Then i send another request (
INSERT DATA
changed toDELETE DATA
):edit: actually, there is additional small difference, the numbers also end with
e0
. when thee0
is removed, the request passes with 200 and data get deleted correctly. So NSS may behave consistently after all.and the request fails with status code
409 Conflict
and bodyWhen typed literals are changed to numbers, response is
200
.expected behavior
Sending subsequent
INSERT DATA {}
andDELETE DATA {}
with identical body should succeed.Either the server should save the typed literal as typed literal, or it should treat typed literal "double" and number as identical for the purposes of
DELETE DATA
. Intuitively, the former feels more correct.NSS version
Account on https://solidcommunity.net (2023-03-17)
further note
Both requests were produced by Comunica. If we want to keep using the library, we have little control over the queries produced.
This may also be an issue with Comunica itself, since it might be creating incorrect
DELETE DATA
query - with typed literals, not numbers.All depends on whether "1234.56789e0"^^http://www.w3.org/2001/XMLSchema#double and 1234.56789e0 are equivalent in RDF. idk whether they are.
Regardless, this is an issue with NSS.
The text was updated successfully, but these errors were encountered: