Graph Updating
Whenever a graph source is processed (i.e. essentially when saving an item or a part), the graph (=nodes + triples) generated by all the mappings matching that source get collected into a graph set.
So, at the end of this collection process, we have regenerated the whole partial set of nodes and triples from the specified source. This set now requires to be synchronized with the existing graph stored in the database.
To this end, a special component (CrudGrouper
) has the task of comparing the partial graph generated by mapping with the full graph stored in the database. This comparison results in a list of nodes and triples to be either added, updated, or removed, so that the database effectively gets updated.
For this synchronization procedure, the graph repository provides a couple of key methods:
UpdateGraph
, which does the comparison and executes all the operations required to synch the sets, in the correct order. This is typically used in consequence of a save operation, and corresponds to an add/update operation.DeleteGraphSet
, which deletes from the database graph all the nodes and triples whose source ID (SID) matches a specified prefix, which is shared among all the nodes and triples generated from a specific source. This is typically used in consequence of a delete operation.