Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

Mention willful violation of the sparql-update spec #193

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions api-rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,17 @@ If-None-Match](https://tools.ietf.org/html/rfc2616#section-14.24) HTTP headers.
because the behavior of PUT (overwrite) is not well defined for containers. You
MUST use POST (as defined by LDP) to create containers alone.

#### Alternative: Using SPARQL
#### Alternative: Using SPARQL Update

To write data, clients can send an HTTP PATCH request with a SPARQL payload to
To write data, clients can send an HTTP PATCH request with a [SPARQL Update](https://www.w3.org/TR/sparql11-update/) payload to
the resource in question. If the resource doesn't exist, it should be created
through an LDP POST or through a PUT.
through an LDP POST or through a PUT first.
Since PATCH requests only apply to a single graph, identified by the request target,
only a subset of SPARQL Update is supported, namely:

* [INSERT DATA](https://www.w3.org/TR/sparql11-update/#insertData)
* [DELETE DATA](https://www.w3.org/TR/sparql11-update/#deleteData)
* [INSERT/DELETE](https://www.w3.org/TR/sparql11-update/#deleteInsert)

For instance, to update the `title` of the container from the previous example,
the client would have to send a DELETE statement, followed by an INSERT
Expand All @@ -359,6 +365,15 @@ RESPONSE:
HTTP/1.1 200 OK
```

**Willful violation of the SPARQL Update spec:**
Solid purposely deviates from the SPARQL UPDATE specification.
A WHERE clause should result in _exactly_ one result mapping.
If there are zero matches, or if there is more than one match,
the server MUST reply with a 409.
This mechanism acts as a semaphore,
ensuring that the part of the data affected by the requested update
has not been altered in the meantime.

**IMPORTANT:** There is currently no support for blank nodes and RDF lists in
our SPARQL patches.

Expand Down Expand Up @@ -392,4 +407,4 @@ Servers SHOULD send a WAC-Allow response header on HEAD and GET, with a value li
```http
WAC-Allow: user="read write append control",public="read"
```
In general, the format is `user="` + user-permissions = `",public="` + public-permissions + `"`. User-permissions and public-permissions should both be space-separated lists, containing a subset of ['read', 'write', 'append', 'control']. If 'write' is present then 'append' should also be present.
In general, the format is `user="` + user-permissions = `",public="` + public-permissions + `"`. User-permissions and public-permissions should both be space-separated lists, containing a subset of ['read', 'write', 'append', 'control']. If 'write' is present then 'append' should also be present.
RubenVerborgh marked this conversation as resolved.
Show resolved Hide resolved