|
@@ -243,36 +243,6 @@ Graph_copy_contents (GraphObject *self, GraphObject *dest)
|
|
|
};
|
|
|
|
|
|
|
|
|
-#if 0
|
|
|
-static PyObject *
|
|
|
-Graph_store (PyObject *self)
|
|
|
-{
|
|
|
- GraphObject *dest_obj = (GraphObject *) Py_TYPE (self)->tp_alloc(
|
|
|
- Py_TYPE (self), 0);
|
|
|
- if (!dest_obj) return PyErr_NoMemory();
|
|
|
-
|
|
|
- // TODO Make store ID, nsm and initial size accessible.
|
|
|
- LSUP_Graph *dest = LSUP_graph_new (
|
|
|
- uri, LSUP_STORE_HTABLE, NULL, NULL, 0);
|
|
|
- if (!dest) {
|
|
|
- PyErr_SetString (PyExc_ValueError, "Could not create graph.");
|
|
|
- return -1;
|
|
|
- }
|
|
|
-
|
|
|
- LSUP_rc rc = LSUP_GraphStore (
|
|
|
- ((GraphObject *) self)->ob_struct, &((dest_obj)->ob_struct), NULL);
|
|
|
- if (rc != LSUP_OK) {
|
|
|
- log_error (LSUP_strerror (rc));
|
|
|
- PyErr_SetString (PyExc_SystemError, "Error storing graph.");
|
|
|
- return NULL;
|
|
|
- };
|
|
|
-
|
|
|
- Py_INCREF (dest_obj);
|
|
|
- return (PyObject *)dest_obj;
|
|
|
-}
|
|
|
-#endif
|
|
|
-
|
|
|
-
|
|
|
static PyObject *
|
|
|
Graph_new_from_rdf (PyTypeObject *cls, PyObject *args)
|
|
|
{
|
|
@@ -365,40 +335,6 @@ inline static int build_trp_pattern (PyObject *args, LSUP_Term *spo[])
|
|
|
}
|
|
|
|
|
|
|
|
|
-/*
|
|
|
-static PyObject *
|
|
|
-Graph_new_set_from_store_lookup (PyTypeObject *cls, PyObject *args)
|
|
|
-{
|
|
|
- LSUP_Term *spo[3];
|
|
|
-
|
|
|
- if (UNLIKELY ((build_trp_pattern (args, spo)) < 0)) return NULL;
|
|
|
-
|
|
|
- LSUP_Graph **gr_a = LSUP_graph_new_lookup (spo[0], spo[1], spo[2]);
|
|
|
- if (UNLIKELY (!gr_a)) {
|
|
|
- // TODO implement LSUP_strerror for more details.
|
|
|
- PyErr_SetString (PyExc_SystemError, "Error looking up triples.");
|
|
|
- return NULL;
|
|
|
- }
|
|
|
-
|
|
|
- PyObject *ret = PySet_New (NULL);
|
|
|
-
|
|
|
- size_t i;
|
|
|
- for (i = 0; gr_a[i] != NULL; i++) {
|
|
|
- PyObject *gr_obj = cls->tp_alloc(cls, 0);
|
|
|
- if (!gr_obj) return NULL;
|
|
|
- ((GraphObject *) gr_obj)->ob_struct = gr_a[i];
|
|
|
-
|
|
|
- Py_INCREF (gr_obj);
|
|
|
- PySet_Add (ret, gr_obj);
|
|
|
- }
|
|
|
- log_debug ("Found %lu graphs for pattern.", i + 1);
|
|
|
-
|
|
|
- Py_INCREF (ret);
|
|
|
- return ret;
|
|
|
-}
|
|
|
-*/
|
|
|
-
|
|
|
-
|
|
|
static PyObject *
|
|
|
Graph_richcmp (PyObject *self, PyObject *other, int op)
|
|
|
{
|
|
@@ -593,19 +529,6 @@ static PyMethodDef Graph_methods[] = {
|
|
|
METH_CLASS | METH_VARARGS,
|
|
|
"Create a graph from a RDF file."
|
|
|
},
|
|
|
- /*
|
|
|
- {
|
|
|
- "from_lookup", (PyCFunction) Graph_new_set_from_store_lookup,
|
|
|
- METH_CLASS | METH_VARARGS,
|
|
|
- "Create a set of graphs from a store SPO lookup."
|
|
|
- },
|
|
|
- */
|
|
|
- /*
|
|
|
- {
|
|
|
- "store", (PyCFunction) Graph_store, METH_NOARGS,
|
|
|
- "Store a graph into the permanent back end."
|
|
|
- },
|
|
|
- */
|
|
|
{"add", (PyCFunction) Graph_add, METH_O, "Add triples to a graph."},
|
|
|
{
|
|
|
"remove", (PyCFunction) Graph_remove, METH_VARARGS,
|