From 29218228c6550ab256e249d01b1fa12cbd61d557 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 6 Dec 2021 01:07:35 +0100 Subject: [PATCH] Stabilise n3-patch spec:requirements --- protocol.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/protocol.html b/protocol.html index d945f874..ae4be654 100644 --- a/protocol.html +++ b/protocol.html @@ -785,7 +785,7 @@

Note: Conditional Update

Modifying Resources Using N3 Patches

-

Servers MUST accept a PATCH request with an N3 Patch body when the target of the request is an RDF document [RDF11-CONCEPTS]. They MUST indicate such support by listing text/n3 as a value of the Accept-Patch header [RFC5789] of relevant responses. [Source]

+

Servers MUST accept a PATCH request with an N3 Patch body when the target of the request is an RDF document [RDF11-CONCEPTS]. Servers MUST indicate support of N3 Patch by listing text/n3 as a value of the Accept-Patch header [RFC5789] of relevant responses. [Source]

An N3 Patch is a document in the Notation3 (N3) format [N3], identified by the media type text/n3, conforming to the following constraints:

@@ -799,14 +799,14 @@

Modifying Resources Using N3 Patches

  • When present, ?deletions, ?insertions, and ?conditions MUST be non-nested cited formulae [N3] consisting only of triples and/or triple patterns [SPARQL11-QUERY]. 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 constraints:

    +

    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 constraints:

    -
      +
      • The patch document MUST contain exactly one patch resource, identified by one or more of the triple patterns described above, which all share the same ?patch subject.
      • The patch resource MAY contain one triple of the form ?patch solid:matchingStrategy solid:SingleMatch.
      • -
      • The ?insertions and ?deletions formulae MUST NOT contain variables that do not occur in the ?conditions formula.
      • -
      • The ?insertions and ?deletions formulae MUST NOT contain blank nodes.
      • -
      • The patch document MUST NOT contain any other triples.
      • +
      • The ?insertions and ?deletions formulae MUST NOT contain variables that do not occur in the ?conditions formula.
      • +
      • The ?insertions and ?deletions formulae MUST NOT contain blank nodes.
      • +
      • The patch document MUST NOT contain any other triples.

      Servers MUST respond with a 422 status code [RFC4918] if a patch document does not satisfy all of the above constraints.

      @@ -815,12 +815,12 @@

      Modifying Resources Using N3 Patches

      Servers MUST process a patch resource against the target document as follows:

      -
        +
        1. Start from the RDF dataset in the target document, or an empty RDF dataset if the target resource does not exist yet.
        2. If ?conditions is non-empty, find all (possibly empty) variable mappings such that all of the resulting triples occur in the dataset.
        3. -
        4. If no such mapping exists, or if multiple mappings exist, the server MUST respond with a 409 status code. [Source]
        5. +
        6. If no such mapping exists, or if multiple mappings exist, the server MUST respond with a 409 status code. [Source]
        7. The resulting variable mapping is propagated to the ?deletions and ?insertions formulae to obtain two sets of resulting triples.
        8. -
        9. If the set of triples resulting from ?deletions is non-empty and the dataset does not contain all of these triples, the server MUST respond with a 409 status code. [Source]
        10. +
        11. If the set of triples resulting from ?deletions is non-empty and the dataset does not contain all of these triples, the server MUST respond with a 409 status code. [Source]
        12. The triples resulting from ?deletions are to be removed from the RDF dataset.
        13. The triples resulting from ?insertions are to be added to the RDF dataset, with each blank node from ?insertions resulting in a newly created blank node.
        14. The combination of deletions followed by insertions then forms the new resource state of the RDF document, and the server responds with the appropriate status code.