File tree Expand file tree Collapse file tree 1 file changed +37
-1
lines changed Expand file tree Collapse file tree 1 file changed +37
-1
lines changed Original file line number Diff line number Diff line change 1
- from rdflib import RDF , Graph
1
+ from rdflib import RDF , Graph , Namespace
2
+
3
+ EX = Namespace ("http://example.org/" )
4
+
5
+
6
+ def test_items ():
7
+ g = Graph ().parse (
8
+ data = """
9
+ @prefix : <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
10
+
11
+ <> :value (
12
+ <http://example.org/thing1>
13
+ <http://example.org/thing2>
14
+ ).
15
+
16
+ <> :value (
17
+ <http://example.org/thing3>
18
+ ).
19
+
20
+ <> :value ().
21
+
22
+ <> :value (
23
+ <http://example.org/thing4>
24
+ <http://example.org/thing5>
25
+ <http://example.org/thing6>
26
+ ).
27
+ """ ,
28
+ format = "turtle" ,
29
+ )
30
+
31
+ values = {tuple (g .items (v )) for v in g .objects (None , RDF .value )}
32
+ assert values == {
33
+ (EX .thing1 , EX .thing2 ),
34
+ (EX .thing3 ,),
35
+ (),
36
+ (EX .thing4 , EX .thing5 , EX .thing6 ),
37
+ }
2
38
3
39
4
40
def test_recursive_list_detection ():
You can’t perform that action at this time.
0 commit comments