|
@@ -155,7 +155,7 @@ Graph_init (GraphObject *self, PyObject *args, PyObject *kwargs)
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
|
|
- } else uri = LSUP_iriref_new (NULL, NULL);
|
|
|
|
|
|
+ }
|
|
|
|
|
|
// Set up the store if a function for that is defined.
|
|
// Set up the store if a function for that is defined.
|
|
const LSUP_StoreInt *sif = LSUP_store_int (store_type);
|
|
const LSUP_StoreInt *sif = LSUP_store_int (store_type);
|
|
@@ -165,6 +165,9 @@ Graph_init (GraphObject *self, PyObject *args, PyObject *kwargs)
|
|
"No interface defined for given store type.");
|
|
"No interface defined for given store type.");
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // TODO Move store creation fn and handle into a separate module.
|
|
|
|
+ LSUP_store *store = LSUP_store_new (store_type, NULL, 0);
|
|
if (sif->setup_fn) {
|
|
if (sif->setup_fn) {
|
|
if (sif->setup_fn(NULL, false) < LSUP_OK) {
|
|
if (sif->setup_fn(NULL, false) < LSUP_OK) {
|
|
PyErr_SetString (
|
|
PyErr_SetString (
|
|
@@ -174,14 +177,12 @@ Graph_init (GraphObject *self, PyObject *args, PyObject *kwargs)
|
|
}
|
|
}
|
|
|
|
|
|
// TODO Make store ID, nsm and initial size accessible.
|
|
// TODO Make store ID, nsm and initial size accessible.
|
|
- self->ob_struct = LSUP_graph_new (
|
|
|
|
- uri, (LSUP_StoreType) store_type, NULL, NULL, 0);
|
|
|
|
|
|
+ self->ob_struct = LSUP_graph_new (store, uri, NULL);
|
|
if (!self->ob_struct) {
|
|
if (!self->ob_struct) {
|
|
PyErr_SetString (PyExc_ValueError, "Could not create graph.");
|
|
PyErr_SetString (PyExc_ValueError, "Could not create graph.");
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
- LSUP_Term *uri2 = LSUP_graph_uri (self->ob_struct);
|
|
|
|
- log_debug("Graph URI (%p): %s", uri2, uri2->data);
|
|
|
|
|
|
+ if (uri) LSUP_term_free (uri);
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -359,8 +360,7 @@ Graph_bool_op (
|
|
GraphObject *res = (GraphObject *) cls->tp_alloc (cls, 0);
|
|
GraphObject *res = (GraphObject *) cls->tp_alloc (cls, 0);
|
|
if (!res) return NULL;
|
|
if (!res) return NULL;
|
|
|
|
|
|
- LSUP_Graph *dest = LSUP_graph_new (
|
|
|
|
- NULL, LSUP_STORE_HTABLE, NULL, NULL, 0);
|
|
|
|
|
|
+ LSUP_Graph *dest = LSUP_graph_new (NULL, NULL, NULL);
|
|
if (!dest) {
|
|
if (!dest) {
|
|
PyErr_SetString (PyExc_Exception, "Could not create destination graph.");
|
|
PyErr_SetString (PyExc_Exception, "Could not create destination graph.");
|
|
return NULL;
|
|
return NULL;
|