File tree Expand file tree Collapse file tree 2 files changed +69
-2
lines changed Expand file tree Collapse file tree 2 files changed +69
-2
lines changed Original file line number Diff line number Diff line change @@ -127,10 +127,12 @@ def evalJoin(ctx, join):
127
127
128
128
129
129
def evalUnion (ctx , union ):
130
+ branch1_branch2 = []
130
131
for x in evalPart (ctx , union .p1 ):
131
- yield x
132
+ branch1_branch2 . append ( x )
132
133
for x in evalPart (ctx , union .p2 ):
133
- yield x
134
+ branch1_branch2 .append (x )
135
+ return branch1_branch2
134
136
135
137
136
138
def evalMinus (ctx , minus ):
Original file line number Diff line number Diff line change
1
+ from rdflib import Graph
2
+ import unittest
3
+
4
+
5
+ class TestIssue910 (unittest .TestCase ):
6
+ def testA (self ):
7
+ g = Graph ()
8
+ q = g .query (
9
+ """
10
+ SELECT * {
11
+ { BIND ("a" AS ?a) }
12
+ UNION
13
+ { BIND ("a" AS ?a) }
14
+ }
15
+ """
16
+ )
17
+ self .assertEqual (len (q ) == 2 , True )
18
+
19
+ def testB (self ):
20
+ g = Graph ()
21
+ q = g .query (
22
+ """
23
+ SELECT * {
24
+ { BIND ("a" AS ?a) }
25
+ UNION
26
+ { VALUES ?a { "a" } }
27
+ UNION
28
+ { SELECT ("a" AS ?a) {} }
29
+ }
30
+ """
31
+ )
32
+ self .assertEqual (len (q ) == 3 , True )
33
+
34
+ def testC (self ):
35
+ g = Graph ()
36
+ q = g .query (
37
+ """
38
+ SELECT * {
39
+ { BIND ("a" AS ?a) }
40
+ UNION
41
+ { VALUES ?a { "a" } }
42
+ UNION
43
+ { SELECT ("b" AS ?a) {} }
44
+ }
45
+ """
46
+ )
47
+ self .assertEqual (len (q ) == 3 , True )
48
+
49
+ def testD (self ):
50
+ g = Graph ()
51
+ q = g .query (
52
+ """SELECT * {
53
+ { BIND ("a" AS ?a) }
54
+ UNION
55
+ { VALUES ?a { "b" } }
56
+ UNION
57
+ { SELECT ("c" AS ?a) {} }
58
+ }
59
+ """
60
+ )
61
+ self .assertEqual (len (q ) == 3 , True )
62
+
63
+
64
+ if __name__ == "__main__" :
65
+ unittest .main ()
You can’t perform that action at this time.
0 commit comments