From 3193a363d93a8dd89bafb2d9f5726fadc5ad88af Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Mon, 11 Oct 2021 13:39:18 +0200 Subject: [PATCH 01/28] Basic scaffolding for defining SPARQL Update in Solid --- protocol.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/protocol.html b/protocol.html index fdd5b3f0..fea5d5cb 100644 --- a/protocol.html +++ b/protocol.html @@ -704,6 +704,12 @@

Writing Resources

When a POST method request targets a resource without an existing representation, the server MUST respond with the 404 status code. [Source]

+

+ When the target resource of a PATCH request is represented by an RDF document [RDF11-CONCEPTS], servers MUST support changing the representation using the request body containing a subset of SPARQL Update as defined in Appendix A. + Servers MAY further support SPARQL 1.1 Update [SPARQL], + except that servers MUST NOT allow a request with a PATCH method to change other resources than the target resource. +

+

When a PUT or PATCH method request targets an auxiliary resource, the server MUST create or update it. When a POST method request with the Slug header targets an auxiliary resource, the server MUST respond with the 403 status code and response body describing the error. [Source]

Servers MUST NOT allow HTTP POST, PUT and PATCH to update a container’s containment triples; if the server receives such a request, it MUST respond with a 409 status code. [Source]

@@ -1045,6 +1051,13 @@

Security and Privacy Review

+
+

Appendix A - A subset of SPARQL Update for Solid

+
+

..

+
+
+

References

@@ -1100,6 +1113,8 @@

Normative References

Web Linking. M. Nottingham. IETF. October 2017. Proposed Standard. URL: https://httpwg.org/specs/rfc8288.html
[SOLID-OIDC]
SOLID-OIDC. Aaron Coburn; elf Pavlik; Dmitri Zagidulin. W3C Solid Community Group. W3C Editor's Draft. URL: https://solid.github.io/solid-oidc/
+
[SPARQL]
+
SPARQL 1.1 Overview. The W3C SPARQL Working Group. W3C. 21 March 2013. W3C Recommendation. URL: https://www.w3.org/TR/sparql11-overview/
[Turtle]
RDF 1.1 Turtle. Eric Prud'hommeaux; Gavin Carothers. W3C. 25 February 2014. W3C Recommendation. URL: https://www.w3.org/TR/turtle/
[W3C-HTML]
From 829697f9eb43a3aad979ba1bb6c2d14d6b95d5dd Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Mon, 11 Oct 2021 13:44:49 +0200 Subject: [PATCH 02/28] Add source --- protocol.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol.html b/protocol.html index fea5d5cb..ed195c91 100644 --- a/protocol.html +++ b/protocol.html @@ -707,7 +707,7 @@

Writing Resources

When the target resource of a PATCH request is represented by an RDF document [RDF11-CONCEPTS], servers MUST support changing the representation using the request body containing a subset of SPARQL Update as defined in Appendix A. Servers MAY further support SPARQL 1.1 Update [SPARQL], - except that servers MUST NOT allow a request with a PATCH method to change other resources than the target resource. + except that servers MUST NOT allow a request with a PATCH method to change other resources than the target resource. [Source]

When a PUT or PATCH method request targets an auxiliary resource, the server MUST create or update it. When a POST method request with the Slug header targets an auxiliary resource, the server MUST respond with the 403 status code and response body describing the error. [Source]

From 0a56dcdfa309680d465d9caa52b6782ca9b6dc96 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Tue, 12 Oct 2021 00:01:15 +0200 Subject: [PATCH 03/28] Initial definition of SPARQL subset grammar --- protocol.html | 137 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 136 insertions(+), 1 deletion(-) diff --git a/protocol.html b/protocol.html index ed195c91..8a30e069 100644 --- a/protocol.html +++ b/protocol.html @@ -1054,7 +1054,142 @@

Security and Privacy Review

Appendix A - A subset of SPARQL Update for Solid

-

..

+
+

Grammar

+
+

Note: Definition of SPARQL Update Subset

+
+

This specification alters the grammar of 10 rules in the original grammar of the SPARQL 1.1 Query Language [SPARQL] grammar and introduces another 10 new rules to accommodate for INSERT DATA and DELETE DATA, which was defined in the language definition but not precisely defined in the grammar. This specification references the original grammar definition where no changes were made. +

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[30p] Update1 ::= Prologue ( InsertData | DeleteData | Modify )
[38p] InsertData ::= 'INSERT DATA' TripleData
[39p] DeleteData ::= 'DELETE DATA' TripleData
[41p] Modify ::= ( DeleteClause InsertClause? | InsertClause ) 'WHERE' GroupGraphPattern
[42p] DeleteClause ::= 'DELETE' TriplesTemplate
[43p] InsertClause ::= 'INSERT' TriplesTemplate
[52d] TripleData ::= TriplesDataSameSubject ( '.' TripleData? )?
[53p] GroupGraphPattern ::= '{' GroupGraphPatternSub ) '}'
[54p] GroupGraphPatternSub ::= TriplesBlock
[55p] TriplesBlock ::= TriplesSameSubject ( '.' TriplesBlock? )?
[75d] TriplesDataSameSubject ::= GraphTerm PropertyDataListNotEmpty | TriplesDataNode PropertyDataList
[76d] PropertyDataList ::= PropertyDataListNotEmpty?
[77d] PropertyDataListNotEmpty ::= Verb ObjectDataList ( ';' ( Verb ObjectDataList )? )*
[78p] Verb ::= iri | 'a'
[79d] ObjectDataList ::= ObjectData ( ',' ObjectData )*
[80d] ObjectData ::= GraphDataNode
[98d] TriplesDataNode ::= CollectionData | BlankNodeDataPropertyList
[99d] BlankNodeDataPropertyList ::= '[' PropertyDataListNotEmpty ']'
[102d] CollectionData ::= '(' GraphDataNode+ ')'
[104d] GraphDataNode ::= GraphTerm | TriplesDataNode
+
+
From b59fd2dc6489e08fb6e757a86e52e3dd9cd5fa35 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Tue, 12 Oct 2021 01:03:20 +0200 Subject: [PATCH 04/28] Fix missing curly brackets --- protocol.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/protocol.html b/protocol.html index 8a30e069..c9e71a64 100644 --- a/protocol.html +++ b/protocol.html @@ -1076,13 +1076,13 @@

Note: Definition of SPARQL Update Subset [38p] InsertData ::= - 'INSERT DATA' TripleData + 'INSERT DATA' '{' TripleData '}' [39p] DeleteData ::= - 'DELETE DATA' TripleData + 'DELETE DATA' '{' TripleData '}' [41p] @@ -1094,13 +1094,13 @@

Note: Definition of SPARQL Update Subset [42p] DeleteClause ::= - 'DELETE' TriplesTemplate + 'DELETE' '{' TriplesTemplate '}' [43p] InsertClause ::= - 'INSERT' TriplesTemplate + 'INSERT' '{' TriplesTemplate '}' [52d] From 1b714f8edcb537b8eed04624d147a45a569ade52 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Tue, 12 Oct 2021 01:15:17 +0200 Subject: [PATCH 05/28] Don't number the appendix --- protocol.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol.html b/protocol.html index c9e71a64..26ecef78 100644 --- a/protocol.html +++ b/protocol.html @@ -705,7 +705,7 @@

Writing Resources

When a POST method request targets a resource without an existing representation, the server MUST respond with the 404 status code. [Source]

- When the target resource of a PATCH request is represented by an RDF document [RDF11-CONCEPTS], servers MUST support changing the representation using the request body containing a subset of SPARQL Update as defined in Appendix A. + When the target resource of a PATCH request is represented by an RDF document [RDF11-CONCEPTS], servers MUST support changing the representation using the request body containing a subset of SPARQL Update as defined in the Appendix. Servers MAY further support SPARQL 1.1 Update [SPARQL], except that servers MUST NOT allow a request with a PATCH method to change other resources than the target resource. [Source]

@@ -1052,7 +1052,7 @@

Security and Privacy Review

-

Appendix A - A subset of SPARQL Update for Solid

+

Appendix - A subset of SPARQL Update for Solid

Grammar

From fbd599091b1afd56ba16f0a69d1009ab13497600 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Wed, 13 Oct 2021 02:12:46 +0200 Subject: [PATCH 06/28] Simplify the BNF --- protocol.html | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/protocol.html b/protocol.html index 26ecef78..756b7db7 100644 --- a/protocol.html +++ b/protocol.html @@ -1088,7 +1088,7 @@

Note: Definition of SPARQL Update Subset [41p] Modify ::= - ( DeleteClause InsertClause? | InsertClause ) 'WHERE' GroupGraphPattern + ( DeleteClause InsertClause? | InsertClause ) 'WHERE' '{' TriplesTemplate '}' [42p] @@ -1108,24 +1108,6 @@

Note: Definition of SPARQL Update Subset ::= TriplesDataSameSubject ( '.' TripleData? )? - - [53p] - GroupGraphPattern - ::= - '{' GroupGraphPatternSub ) '}' - - - [54p] - GroupGraphPatternSub - ::= - TriplesBlock - - - [55p] - TriplesBlock - ::= - TriplesSameSubject ( '.' TriplesBlock? )? - [75d] TriplesDataSameSubject From 65cb624e6b219e77d32a4c7a9825f01ca1ed5724 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Wed, 13 Oct 2021 02:16:13 +0200 Subject: [PATCH 07/28] Reintroduce DeleteWhere --- protocol.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/protocol.html b/protocol.html index 756b7db7..567da45b 100644 --- a/protocol.html +++ b/protocol.html @@ -1070,7 +1070,7 @@

Note: Definition of SPARQL Update Subset [30p] Update1 ::= - Prologue ( InsertData | DeleteData | Modify ) + Prologue ( InsertData | DeleteData | DeleteWhere | Modify ) [38p] @@ -1084,6 +1084,12 @@

Note: Definition of SPARQL Update Subset ::= 'DELETE DATA' '{' TripleData '}' + + [40p] + DeleteWhere + ::= + 'DELETE WHERE' '{' TriplesTemplate '}' + [41p] Modify From 79d5021e6a938bb75afbd48b494883ac402def32 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Wed, 13 Oct 2021 02:17:15 +0200 Subject: [PATCH 08/28] Update change count --- protocol.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol.html b/protocol.html index 567da45b..2f7a517a 100644 --- a/protocol.html +++ b/protocol.html @@ -1059,7 +1059,7 @@

Grammar

Note: Definition of SPARQL Update Subset

-

This specification alters the grammar of 10 rules in the original grammar of the SPARQL 1.1 Query Language [SPARQL] grammar and introduces another 10 new rules to accommodate for INSERT DATA and DELETE DATA, which was defined in the language definition but not precisely defined in the grammar. This specification references the original grammar definition where no changes were made. +

This specification alters the grammar of 8 rules in the original grammar of the SPARQL 1.1 Query Language [SPARQL] grammar and introduces another 10 new rules to accommodate for INSERT DATA and DELETE DATA, which was defined in the language definition but not precisely defined in the grammar. This specification references the original grammar definition where no changes were made.

From fed2294239e4a4df26472051aaaab7acca072547 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Thu, 14 Oct 2021 02:06:31 +0200 Subject: [PATCH 09/28] Adopt NSS behaviour for SPARQL Update --- protocol.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/protocol.html b/protocol.html index 26ecef78..e838534a 100644 --- a/protocol.html +++ b/protocol.html @@ -710,6 +710,12 @@

Writing Resources

except that servers MUST NOT allow a request with a PATCH method to change other resources than the target resource. [Source]

+

+ When the request body of a PATCH request has a SPARQL Update query that contains an INSERT keyword, servers MUST treat the request as an Append operation. + When the query contains a WHERE keyword, servers MUST treat the request as a Read operation. + When the query contains a DELETE keyword, servers MUST treat the request as a Read and Write operation. +

+

When a PUT or PATCH method request targets an auxiliary resource, the server MUST create or update it. When a POST method request with the Slug header targets an auxiliary resource, the server MUST respond with the 403 status code and response body describing the error. [Source]

Servers MUST NOT allow HTTP POST, PUT and PATCH to update a container’s containment triples; if the server receives such a request, it MUST respond with a 409 status code. [Source]

From 7545e63b9e85121d4081e49fd89f16b21093ff39 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Fri, 15 Oct 2021 01:50:22 +0200 Subject: [PATCH 10/28] Propose to use the 422 response for outside of subset --- protocol.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/protocol.html b/protocol.html index e838534a..3a072946 100644 --- a/protocol.html +++ b/protocol.html @@ -708,6 +708,8 @@

Writing Resources

When the target resource of a PATCH request is represented by an RDF document [RDF11-CONCEPTS], servers MUST support changing the representation using the request body containing a subset of SPARQL Update as defined in the Appendix. Servers MAY further support SPARQL 1.1 Update [SPARQL], except that servers MUST NOT allow a request with a PATCH method to change other resources than the target resource. [Source] + Servers that receives a request body containing a SPARQL query that falls outside of the subset they are able to process MUST respond with a 422 status code [RFC4918] and a message body that explains the error. +

@@ -1224,6 +1226,8 @@

Normative References

Registration Procedures for Message Header Fields. G. Klyne; M. Nottingham; J. Mogul. IETF. September 2004. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc3864
[RFC3986]
Uniform Resource Identifier (URI): Generic Syntax. T. Berners-Lee; R. Fielding; L. Masinter. IETF. January 2005. Internet Standard. URL: https://datatracker.ietf.org/doc/html/rfc3986
+
[RFC4918]
+
HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV). L. Dusseault, Ed.. IETF. June 2007. Proposed Standard. URL: https://datatracker.ietf.org/doc/html/rfc4918
[RFC5023]
The Atom Publishing Protocol. J. Gregorio, Ed.; B. de hOra, Ed.. IETF. October 2007. Proposed Standard. URL: https://datatracker.ietf.org/doc/html/rfc5023
[RFC5789]
From e7b3b07c8fb2c1a75049900156180ecd7b8dd40d Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Fri, 15 Oct 2021 13:56:05 +0200 Subject: [PATCH 11/28] Fix id --- protocol.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol.html b/protocol.html index 3a072946..5e143060 100644 --- a/protocol.html +++ b/protocol.html @@ -708,7 +708,7 @@

Writing Resources

When the target resource of a PATCH request is represented by an RDF document [RDF11-CONCEPTS], servers MUST support changing the representation using the request body containing a subset of SPARQL Update as defined in the Appendix. Servers MAY further support SPARQL 1.1 Update [SPARQL], except that servers MUST NOT allow a request with a PATCH method to change other resources than the target resource. [Source] - Servers that receives a request body containing a SPARQL query that falls outside of the subset they are able to process MUST respond with a 422 status code [RFC4918] and a message body that explains the error. + Servers that receives a request body containing a SPARQL query that falls outside of the subset they are able to process MUST respond with a 422 status code [RFC4918] and a message body that explains the error.

From d08142ee43ac75ceab9c9928537435cd98e4eddd Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Fri, 15 Oct 2021 14:48:30 +0200 Subject: [PATCH 12/28] Add possible semaphore mechanism wording --- protocol.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/protocol.html b/protocol.html index 5e143060..0296d1ea 100644 --- a/protocol.html +++ b/protocol.html @@ -712,6 +712,10 @@

Writing Resources

+

+ If servers that process DELETE/INSERT queries (as defined in SPARQL 1.1 Section 3.1.3, [SPARQL]), finds any solution that produces a triple containing an unbound variable or an illegal RDF construct, then the server MUST abort any modifications and respond with a 409 status code. +

+

When the request body of a PATCH request has a SPARQL Update query that contains an INSERT keyword, servers MUST treat the request as an Append operation. When the query contains a WHERE keyword, servers MUST treat the request as a Read operation. From 9f483f5bf76fe1a029dce9975bcc324890f9174c Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Fri, 15 Oct 2021 17:17:13 +0200 Subject: [PATCH 13/28] Add overview section, link Yacker for completeness --- protocol.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/protocol.html b/protocol.html index 2f7a517a..22544b7d 100644 --- a/protocol.html +++ b/protocol.html @@ -1054,6 +1054,16 @@

Security and Privacy Review

Appendix - A subset of SPARQL Update for Solid

+
+

Overview

+
+

This section is non-normative.

+ +

The objective of the subset is to identify a subset of SPARQL 1.1 Update [SPARQL] that is relatively easy to implement and contains features that are most commonly used. It thus takes variations of the INSERT and DELETE operations and allows operations on basic triple patterns only. The subset is compatible with SPARQL 1.1 Update and is defined in terms of a grammar. To further examine the definition, see the Yacker validator. +

+
+
+

Grammar

From 3555ea34ea5bb2a45b8ce7855e810986d7331b75 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Wed, 20 Oct 2021 14:42:37 +0200 Subject: [PATCH 14/28] Add that it should not produce more than one solution --- protocol.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol.html b/protocol.html index 031f31aa..0860c906 100644 --- a/protocol.html +++ b/protocol.html @@ -713,7 +713,7 @@

Writing Resources

- If servers that process DELETE/INSERT queries (as defined in SPARQL 1.1 Section 3.1.3, [SPARQL]), finds any solution that produces a triple containing an unbound variable or an illegal RDF construct, then the server MUST abort any modifications and respond with a 409 status code. + If servers that process DELETE/INSERT queries (as defined in SPARQL 1.1 Section 3.1.3, [SPARQL]), finds any solution that produces a triple containing an unbound variable or an illegal RDF construct, or more than one solution, then the server MUST abort any modifications and respond with a 409 status code.

From 5208010daaab6f92e6ae8077575a1a522473110a Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Wed, 20 Oct 2021 14:44:56 +0200 Subject: [PATCH 15/28] fix ids --- protocol.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol.html b/protocol.html index 0860c906..c67ad4bf 100644 --- a/protocol.html +++ b/protocol.html @@ -713,7 +713,7 @@

Writing Resources

- If servers that process DELETE/INSERT queries (as defined in SPARQL 1.1 Section 3.1.3, [SPARQL]), finds any solution that produces a triple containing an unbound variable or an illegal RDF construct, or more than one solution, then the server MUST abort any modifications and respond with a 409 status code. + If servers that process DELETE/INSERT queries (as defined in SPARQL 1.1 Section 3.1.3, [SPARQL]), finds any solution that produces a triple containing an unbound variable or an illegal RDF construct, or more than one solution, then the server MUST abort any modifications and respond with a 409 status code.

From 38eabc2634380f2203353231e6353339925680b3 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Wed, 20 Oct 2021 14:50:21 +0200 Subject: [PATCH 16/28] Requirement on DELETE DATA --- protocol.html | 1 + 1 file changed, 1 insertion(+) diff --git a/protocol.html b/protocol.html index c67ad4bf..3f50297a 100644 --- a/protocol.html +++ b/protocol.html @@ -714,6 +714,7 @@

Writing Resources

If servers that process DELETE/INSERT queries (as defined in SPARQL 1.1 Section 3.1.3, [SPARQL]), finds any solution that produces a triple containing an unbound variable or an illegal RDF construct, or more than one solution, then the server MUST abort any modifications and respond with a 409 status code. + If servers that process a request that first contains a DELETE DATA and then a INSERT DATA operation, finds that the first operation does not delete any triples, then the server MUST abort any modifications and respond with a 409 status code.

From 589907af772196516551f8c3975309b47a95e1ee Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Wed, 20 Oct 2021 14:52:44 +0200 Subject: [PATCH 17/28] Add reference --- protocol.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/protocol.html b/protocol.html index 3f50297a..a81b01eb 100644 --- a/protocol.html +++ b/protocol.html @@ -1264,6 +1264,8 @@

Normative References

[SPARQL]
SPARQL 1.1 Overview. The W3C SPARQL Working Group. W3C. 21 March 2013. W3C Recommendation. URL: https://www.w3.org/TR/sparql11-overview/
[Turtle]
+
[SPARQL11-UPDATE]
+
SPARQL 1.1 Update. Paula Gearon; Alexandre Passant; Axel Polleres. W3C. 21 March 2013. W3C Recommendation. URL: https://www.w3.org/TR/sparql11-update/
RDF 1.1 Turtle. Eric Prud'hommeaux; Gavin Carothers. W3C. 25 February 2014. W3C Recommendation. URL: https://www.w3.org/TR/turtle/
[W3C-HTML]
HTML. W3C. 28 January 2021. W3C Recommendation. URL: https://www.w3.org/TR/html/
From 6818273dc647a5173a375f45b27c3c681fca1bc6 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Wed, 20 Oct 2021 14:53:11 +0200 Subject: [PATCH 18/28] Fix error --- protocol.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol.html b/protocol.html index a81b01eb..1e26e0b2 100644 --- a/protocol.html +++ b/protocol.html @@ -1263,9 +1263,9 @@

Normative References

SOLID-OIDC. Aaron Coburn; elf Pavlik; Dmitri Zagidulin. W3C Solid Community Group. W3C Editor's Draft. URL: https://solid.github.io/solid-oidc/
[SPARQL]
SPARQL 1.1 Overview. The W3C SPARQL Working Group. W3C. 21 March 2013. W3C Recommendation. URL: https://www.w3.org/TR/sparql11-overview/
-
[Turtle]
[SPARQL11-UPDATE]
SPARQL 1.1 Update. Paula Gearon; Alexandre Passant; Axel Polleres. W3C. 21 March 2013. W3C Recommendation. URL: https://www.w3.org/TR/sparql11-update/
+
[Turtle]
RDF 1.1 Turtle. Eric Prud'hommeaux; Gavin Carothers. W3C. 25 February 2014. W3C Recommendation. URL: https://www.w3.org/TR/turtle/
[W3C-HTML]
HTML. W3C. 28 January 2021. W3C Recommendation. URL: https://www.w3.org/TR/html/
From dd0c6e09fd155e2bb984e26c1f2992d48b3c1bd2 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Wed, 20 Oct 2021 14:55:44 +0200 Subject: [PATCH 19/28] Use the reference --- protocol.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol.html b/protocol.html index 1e26e0b2..a6ef51d3 100644 --- a/protocol.html +++ b/protocol.html @@ -713,7 +713,7 @@

Writing Resources

- If servers that process DELETE/INSERT queries (as defined in SPARQL 1.1 Section 3.1.3, [SPARQL]), finds any solution that produces a triple containing an unbound variable or an illegal RDF construct, or more than one solution, then the server MUST abort any modifications and respond with a 409 status code. + If servers that process DELETE/INSERT queries (as defined in SPARQL 1.1 Section 3.1.3, [SPARQL11-UPDATE]), finds any solution that produces a triple containing an unbound variable or an illegal RDF construct, or more than one solution, then the server MUST abort any modifications and respond with a 409 status code. If servers that process a request that first contains a DELETE DATA and then a INSERT DATA operation, finds that the first operation does not delete any triples, then the server MUST abort any modifications and respond with a 409 status code.

@@ -1072,7 +1072,7 @@

Overview

This section is non-normative.

-

The objective of the subset is to identify a subset of SPARQL 1.1 Update [SPARQL] that is relatively easy to implement and contains features that are most commonly used. It thus takes variations of the INSERT and DELETE operations and allows operations on basic triple patterns only. The subset is compatible with SPARQL 1.1 Update and is defined in terms of a grammar. To further examine the definition, see the Yacker validator. +

The objective of the subset is to identify a subset of SPARQL 1.1 Update [SPARQL11-UPDATE] that is relatively easy to implement and contains features that are most commonly used. It thus takes variations of the INSERT and DELETE operations and allows operations on basic triple patterns only. The subset is compatible with SPARQL 1.1 Update and is defined in terms of a grammar. To further examine the definition, see the Yacker validator.

From f57321d9b0d04718b844cc3ec7874824db619d70 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Thu, 21 Oct 2021 01:10:13 +0200 Subject: [PATCH 20/28] Move SPARQL patch into a section; Introduce a REMOVE keyword; Many editorial changes --- protocol.html | 61 ++++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/protocol.html b/protocol.html index a6ef51d3..8f493e03 100644 --- a/protocol.html +++ b/protocol.html @@ -704,25 +704,6 @@

Writing Resources

When a POST method request targets a resource without an existing representation, the server MUST respond with the 404 status code. [Source]

-

- When the target resource of a PATCH request is represented by an RDF document [RDF11-CONCEPTS], servers MUST support changing the representation using the request body containing a subset of SPARQL Update as defined in the Appendix. - Servers MAY further support SPARQL 1.1 Update [SPARQL], - except that servers MUST NOT allow a request with a PATCH method to change other resources than the target resource. [Source] - Servers that receives a request body containing a SPARQL query that falls outside of the subset they are able to process MUST respond with a 422 status code [RFC4918] and a message body that explains the error. - -

- -

- If servers that process DELETE/INSERT queries (as defined in SPARQL 1.1 Section 3.1.3, [SPARQL11-UPDATE]), finds any solution that produces a triple containing an unbound variable or an illegal RDF construct, or more than one solution, then the server MUST abort any modifications and respond with a 409 status code. - If servers that process a request that first contains a DELETE DATA and then a INSERT DATA operation, finds that the first operation does not delete any triples, then the server MUST abort any modifications and respond with a 409 status code. -

- -

- When the request body of a PATCH request has a SPARQL Update query that contains an INSERT keyword, servers MUST treat the request as an Append operation. - When the query contains a WHERE keyword, servers MUST treat the request as a Read operation. - When the query contains a DELETE keyword, servers MUST treat the request as a Read and Write operation. -

-

When a PUT or PATCH method request targets an auxiliary resource, the server MUST create or update it. When a POST method request with the Slug header targets an auxiliary resource, the server MUST respond with the 403 status code and response body describing the error. [Source]

Servers MUST NOT allow HTTP POST, PUT and PATCH to update a container’s containment triples; if the server receives such a request, it MUST respond with a 409 status code. [Source]

@@ -736,7 +717,33 @@

Note: Conditional Update

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.

-
+ +
+

Using SPARQL to Patch Resources

+
+

+ When the target resource of a PATCH request is represented by an RDF document [RDF11-CONCEPTS], servers MUST support changing the representation using the request body containing a variation of SPARQL Update as defined in the Appendix. + Servers MAY further support SPARQL 1.1 Update [SPARQL], + except that servers MUST NOT allow a request with a PATCH method to change other resources than the target resource. [Source] + Servers that receives a request body containing a SPARQL query that falls outside of the what they are able to process MUST respond with a 422 status code [RFC4918] and a message body that explains the error. +

+ +

+ If servers that process REMOVE/INSERT queries (as defined in the Appendix), finds any solution that produces a triple containing an unbound variable or an illegal RDF construct, or more than one solution, then the server MUST abort any modifications and respond with a 409 status code. + If servers that process a request that first contains a REMOVE DATA and then a INSERT DATA operation, finds that the first operation does not delete any triples, then the server MUST abort any modifications and respond with a 409 status code. +

+ +

+ When the request body of a PATCH request has a SPARQL Update query that contains an INSERT keyword, servers MUST treat the request as an Append operation. + When the query contains a WHERE keyword, servers MUST treat the request as a Read operation. + When the query contains a DELETE keyword, servers MUST treat the request as a Write operation. + When the query contains a REMOVE keyword, servers MUST treat the request as a Read and Write operation. +

+ +
+
+ +

Deleting Resources

@@ -1064,23 +1071,23 @@

Security and Privacy Review

-
-

Appendix - A subset of SPARQL Update for Solid

+
+

Appendix - A variant of SPARQL Update for Solid

-
+

Overview

This section is non-normative.

-

The objective of the subset is to identify a subset of SPARQL 1.1 Update [SPARQL11-UPDATE] that is relatively easy to implement and contains features that are most commonly used. It thus takes variations of the INSERT and DELETE operations and allows operations on basic triple patterns only. The subset is compatible with SPARQL 1.1 Update and is defined in terms of a grammar. To further examine the definition, see the Yacker validator. +

The objective of the variant is to identify a variant of SPARQL 1.1 Update [SPARQL11-UPDATE] that is relatively easy to implement and contains features that are most commonly used. It thus takes variations of the INSERT and DELETE operations and allows operations on basic triple patterns only. The variant is compatible with SPARQL 1.1 Update and is defined in terms of a grammar. To further examine the definition, see the Yacker validator.

-
+

Grammar

-
-

Note: Definition of SPARQL Update Subset

+
+

Note: Definition of SPARQL Update Variant

This specification alters the grammar of 8 rules in the original grammar of the SPARQL 1.1 Query Language [SPARQL] grammar and introduces another 10 new rules to accommodate for INSERT DATA and DELETE DATA, which was defined in the language definition but not precisely defined in the grammar. This specification references the original grammar definition where no changes were made.

From a5b7e18fee15fb0464f6571c690d3550fba68907 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Thu, 21 Oct 2021 10:17:45 +0200 Subject: [PATCH 21/28] Add REMOVE DATA definition; Adapt text --- protocol.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/protocol.html b/protocol.html index 8f493e03..2cea85c1 100644 --- a/protocol.html +++ b/protocol.html @@ -1079,11 +1079,21 @@

Overview

This section is non-normative.

-

The objective of the variant is to identify a variant of SPARQL 1.1 Update [SPARQL11-UPDATE] that is relatively easy to implement and contains features that are most commonly used. It thus takes variations of the INSERT and DELETE operations and allows operations on basic triple patterns only. The variant is compatible with SPARQL 1.1 Update and is defined in terms of a grammar. To further examine the definition, see the Yacker validator. +

The objective of this variant is two-fold: Firstly, it is a variant of SPARQL 1.1 Update [SPARQL11-UPDATE] that is relatively easy to implement and contains features that are most commonly used. Secondly, it seeks to enable a semaphore mechanism that exploits that if a delete operation does not remove any triples, it may have been due to an edit conflict. Since this is incompatible with SPARQL 1.1 as defined, it introduces a REMOVE keyword. To further examine the grammar definition, see the Yacker validator.

+
+

Definition

+ +

+ REMOVE DATA differs from DELETE DATA as defined in SPARQL 1.1 Update [SPARQL11-UPDATE] only in that the deletion of non-existing data results in a failure. +

+ + +
+

Grammar

From d90a9185bb4edbb090dd9176ea813f48182d68c6 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Thu, 21 Oct 2021 10:33:56 +0200 Subject: [PATCH 22/28] Clarify what is supported --- protocol.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/protocol.html b/protocol.html index 2cea85c1..d001f938 100644 --- a/protocol.html +++ b/protocol.html @@ -1079,7 +1079,7 @@

Overview

This section is non-normative.

-

The objective of this variant is two-fold: Firstly, it is a variant of SPARQL 1.1 Update [SPARQL11-UPDATE] that is relatively easy to implement and contains features that are most commonly used. Secondly, it seeks to enable a semaphore mechanism that exploits that if a delete operation does not remove any triples, it may have been due to an edit conflict. Since this is incompatible with SPARQL 1.1 as defined, it introduces a REMOVE keyword. To further examine the grammar definition, see the Yacker validator. +

The objective of this variant is two-fold: Firstly, it is a variant of SPARQL 1.1 Update [SPARQL11-UPDATE] that is relatively easy to implement and contains features that are most commonly used. Secondly, it seeks to enable a semaphore mechanism that exploits that if a delete operation does not remove any triples, it may have been due to an edit conflict. Since this is incompatible with SPARQL 1.1 as defined, it introduces a REMOVE keyword. The variant operates over triples and triple patterns only, and uses basic graph patterns, and does not include more advanced features. To further examine the grammar definition, see the Yacker validator.

@@ -1088,10 +1088,11 @@

Overview

Definition

- REMOVE DATA differs from DELETE DATA as defined in SPARQL 1.1 Update [SPARQL11-UPDATE] only in that the deletion of non-existing data results in a failure. + REMOVE DATA differs from DELETE DATA as defined in SPARQL 1.1 Update [SPARQL11-UPDATE] in that the deletion of non-existing data results in a failure.

+
From 77ec88911421bd551ac83548e71681b5f2ab2a14 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Thu, 21 Oct 2021 10:36:52 +0200 Subject: [PATCH 23/28] Attempt at defining REMOVE --- protocol.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/protocol.html b/protocol.html index d001f938..50acace9 100644 --- a/protocol.html +++ b/protocol.html @@ -1091,7 +1091,9 @@

Definition

REMOVE DATA differs from DELETE DATA as defined in SPARQL 1.1 Update [SPARQL11-UPDATE] in that the deletion of non-existing data results in a failure.

- +

+ REMOVE differs from DELETE as defined in SPARQL 1.1 Update [SPARQL11-UPDATE] in that when the corresponding WHERE clause does not match exactly one solution, it results in a failure. +

From af937c953b392bf742caf4a53b74326776e54254 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Thu, 21 Oct 2021 10:43:32 +0200 Subject: [PATCH 24/28] Set requirements on failures in general --- protocol.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/protocol.html b/protocol.html index 50acace9..3649e4b8 100644 --- a/protocol.html +++ b/protocol.html @@ -729,8 +729,7 @@

Using SPARQL to Patch Resources

- If servers that process REMOVE/INSERT queries (as defined in the Appendix), finds any solution that produces a triple containing an unbound variable or an illegal RDF construct, or more than one solution, then the server MUST abort any modifications and respond with a 409 status code. - If servers that process a request that first contains a REMOVE DATA and then a INSERT DATA operation, finds that the first operation does not delete any triples, then the server MUST abort any modifications and respond with a 409 status code. + When servers that process requests containing REMOVE or REMOVE DATA operations as defined in the Appendix detects a failure resulting from the processing of these operations, then the server MUST abort any modifications and respond with a 409 status code.

From fda8d1c529473853716b5e17e1678bb2bedb8c67 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Thu, 21 Oct 2021 10:56:44 +0200 Subject: [PATCH 25/28] Add media type --- protocol.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/protocol.html b/protocol.html index 3649e4b8..0b2e3771 100644 --- a/protocol.html +++ b/protocol.html @@ -1094,6 +1094,10 @@

Definition

REMOVE differs from DELETE as defined in SPARQL 1.1 Update [SPARQL11-UPDATE] in that when the corresponding WHERE clause does not match exactly one solution, it results in a failure.

+

+ The Internet Media Type / MIME Type for this variantr is "application/vnd.solid.sparql-patch". +

+
From 14a64c3977acd155ee4371be705dc208c673c6eb Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Thu, 21 Oct 2021 10:57:16 +0200 Subject: [PATCH 26/28] Fix typo --- protocol.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol.html b/protocol.html index 0b2e3771..5559000c 100644 --- a/protocol.html +++ b/protocol.html @@ -1095,7 +1095,7 @@

Definition

- The Internet Media Type / MIME Type for this variantr is "application/vnd.solid.sparql-patch". + The Internet Media Type / MIME Type for this variant is "application/vnd.solid.sparql-patch".

From 82ef2c53cc575990b3d942d3c62a02fe4059ab82 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Thu, 21 Oct 2021 11:03:39 +0200 Subject: [PATCH 27/28] Update grammar --- protocol.html | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/protocol.html b/protocol.html index 5559000c..4b312c06 100644 --- a/protocol.html +++ b/protocol.html @@ -1116,7 +1116,13 @@

Note: Definition of SPARQL Update Varian [30p] Update1 ::= - Prologue ( InsertData | DeleteData | DeleteWhere | Modify ) + Prologue ( InsertData | RemoveData | UpdateData | RemoveWhere | Modify ) + + + [31d] + UpdateData + ::= + RemoveData ';' InsertData [38p] @@ -1126,27 +1132,27 @@

Note: Definition of SPARQL Update Varian [39p] - DeleteData + RemoveData ::= - 'DELETE DATA' '{' TripleData '}' + 'REMOVE DATA' '{' TripleData '}' [40p] - DeleteWhere + RemoveWhere ::= - 'DELETE WHERE' '{' TriplesTemplate '}' + 'REMOVE WHERE' '{' TriplesTemplate '}' [41p] Modify ::= - ( DeleteClause InsertClause? | InsertClause ) 'WHERE' '{' TriplesTemplate '}' + ( RemoveClause InsertClause? | InsertClause ) 'WHERE' '{' TriplesTemplate '}' [42p] - DeleteClause + RemoveClause ::= - 'DELETE' '{' TriplesTemplate '}' + 'REMOVE' '{' TriplesTemplate '}' [43p] From 7bbcd184aaf01eb5b5ac258fa5bc3084c816c517 Mon Sep 17 00:00:00 2001 From: Kjetil Kjernsmo Date: Thu, 21 Oct 2021 11:05:46 +0200 Subject: [PATCH 28/28] Update note --- protocol.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol.html b/protocol.html index 4b312c06..3e1cc6d5 100644 --- a/protocol.html +++ b/protocol.html @@ -1105,7 +1105,7 @@

Grammar

Note: Definition of SPARQL Update Variant

-

This specification alters the grammar of 8 rules in the original grammar of the SPARQL 1.1 Query Language [SPARQL] grammar and introduces another 10 new rules to accommodate for INSERT DATA and DELETE DATA, which was defined in the language definition but not precisely defined in the grammar. This specification references the original grammar definition where no changes were made. +

This specification alters the grammar of 8 rules in the original grammar of the SPARQL 1.1 Query Language [SPARQL] grammar and introduces another 11 new rules to accommodate for INSERT DATA and REMOVE DATA, as the corresponding operations were defined in the language definition but not precisely defined in the grammar. This specification references the original grammar definition where no changes were made.