from rdflib import Graph


class GraphStore(Graph):
    def __init__(self, connect_args, create_func=None, *args, **kwargs):
        super(GraphStore, self).__init__(*args, **kwargs)
        self.connect_args = connect_args
        self.create_func = create_func

    def connect(self):
        if isinstance(self.connect_args, list):
            self.open(*self.connect_args)
        elif isinstance(self.connect_args, dict):
            self.open(**self.connect_args)
        else:
            raise TypeError("connect_args must be either a list or a dict.")

    def create(self):
        if self.create_func:
            self.create_func()

@@ -99,16 +99,32 @@
 nc=None,
+ create_args=%5B%5D,
  *args, 
@@ -276,121 +276,70 @@
 unc%0A
-%0A
     
-def connect(self):%0A        if isinstance(self.connect_args, list):%0A            self.open(*self.connect_args)
+    self.create_args = create_args%0A%0A    def connect(self):
 %0A   
@@ -343,18 +343,16 @@
         
-el
 if isins
@@ -494,25 +494,8 @@
  be 
-either a list or 
 a di
@@ -581,10 +581,237 @@
 te_func(
+*self.create_args)  # TODO gerer exception si db existe deja%0A%0A    def destroy(self):%0A        %22%22%22For SQL: destroy tables of the DB, not the DB itself.%22%22%22%0A        super(GraphStore, self).destroy(self.connect_args%5B'configuration'%5D
 )%0A

Add destroy() to GraphStore