[tracker/wip/carlosg/sparql1.1: 129/145] tests: Use explicit graph in DELETE {}
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/sparql1.1: 129/145] tests: Use explicit graph in DELETE {}
- Date: Thu, 18 Jul 2019 22:34:53 +0000 (UTC)
commit d8c621308ffcffebd5ec062c9d5d7d98028f21d2
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 23650231f..74d01f9e1 100755
--- a/tests/functional-tests/08-unique-insertions.py
+++ b/tests/functional-tests/08-unique-insertions.py
@@ -42,7 +42,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" .
@@ -54,7 +53,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 '''
@@ -64,7 +63,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]