[tracker/wip/carlosg/anonymous-nodes: 45/46] libtracker-sparql: Add enum value for anonymous bnodes




commit 807509500e9c0d393ba6d063de8fb9c1034c3164
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Aug 12 15:28:57 2021 +0200

    libtracker-sparql: Add enum value for anonymous bnodes
    
    This is a default behavior of SPARQL that we deviate from. Add a
    new TrackerSparqlConnectionFlags value that will be used to honor this.
    
    Fixes: https://gitlab.gnome.org/GNOME/tracker/-/issues/148

 src/libtracker-sparql/direct/tracker-direct.c | 2 ++
 src/libtracker-sparql/tracker-connection.h    | 3 +++
 2 files changed, 5 insertions(+)
---
diff --git a/src/libtracker-sparql/direct/tracker-direct.c b/src/libtracker-sparql/direct/tracker-direct.c
index cf9f1167a..a4a69d44c 100644
--- a/src/libtracker-sparql/direct/tracker-direct.c
+++ b/src/libtracker-sparql/direct/tracker-direct.c
@@ -332,6 +332,8 @@ translate_flags (TrackerSparqlConnectionFlags flags)
                db_flags |= TRACKER_DB_MANAGER_FTS_ENABLE_STOP_WORDS;
        if ((flags & TRACKER_SPARQL_CONNECTION_FLAGS_FTS_IGNORE_NUMBERS) != 0)
                db_flags |= TRACKER_DB_MANAGER_FTS_IGNORE_NUMBERS;
+       if ((flags & TRACKER_SPARQL_CONNECTION_FLAGS_ANONYMOUS_BNODES) != 0)
+               db_flags |= TRACKER_DB_MANAGER_ANONYMOUS_BNODES;
 
        return db_flags;
 }
diff --git a/src/libtracker-sparql/tracker-connection.h b/src/libtracker-sparql/tracker-connection.h
index 00840cd16..b8ea4715a 100644
--- a/src/libtracker-sparql/tracker-connection.h
+++ b/src/libtracker-sparql/tracker-connection.h
@@ -39,6 +39,8 @@ G_BEGIN_DECLS
  * @TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_UNACCENT: Unaccenting is applied to FTS search terms.
  * @TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_STOP_WORDS: FTS Search terms are filtered through a stop word 
list.
  * @TRACKER_SPARQL_CONNECTION_FLAGS_FTS_IGNORE_NUMBERS: Ignore numbers in FTS search terms.
+ * @TRACKER_SPARQL_CONNECTION_FLAGS_ANONYMOUS_BNODES: Treat blank nodes as specified in
+ *   SPARQL 1.1 syntax. Namely, they cannot be used as URIs. This flag is available since Tracker 3.3.
  *
  * Connection flags to modify #TrackerSparqlConnection behavior.
  */
@@ -49,6 +51,7 @@ typedef enum {
        TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_UNACCENT   = 1 << 2,
        TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_STOP_WORDS = 1 << 3,
        TRACKER_SPARQL_CONNECTION_FLAGS_FTS_IGNORE_NUMBERS    = 1 << 4,
+       TRACKER_SPARQL_CONNECTION_FLAGS_ANONYMOUS_BNODES      = 1 << 5,
 } TrackerSparqlConnectionFlags;
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]