|
@@ -622,6 +622,31 @@ LSUP_graph_contains (const LSUP_Graph *gr, const LSUP_Triple *spo)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+void
|
|
|
|
+LSUP_graph_print (LSUP_Graph *gr)
|
|
|
|
+{
|
|
|
|
+ size_t ct;
|
|
|
|
+ LSUP_GraphIterator *it = LSUP_graph_lookup (gr, NULL, NULL, NULL, &ct);
|
|
|
|
+ if (UNLIKELY (!it)) log_error ("Could not print graph contents.");
|
|
|
|
+
|
|
|
|
+ printf ("*** Graph %s (%zu triples):\n\n", gr->uri->data, ct);
|
|
|
|
+
|
|
|
|
+ LSUP_Triple *spo = NULL;
|
|
|
|
+ ct = 0;
|
|
|
|
+ LSUP_rc rc = LSUP_NORESULT;
|
|
|
|
+ while (rc = LSUP_graph_iter_next (it, &spo) == LSUP_OK) {
|
|
|
|
+ printf (
|
|
|
|
+ "#%-6zu {%s %s %s}\n",
|
|
|
|
+ ct, spo->s->data, spo->p->data, spo->o->data);
|
|
|
|
+ ct++;
|
|
|
|
+ }
|
|
|
|
+ if (rc != LSUP_END)
|
|
|
|
+ log_error (
|
|
|
|
+ "Output truncated due to abnormal return: %s",
|
|
|
|
+ LSUP_strerror (rc));
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
LSUP_LinkMap *
|
|
LSUP_LinkMap *
|
|
LSUP_graph_connections (
|
|
LSUP_graph_connections (
|
|
const LSUP_Graph *gr, LSUP_Term *t, LSUP_LinkType type)
|
|
const LSUP_Graph *gr, LSUP_Term *t, LSUP_LinkType type)
|