[tracker/wip/carlosg/sparql1.1: 160/201] tests: Use explicit graph in DELETE {}



commit 00a4e783da8eb7c30a3779fb104c76c469022a00
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Jul 14 19:46:03 2019 +0200

    tests: Use explicit graph in DELETE {}
    
    Delete with no specified graph "deletes from the default graph", and
    we use a merge graph of default and named graphs as the default graph.
    Even though this is observed as valid by sparql1.1 update reference,
    the semantics are somewhat underspecified. Just make the test explicit
    at what it means.

 tests/functional-tests/08-unique-insertions.py | 5 ++---
 tests/libtracker-data/graph/data-2.rq          | 4 +++-
 2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/tests/functional-tests/08-unique-insertions.py b/tests/functional-tests/08-unique-insertions.py
index 9c9578a5c..25ea6a13f 100755
--- a/tests/functional-tests/08-unique-insertions.py
+++ b/tests/functional-tests/08-unique-insertions.py
@@ -43,7 +43,6 @@ class TestMinerInsertBehaviour (CommonTrackerStoreTest):
         resource = 'graph://test/resource/1'
 
         insert_sparql = """
-        DELETE { ?r a rdfs:Resource } WHERE { GRAPH <graph://test/resource/1> { ?r a rdfs:Resource } }
         INSERT INTO <graph://test/resource/1> {
            _:resource a nie:DataObject ;
                       nie:url "%s" .
@@ -55,7 +54,7 @@ class TestMinerInsertBehaviour (CommonTrackerStoreTest):
         """ % resource
 
         delete_sparql = """
-        DELETE { ?r a rdfs:Resource } WHERE { GRAPH <graph://test/resource/1> { ?r a rdfs:Resource } }
+        DELETE { GRAPH <graph://test/resource/1> { ?r a rdfs:Resource } } WHERE { GRAPH 
<graph://test/resource/1> { ?r a rdfs:Resource } }
         """
 
         ''' First insertion '''
@@ -65,7 +64,7 @@ class TestMinerInsertBehaviour (CommonTrackerStoreTest):
         self.assertEqual(len(results), 1)
 
         ''' Second insertion / update '''
-        self.tracker.update(insert_sparql)
+        self.tracker.update(delete_sparql + ' ' + insert_sparql)
 
         results = self.tracker.query(select_sparql)
         self.assertEqual(len(results), 1)
diff --git a/tests/libtracker-data/graph/data-2.rq b/tests/libtracker-data/graph/data-2.rq
index bfe6489c6..1a8333244 100644
--- a/tests/libtracker-data/graph/data-2.rq
+++ b/tests/libtracker-data/graph/data-2.rq
@@ -5,7 +5,9 @@ INSERT {
        }
 }
 DELETE {
-       example:resource example:p 42
+       GRAPH example:graphA {
+               example:resource example:p 42
+       }
 }
 INSERT {
        GRAPH example:graphB {


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