-
Notifications
You must be signed in to change notification settings - Fork 571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Think about __iadd__, __isub__ etc. for ConjunctiveGraph #225
Comments
The doc for ConjunctiveGraph says:
"all methods work against this default graph" - sounds good, but isn't quite true. len will give you the length of the conjunction of all graphs addN/quads work on quads directly In fact, the only method to make use of the default_context was add So add works on a single graph only, remove does not. So: conjgraph+=g1
conjgraph-=g1 may not be what you want (since isub will be delegated to remove which removes from ALL graphs) I am not really sure what makes the most sense here. Adding iadd/isub that works for quads seems sensible, but breaks backwards compatability in a fairly subtle way. I would postpone until rdflib 4 I also do not like that len gives you the number of TRIPLES not of quads, but that is another issue. |
discussed in #307 Summary of changes: * added methods ```add_graph``` and ```remove_graph``` to the Store API, implemented these for Sleepycat and IOMemory. A flag, ```graph_awareness``` is set on the store if they methods are supported, default implementations will raise an exception. * made the dataset require a store with the ```graph_awareness``` flag set. * removed the graph-state kept in the ```Dataset``` class directly. * removed ```dataset.add_quads```, ```remove_quads``` methods. The ```add/remove``` methods of ```ConjunctiveGraph``` are smart enough to work with triples or quads. * removed the ```dataset.graphs``` method - it now does exactly the same as ```contexts``` * cleaned up a bit more confusion of whether Graph instance or the Graph identifiers are passed to store methods. (#225)
discussed in #307 Summary of changes: * added methods ```add_graph``` and ```remove_graph``` to the Store API, implemented these for Sleepycat and IOMemory. A flag, ```graph_awareness``` is set on the store if they methods are supported, default implementations will raise an exception. * made the dataset require a store with the ```graph_awareness``` flag set. * removed the graph-state kept in the ```Dataset``` class directly. * removed ```dataset.add_quads```, ```remove_quads``` methods. The ```add/remove``` methods of ```ConjunctiveGraph``` are smart enough to work with triples or quads. * removed the ```dataset.graphs``` method - it now does exactly the same as ```contexts``` * cleaned up a bit more confusion of whether Graph instance or the Graph identifiers are passed to store methods. (#225)
Currently all operations are done on the default graph, i.e. if you add another graph, even if it's a conjunctive graph, all triples are added to the default graph.
It may make sense to check if the other thing added is ALSO a conjunctive graph and merge the contexts:
The text was updated successfully, but these errors were encountered: