diff --git a/protocol.html b/protocol.html index 19b61453..f85764b2 100644 --- a/protocol.html +++ b/protocol.html @@ -717,6 +717,37 @@
Servers MAY use the HTTP ETag
header with a strong validator for RDF bearing representations in order to encourage clients to opt-in to using the If-Match
header in their requests.
When the target resource of a PATCH
request is an RDF document [RDF11-CONCEPTS], servers MUST support modifying that resource using a request body containing an N3 Patch. [Source]
An N3 Patch is a document in the Notation3 (N3) format [N3], identified by the MIME type text/n3
, conforming to the following structural constraints:
?patch solid:patches ?target
, in which ?patch
is a freely chosen identifier for a patch resource and ?target
is the URI of the RDF document to be modified.?patch solid:deletes ?deletions
.?patch solid:inserts ?insertions
.?patch solid:where ?conditions
.?deletions
, ?insertions
, and ?conditions
must be non-nested cited formulae [N3] consisting only of triples and/or triple patterns. When not present, they are presumed to be the empty formula {}
.While other specifications might provide a structure and interpretation for a wider class of N3 Patch documents, the present specification only governs the application of N3 Patch documents that additionally adhere to the following structural constraints:
+ +?target
is an exact match with the request URI.?patch solid:matchingStrategy solid:SingleMatch
.?insertions
and ?deletions
formulae may only contain variables that also occur in the ?conditions
formula.Servers MUST respond with a 400
status code if a patch document does not satisfy all of the above constraints.
Servers MUST process an N3 Patch document against the RDF dataset in the target document as follows, creating an empty RDF dataset if the resource does not exist yet. If ?conditions
is non-empty, then the dataset should contain exactly one match of its contents after variable substitution; if not, the server MUST respond with a 409
status code. The resulting (possibly empty) variable mapping must be propagated to the ?deletions
and ?insertions
formulae. Then, the resulting triples in ?deletions
must be removed from the RDF dataset if there is exactly one match; if not, the server MUST respond with a 409
status code. Finally, the resulting triples in ?deletions
must be added to the RDF graph. The combination of the deletions and insertions then forms the new resource state of the RDF document, and the server responds with the appropriate status code.