On 24/11/17 15:02, Osma Suominen wrote:
Dan Davis kirjoitti 24.11.2017 klo 16:53:
Rdflib has a graph_diff method that returns common, triples, only in left, only in right.   It is in IsonorpgicGraph class, so it should handle blank
nodes.

Good luck running that on something like Wikidata though. It's far too big to fit in memory.

I'd use N-Triple files (old and new) sorted using the unix command sort, then use diff to determine added and removed triples, and finally turn those into INSERT DATA and DELETE DATA update operations. Assuming there are no blank nodes.

-Osma

(speaking as the author of the current rdflib in-memory store, IOMemory)


This is where RDF patch comes in:

https://afs.github.io/rdf-delta/rdf-patch.html

send the adds and removes.

If it is just additions, you can POST the new RDF to datasets and it gets added.

If the deletes than need something else.

Either SPARQL Update, or RDF Patch.

Reloading the whole thing (offline) may be slow but it is reliable. Load it (batch job) then swap the datasets over (brief outage or get clever with a load balancer).

    Andy

Reply via email to