-
Notifications
You must be signed in to change notification settings - Fork 3
/
lists:SKIP.n3
82 lines (64 loc) · 1.29 KB
/
lists:SKIP.n3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
@prefix : <urn:example:> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
# Extra tests when rdf:first and rdf:rest are built-ins...
{
# This is true in cases where rdf:rest is a built-in on list-terms
(1 2 3) rdf:rest (2 3) . #
}
=>
{
:test1 a :Result .
} .
{
# If previous works, should then also this one ?
(1 2 3) rdf:rest [ rdf:first 2 ; rdf:rest [ rdf:first 3 ; rdf:rest rdf:nil ] ] .
}
=>
{
:test2 a :Result .
} .
{
# Then also this one should give a result ?
_:x0 rdf:first 2 ;
rdf:rest _:x1 .
_:x1 rdf:first 3 ;
rdf:rest rdf:nil .
(1 2 3) rdf:rest _:x0 .
}
=>
{
:test3 a :Result .
} .
{
# And also this one ?
(1 2 3) rdf:rest _:x0 .
_:x0 rdf:first 2 ;
rdf:rest _:x1 .
_:x1 rdf:first 3 ;
rdf:rest rdf:nil .
}
=>
{
:test4 a :Result .
} .
{
# And also this one ?
_:a0 rdf:first 1 ;
rdf:rest _:a1 .
_:a1 rdf:first 2 ;
rdf:rest _:a2 .
_:a2 rdf:first 3 ;
rdf:rest rdf:nil .
####################
_:a0 rdf:rest _:x0 .
####################
_:x0 rdf:first 2 ;
rdf:rest _:x1 .
_:x1 rdf:first 3 ;
rdf:rest rdf:nil .
}
=>
{
:test5 a :Result .
} .