- From: Pierre-Antoine Champin <pierre-antoine.champin@liris.cnrs.fr>
- Date: Sun, 27 Jul 2014 15:42:13 +0200
- To: John Arwe <johnarwe@us.ibm.com>
- Cc: "public-ldp-wg@w3.org Group" <public-ldp-wg@w3.org>
- Message-ID: <CA+OuRR_invNg-ama3B3Cu8YaTi-O4N9d=Apa0HL5tXfNx41a-g@mail.gmail.com>
Hi John, first of all, thank you for your remarks. Just to add to Alexandre's reply On Tue, Jul 15, 2014 at 6:51 PM, John Arwe <johnarwe@us.ibm.com <javascript:_e(%7B%7D,'cvml','johnarwe@us.ibm.com');>> wrote: > 7: 2.6 suggests (by omission) that it is impossible to delete a list, > although (in later sections) it's possible to empty a list. The asymmetry > of being able to add a list, but not delete it again later, seems vaguely > suspect although I have no concrete use cases requiring it. At some level > I think about it as: can I undo whatever havoc I cause? ...and the answer > here appears to be 'no'. > > It **is** possible to delete a list, although you are right, there is a slight asymetry here. Indeed, you can add a list with a single statement : Add :s :p ( :john :paul :george :ringo ) . while to remove it completely, you need two statements UpdateList :s :p 0> () . Delete :s :p rdf:nil . I'm guessing you would have expected to be able to write Delete :s :p ( :john :paul :george :ringo ) . and this is not allowed by the LD-Patch syntax in its current state. The rationale for this decisions is that "( :john :paul :george :ringo )" (whether it appears in an Add or UpdateList statement) is syntactic sugar for a bunch or interlinked **fresh** blank nodes, that are to be added to the graph. In a Delete statement as the one suggested above, the blank nodes hidden in the list expression would have a quite different semantics: they would be variables that would need to be matched against the **actual** blank nodes in the graph. Now, I'm not saying that I would refuse to extend LD-Patch in that way. I'm merely explaining why we prevented it in the first place. But I must say that I find it relatively easy to understand, and quite elegant. Furthermore, it would be a safer way to delete a list, as the two-statements method that I gave above would remove the list regardless of its values, while the one-statement "delete with a list as its object" would only delete that particular list, or fail if the list contains different values. best
Received on Sunday, 27 July 2014 13:42:41 UTC