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.
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
andactivitypub.collections.patch
actions.This also allows to more easily use hooks on these actions, since we can access the
triplesToAdd
andtriplesToRemove
params, and even modify them in the case of before hooks.Also invert the SPARQL Update operation by calling the
DELETE DATA
before theINSERT 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
oractivitypub.collections.patch
actions, you will probably need to rewrite them.