On 16/05/2019 18:48, Chris Tomlinson wrote:
Hello,
As part of our editing service development, using at least aspects of RDFPatch,
we have a use-case that goes like this:
User U_A does some work on a number of resources resulting in patch P_01 and
then stashes the patch on the editing service and requests user U_B to finish
the work item represented by P_01
User U_B retrieves P_01 and begins a new patch P_02 that continues on from P_01
and then
User U_B requests the editing service to apply P_01 followed by P_02.
This seems like a case where RDF Patch Log
<https://afs.github.io/rdf-delta/rdf-patch-logs.html> would be appropriate, but
it isn’t clear from the docs or code exactly how one manages a Log of patches to be
applied in sequence and then requests the sequence to be applied. I looked about for
a PatchLog class but didn’t see such.
How would this kind of scenario be handled?
The id/prev headers provide a way to define a log (a linear sequence of
patches with a head and tail).
There are many ways to use patches
The patch module on its own does not provide this - that is what modle
rdf-delta-client does for the case of an HA dataset.
DeltaConnection with a SyncPolicy of NONE (not automatic) and call
DeltaConnection internally a DataState - it tracks the state/version of
the dataset so sync() gets and applies the right patches in order.
Your case seems a little different so it may not apply out-of-the-box -
there is a workflow between the two users that is managing the patch flow.
The DeltaClient class can also help - it is more focuses on managing and
interrogating the state of the state of the patch log.
So one way may be to run a patch log server and add your workflow
specifics to pull and apply patches.
Andy
Thanks very much,
Chris