Deletion of decimals fail with a 409

Open
#1,519 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, node.js
Domain
backend

Research direction

Start by reproducing the decimal DELETE DATA failure with the curl requests in the issue and compare it with the preceding INSERT DATA request. Trace the server's PATCH handling for decimal RDF terms; done means deleting the stored "1"^^xsd:decimal succeeds when the request uses the equivalent "1.0"^^xsd:decimal value.

Written by the indexing model from the issue text.

Description

When I write the following data to my Pod:

@prefix : <#>.
@prefix schem: <http://schema.org/>.

:160581889284507796464006133086
a schem:MonetaryAmount; schem:amount 1.0; schem:currency "USD".

Written using the following request:

curl 'https://vincent-test.solidcommunity.net/private/tmp/tripledoc-bug.ttl' -X PATCH -H 'Content-Type: application/sparql-update' --data-raw $' INSERT DATA {<https://vincent-test.solidcommunity.net/private/tmp/tripledoc-bug.ttl#160581889284507796464006133086> a <http://schema.org/MonetaryAmount>;\n    <http://schema.org/currency> "USD";\n    <http://schema.org/amount> "1"^^<http://www.w3.org/2001/XMLSchema#decimal>.\n};'

As far as I can tell I should be able to delete that data with the following PATCH:

DELETE DATA {<https://vincent-test.solidcommunity.net/private/tmp/tripledoc-bug.ttl#160581889284507796464006133086> a <http://schema.org/MonetaryAmount>;
    <http://schema.org/amount> "1.0"^^<http://www.w3.org/2001/XMLSchema#decimal>;
    <http://schema.org/currency> "USD".}; 

However, that results in the following response:

The patch could not be applied. Could not find to delete: https://vincent-test.solidcommunity.net/private/tmp/tripledoc-bug.ttl#160581889284507796464006133086 http://schema.org/amount "1.0"^^http://www.w3.org/2001/XMLSchema#decimal .

This appears to happen specifically with decimals. (Though it seems to be the problem has a similar root cause to https://github.com/solid/node-solid-server/issues/1468, but for decimals rather than booleans.)

See this sandbox for the reproduction (log in with a solidcommunity.net account): https://codesandbox.io/s/floral-glitter-jfejz?file=/src/index.ts

(Originally reported by @abigpotostew against Tripledoc.)

Dominant language
JavaScript
Stars
1.8k
Forks
308
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nodeSolidServer/node-solid-server

All issues in nodeSolidServer/node-solid-server

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.