# HG changeset patch # User drewp@bigasterisk.com # Date 1559271068 0 # Node ID bd0e24f6254aecd09cc5fe1c417314fcfa619afd # Parent 9b46968b8881d8aa311509412f750255c1592421 doc update on SyncedGraph Ignore-this: cec485f067fbde38bd99766e1c57eb68 diff -r 9b46968b8881 -r bd0e24f6254a rdfdb/syncedgraph.py --- a/rdfdb/syncedgraph.py Thu May 30 08:38:13 2019 +0000 +++ b/rdfdb/syncedgraph.py Fri May 31 02:51:08 2019 +0000 @@ -42,10 +42,16 @@ class SyncedGraph(CurrentStateGraphApi, AutoDepGraphApi, GraphEditApi): """ graph for clients to use. Changes are synced with the master graph - in the rdfdb process. + in the rdfdb process. + + self.patch(p: Patch) is the only way to write to the graph. - This api is like rdflib.Graph but it can also call you back when - there are graph changes to the parts you previously read. + Reading can be done with the AutoDepGraphApi methods which set up + watchers to call you back when the results of the read have + changed (like knockoutjs). Or you can read with + CurrentStateGraphApi which doesn't have watchers, but you have to + opt into using it so it's clear you aren't in an auto-dep context + and meant to set up watchers. You may want to attach to self.initiallySynced deferred so you don't attempt patches before we've heard the initial contents of @@ -54,8 +60,7 @@ statements unless we have the correct graph. If we get out of sync, we abandon our local graph (even any - pending local changes) and get the data again from the - server. + pending local changes) and get the data again from the server. """ def __init__(self,