Просмотр исходного кода

Add context to triple add log; small docstring fixes.

scossu 1 неделя назад
Родитель
Сommit
7d192ab00b
4 измененных файлов с 11 добавлено и 9 удалено
  1. 3 1
      include/codec.h
  2. 4 5
      include/store_interface.h
  3. 3 2
      src/graph.c
  4. 1 1
      src/namespace.c

+ 3 - 1
include/codec.h

@@ -128,7 +128,7 @@ typedef LSUP_rc (*term_decode_fn_t)(
         const char *rep, const LSUP_NSMap *nsm, LSUP_Term **term);
 
 
-/** @brief Prototype for decoding a complete RDF document into a graph.
+/** @brief Prototype for decoding a complete RDF document file into a graph.
  *
  * Implementations SHOULD consume data from the file handle in chunks.
  *
@@ -136,6 +136,8 @@ typedef LSUP_rc (*term_decode_fn_t)(
  * MUST NOT close the file handle.
  *
  * @param[out] gr Pointer to a graph handle to be generated from decoding.
+ * The handle need not be initialized. The graph URI will be randomly assigned
+ * and can be changed at a later time.
  *
  * @param[out] ct If not NULL, it may be populated with the number of triples
  *  parsed (which may be different from the resulting graph size).

+ 4 - 5
include/store_interface.h

@@ -41,11 +41,10 @@
  * Store feature flags.
  *
  * NOTE: LSUP_STORE_PERM need only be set by an implementation based on whether
- * its path is on a default temporary dir (e.g. LSUP_MDB_RAMDISK_PATH). If this
- * flag is not set, it means the data will be cleared before the next execution
- * of the program. However, its being set does not guarantee the persistence of
- * the medium (i.e. a "permanent" store may have been created ad hoc on a
- * tempfs).
+ * the data may be cleared before the perogram ends.  It is the client's
+ * responsibility to guarantee permanence beyond the lifespan of the program. A
+ * store featuring LSUP_STORE_PERM MUST guarantee that the data remain
+ * available on storage for the user to further handle them.
  */
 typedef enum {
     LSUP_STORE_PERM     = 1<<0,   ///< Store is on a permanent support.

+ 3 - 2
src/graph.c

@@ -292,8 +292,9 @@ LSUP_rc
 LSUP_graph_add_iter (LSUP_GraphIterator *it, const LSUP_Triple *spo)
 {
     log_trace (
-            "Adding triple: {%s, %s, %s}",
-            spo->s->data, spo->p->data, spo->o->data);
+            "Adding triple {%s, %s, %s} to %s",
+            spo->s->data, spo->p->data, spo->o->data,
+            LSUP_graph_uri(it->graph)->data);
     LSUP_BufferTriple *sspo = LSUP_triple_serialize (spo);
     if (UNLIKELY (!sspo)) return LSUP_MEM_ERR;
     const LSUP_StoreInt *sif = it->graph->store->sif;

+ 1 - 1
src/namespace.c

@@ -90,7 +90,7 @@ LSUP_nsmap_add (NSMap *map, const char *pfx, const char *nsstr)
         log_debug ("Added prefix '%s' to NS map.", entry_s.pfx);
     } else {
         log_debug (
-                "Replacing NS '%s' with '%s' for preix '%s'.",
+                "Replacing NS '%s' with '%s' for prefix '%s'.",
                 ret->ns, ns, entry_s.pfx);
         free (ret->ns);
         ret->ns = ns;