[tracker/wip/carlosg/serialize-api: 30/53] libtracker-data: Convert blank nodes in DESCRIBE queries




commit f8da3482f8c581537d63c956473ac079d75368f0
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Dec 13 01:49:42 2021 +0100

    libtracker-data: Convert blank nodes in DESCRIBE queries
    
    This was missed in the conversion to anonymous blank nodes. The
    blank node label should be returned as the subject in these queries.

 src/libtracker-data/tracker-sparql.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libtracker-data/tracker-sparql.c b/src/libtracker-data/tracker-sparql.c
index 0761a4773..756ca07bf 100644
--- a/src/libtracker-data/tracker-sparql.c
+++ b/src/libtracker-data/tracker-sparql.c
@@ -3367,7 +3367,7 @@ translate_DescribeQuery (TrackerSparql  *sparql,
        _expect (sparql, RULE_TYPE_LITERAL, LITERAL_DESCRIBE);
        _append_string (sparql,
                        "SELECT "
-                       "  (SELECT Uri FROM Resource WHERE ID = subject),"
+                       "  COALESCE((SELECT Uri FROM Resource WHERE ID = subject), 'urn:bnode:' || subject),"
                        "  (SELECT Uri FROM Resource WHERE ID = predicate),"
                        "  object "
                        "FROM tracker_triples ");


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