[tracker/wip/carlosg/sparql-fixes: 2/6] tests: Add test for service in subselect




commit 6b2a57d8446c9f6e3ac7f56c656ccfec65e10ca7
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Aug 27 09:33:15 2020 +0200

    tests: Add test for service in subselect
    
    The variables referenced before the subselect were deemed as join worthy
    with the service graph pattern. Add a test for this.

 .../service/service-union-with-local-2.out         |  2 ++
 .../service/service-union-with-local-2.rq          | 22 ++++++++++++++++++++++
 tests/libtracker-data/tracker-service-test.c       |  1 +
 3 files changed, 25 insertions(+)
---
diff --git a/tests/libtracker-data/service/service-union-with-local-2.out 
b/tests/libtracker-data/service/service-union-with-local-2.out
new file mode 100644
index 000000000..6eed860fd
--- /dev/null
+++ b/tests/libtracker-data/service/service-union-with-local-2.out
@@ -0,0 +1,2 @@
+"http://purl.org/dc/elements/1.1/";     "a"
+"http://tracker.api.gnome.org/ontology/v3/nao#hasTag";  "b"
diff --git a/tests/libtracker-data/service/service-union-with-local-2.rq 
b/tests/libtracker-data/service/service-union-with-local-2.rq
new file mode 100644
index 000000000..0566ec42e
--- /dev/null
+++ b/tests/libtracker-data/service/service-union-with-local-2.rq
@@ -0,0 +1,22 @@
+SELECT ?u ?s {
+  {
+    SELECT ?u ('a' AS ?s) {
+      ?u a rdfs:Resource
+    }
+    ORDER BY STR(?u)
+    LIMIT 1
+  }
+  UNION
+  {
+    SELECT ?u ?s {
+      ?u a rdfs:Resource .
+      SERVICE <dbus:%s> {
+        SELECT ?u ('b' AS ?s) {
+          ?u nrl:indexed true
+        }
+        ORDER BY STR(?u)
+        LIMIT 1
+      }
+    }
+  }
+}
diff --git a/tests/libtracker-data/tracker-service-test.c b/tests/libtracker-data/tracker-service-test.c
index 788c6c1ef..5dfeb63f5 100644
--- a/tests/libtracker-data/tracker-service-test.c
+++ b/tests/libtracker-data/tracker-service-test.c
@@ -40,6 +40,7 @@ const TestInfo tests[] = {
        { "service/service-before-triples-1", FALSE },
        { "service/service-local-filter-1", FALSE },
        { "service/service-union-with-local-1", FALSE },
+       { "service/service-union-with-local-2", FALSE },
 };
 
 static GDBusConnection *dbus_conn = NULL;


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