I am managing a named graph (multiple resources per named graph pattern) and needs to update the named graph for any changes for versioning graphs.
To start with, I have a current version of the named graph.
problem statement: whenever I receive a delta turtle file (ttl will have only the changed triples), a new version named graph with delta change incorporated (current version + delta) has to be created. named graph versions diagram
**V1 named graph**
prefix ex: http://example.org/def/
prefix id: http://example.org/id/
prefix graph: <http://example.org/graph/>
id:a ex:hasLabel "a" graph:v1 .
id:b ex:hasLabel "b" graph:v1.
id:b ex:hasChild id:d graph:v1.
id:c ex:hasLabel "c" graph:v1
id:c ex:hasChild id:d graph:v1 .
id:d ex:hasLabel "d" graph:v1.
**DELTA file**
id:b ex:hasLabel "B".
id:c ex:hasChild id:e .
id:e ex:hasLabel "e" .
**Expected V2 Named graph with the delta change incorporated**
id:a ex:hasLabel "a" graph:v2.
id:b ex:hasLabel "B" graph:v2.
id:b ex:hasChild id:d graph:v2.
id:c ex:hasLabel "c" graph:v2.
id:c ex:hasChild id:d graph:v2.
id:d ex:hasLabel "d" graph:v2.
id:c ex:hasChild id:e graph:v2.
id:e ex:hasLabel "e" graph:v2.
I POSTed named graph v1 to a new named graph V2. Tried HTTP PUT and PATCH to update, but it is just replacing it with the delta file (I need to keep unchanged nodes in new named graph).
Is it possible to do it using HTTP PATCH as I read in SPARQL 1.1 Graph Store HTTP Protocol :
With PATCH, however, the enclosed entity contains a set of instructions describing how the RDF graph content residing on the origin server should be modified to produce a new version.
Appreciate if anyone can give me some pointers or ideas to reach the solution. Thanks.