assemblee-virtuelle / semapps

A toolbox to create semantic web applications
https://semapps.org
Apache License 2.0
88 stars 9 forks source link

Refactor LDP PATCH #1292

Closed srosset81 closed 3 months ago

srosset81 commented 3 months ago

Handle SPARQL Update parsing on the API level, so that this operation is executed in a single place (instead of doing it on the ldp.resource.patch, ldp.container.patch and activitypub.collections.patch actions.

This also allows to more easily use hooks on these actions, since we can access the triplesToAdd and triplesToRemove params, and even modify them in the case of before hooks.

Also invert the SPARQL Update operation by calling the DELETE DATA before the INSERT DATA. In case one triple to add is the same as a triple to remove, the newly added triple will not be deleted.

:warning: Breaking changes

If you used before or after hooks with the ldp.resource.patch, ldp.container.patch or activitypub.collections.patch actions, you will probably need to rewrite them.