I've currently skimming through the Python-bindings for Redland and haven't found a clean way to do transactions on the storage engine via it. I found some model-transactions within the low-level Redland module:
import RDF, Redland
storage = RDF.Storage(...)
model = RDF.Model(storage)
Redland.librdf_model_transaction_start(model._model)
try:
# Do something
Redland.librdf_model_transaction_commit(model._model)
model.sync()
except:
Redland.librdf_model_transaction_rollback(model._model)
Do these also translate down to the storage layer?
Thanks :-)
Yes, this should work. There are no convenience functions for the model class in the python wrapper right now but they would be similar to what you wrote:
class Model(object):
...
def transaction_start(self):
return Redland.librdf_model_transaction_start(self._model)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With