@traqula/test-utils 1.1.3 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/cjs/lib/generators/algebraGenerators.js +28 -12
  2. package/dist/cjs/lib/generators/algebraGenerators.js.map +1 -1
  3. package/dist/cjs/lib/generators/utils.js +56 -4
  4. package/dist/cjs/lib/generators/utils.js.map +1 -1
  5. package/dist/cjs/lib/indexCjs.js +31 -0
  6. package/dist/cjs/lib/indexCjs.js.map +1 -0
  7. package/dist/esm/lib/generators/algebraGenerators.js +28 -12
  8. package/dist/esm/lib/generators/algebraGenerators.js.map +1 -1
  9. package/dist/esm/lib/generators/utils.d.ts +20 -0
  10. package/dist/esm/lib/generators/utils.js +55 -4
  11. package/dist/esm/lib/generators/utils.js.map +1 -1
  12. package/dist/esm/lib/index.d.ts +1 -1
  13. package/dist/esm/lib/index.js +10 -1
  14. package/dist/esm/lib/index.js.map +1 -1
  15. package/package.json +7 -4
  16. package/statics/ast/ast-source-tracked/sparql-1-2/codepoint-esc-05.json +32 -45
  17. package/statics/ast/ast-source-tracked/sparql-1-2/codepoint-esc-06.json +32 -45
  18. package/statics/ast/ast-source-tracked/sparql-1-2/codepoint-esc-07.json +32 -45
  19. package/statics/ast/ast-source-tracked/sparql-1-2/codepoint-esc-08.json +109 -0
  20. package/statics/ast/ast-source-tracked/sparql-1-2/codepoint-esc-09.json +168 -0
  21. package/statics/ast/sparql/sparql-1-2/codepoint-esc-05.sparql +5 -5
  22. package/statics/ast/sparql/sparql-1-2/codepoint-esc-06.sparql +5 -5
  23. package/statics/ast/sparql/sparql-1-2/codepoint-esc-07.sparql +5 -5
  24. package/statics/ast/sparql/sparql-1-2/codepoint-esc-08.sparql +5 -0
  25. package/statics/ast/sparql/sparql-1-2/codepoint-esc-09.sparql +14 -0
  26. package/statics/ast/sparql-generated/sparql-1-2/codepoint-esc-05.sparql +4 -2
  27. package/statics/ast/sparql-generated/sparql-1-2/codepoint-esc-06.sparql +4 -2
  28. package/statics/ast/sparql-generated/sparql-1-2/codepoint-esc-07.sparql +4 -2
  29. package/statics/ast/sparql-generated/sparql-1-2/codepoint-esc-08.sparql +6 -0
  30. package/statics/ast/sparql-generated/sparql-1-2/codepoint-esc-09.sparql +12 -0
  31. package/statics/ast/sparql-generated-compact/sparql-1-2/codepoint-esc-05.sparql +1 -1
  32. package/statics/ast/sparql-generated-compact/sparql-1-2/codepoint-esc-06.sparql +1 -1
  33. package/statics/ast/sparql-generated-compact/sparql-1-2/codepoint-esc-07.sparql +1 -1
  34. package/statics/ast/sparql-generated-compact/sparql-1-2/codepoint-esc-08.sparql +1 -0
  35. package/statics/ast/sparql-generated-compact/sparql-1-2/codepoint-esc-09.sparql +1 -0
  36. package/statics/ast/sparql/sparql-1-2-invalid/codepoint-esc-05-bad.sparql +0 -5
  37. package/statics/ast/sparql/sparql-1-2-invalid/codepoint-esc-06-bad.sparql +0 -5
@@ -7,59 +7,44 @@
7
7
  "patterns": [
8
8
  {
9
9
  "type": "pattern",
10
- "subType": "bgp",
11
- "triples": [
10
+ "subType": "values",
11
+ "variables": [
12
12
  {
13
- "type": "triple",
14
- "subject": {
13
+ "type": "term",
14
+ "subType": "variable",
15
+ "value": "v",
16
+ "loc": {
17
+ "sourceLocationType": "source",
18
+ "start": 21,
19
+ "end": 23
20
+ }
21
+ }
22
+ ],
23
+ "values": [
24
+ {
25
+ "v": {
15
26
  "type": "term",
16
27
  "subType": "namedNode",
17
- "value": "http://example/abc",
18
- "loc": {
19
- "sourceLocationType": "source",
20
- "start": 53,
21
- "end": 92
22
- }
23
- },
24
- "predicate": {
25
- "type": "term",
26
- "subType": "variable",
27
- "value": "p",
28
- "loc": {
29
- "sourceLocationType": "source",
30
- "start": 93,
31
- "end": 95
32
- }
33
- },
34
- "object": {
35
- "type": "term",
36
- "subType": "variable",
37
- "value": "o",
28
+ "value": "http://example/abc👾",
38
29
  "loc": {
39
30
  "sourceLocationType": "source",
40
- "start": 96,
41
- "end": 98
31
+ "start": 42,
32
+ "end": 91
42
33
  }
43
- },
44
- "annotations": [],
45
- "loc": {
46
- "sourceLocationType": "source",
47
- "start": 53,
48
- "end": 98
49
34
  }
50
35
  }
51
36
  ],
52
37
  "loc": {
53
38
  "sourceLocationType": "source",
54
- "start": 53,
55
- "end": 100
39
+ "start": 14,
40
+ "end": 95
56
41
  }
57
42
  }
58
43
  ],
59
44
  "loc": {
60
45
  "sourceLocationType": "source",
61
- "start": 39,
62
- "end": 102
46
+ "start": 10,
47
+ "end": 97
63
48
  }
64
49
  },
65
50
  "solutionModifiers": {},
@@ -72,26 +57,28 @@
72
57
  },
73
58
  "variables": [
74
59
  {
75
- "type": "wildcard",
60
+ "type": "term",
61
+ "subType": "variable",
62
+ "value": "v",
76
63
  "loc": {
77
64
  "sourceLocationType": "source",
78
- "start": 37,
79
- "end": 38
65
+ "start": 7,
66
+ "end": 9
80
67
  }
81
68
  }
82
69
  ],
83
70
  "loc": {
84
71
  "sourceLocationType": "inlinedSource",
85
- "newSource": "# Codepoint escape in an IRI\n\nSELECT * {\n ## /abc\n <http://example/\\u0061\\U00000062\\u0063> ?p ?o .\n}\n",
72
+ "newSource": "SELECT ?v {\n VALUES ?v {\n # abc👾\n <http://example/\\u0061\\U00000062\\u0063\\U0001F47E>\n }\n}\n",
86
73
  "start": 0,
87
74
  "end": 9007199254740991,
88
75
  "loc": {
89
76
  "sourceLocationType": "source",
90
- "start": 30,
91
- "end": 102
77
+ "start": 0,
78
+ "end": 97
92
79
  },
93
- "startOnNew": 30,
94
- "endOnNew": 102
80
+ "startOnNew": 0,
81
+ "endOnNew": 97
95
82
  },
96
83
  "type": "query"
97
84
  }
@@ -7,59 +7,44 @@
7
7
  "patterns": [
8
8
  {
9
9
  "type": "pattern",
10
- "subType": "bgp",
11
- "triples": [
10
+ "subType": "values",
11
+ "variables": [
12
12
  {
13
- "type": "triple",
14
- "subject": {
15
- "type": "term",
16
- "subType": "namedNode",
17
- "value": "http://example/abc",
18
- "loc": {
19
- "sourceLocationType": "source",
20
- "start": 56,
21
- "end": 76
22
- }
23
- },
24
- "predicate": {
25
- "type": "term",
26
- "subType": "variable",
27
- "value": "p",
28
- "loc": {
29
- "sourceLocationType": "source",
30
- "start": 77,
31
- "end": 79
32
- }
33
- },
34
- "object": {
13
+ "type": "term",
14
+ "subType": "variable",
15
+ "value": "v",
16
+ "loc": {
17
+ "sourceLocationType": "source",
18
+ "start": 21,
19
+ "end": 23
20
+ }
21
+ }
22
+ ],
23
+ "values": [
24
+ {
25
+ "v": {
35
26
  "type": "term",
36
27
  "subType": "literal",
37
- "value": "abc",
28
+ "value": "abc👾",
38
29
  "loc": {
39
30
  "sourceLocationType": "source",
40
- "start": 80,
41
- "end": 108
31
+ "start": 44,
32
+ "end": 82
42
33
  }
43
- },
44
- "annotations": [],
45
- "loc": {
46
- "sourceLocationType": "source",
47
- "start": 56,
48
- "end": 108
49
34
  }
50
35
  }
51
36
  ],
52
37
  "loc": {
53
38
  "sourceLocationType": "source",
54
- "start": 56,
55
- "end": 110
39
+ "start": 14,
40
+ "end": 86
56
41
  }
57
42
  }
58
43
  ],
59
44
  "loc": {
60
45
  "sourceLocationType": "source",
61
- "start": 41,
62
- "end": 112
46
+ "start": 10,
47
+ "end": 88
63
48
  }
64
49
  },
65
50
  "solutionModifiers": {},
@@ -72,26 +57,28 @@
72
57
  },
73
58
  "variables": [
74
59
  {
75
- "type": "wildcard",
60
+ "type": "term",
61
+ "subType": "variable",
62
+ "value": "v",
76
63
  "loc": {
77
64
  "sourceLocationType": "source",
78
- "start": 39,
79
- "end": 40
65
+ "start": 7,
66
+ "end": 9
80
67
  }
81
68
  }
82
69
  ],
83
70
  "loc": {
84
71
  "sourceLocationType": "inlinedSource",
85
- "newSource": "# Codepoint escape in a string\n\nSELECT * {\n ## \"abc\"\n <http://example/abc> ?p \"\\U00000061\\u0062\\U00000063\" .\n}\n",
72
+ "newSource": "SELECT ?v {\n VALUES ?v {\n # \"abc👾\"\n \"\\U00000061\\u0062\\U00000063\\U0001F47E\"\n }\n}\n",
86
73
  "start": 0,
87
74
  "end": 9007199254740991,
88
75
  "loc": {
89
76
  "sourceLocationType": "source",
90
- "start": 32,
91
- "end": 112
77
+ "start": 0,
78
+ "end": 88
92
79
  },
93
- "startOnNew": 32,
94
- "endOnNew": 112
80
+ "startOnNew": 0,
81
+ "endOnNew": 88
95
82
  },
96
83
  "type": "query"
97
84
  }
@@ -7,59 +7,44 @@
7
7
  "patterns": [
8
8
  {
9
9
  "type": "pattern",
10
- "subType": "bgp",
11
- "triples": [
10
+ "subType": "values",
11
+ "variables": [
12
12
  {
13
- "type": "triple",
14
- "subject": {
15
- "type": "term",
16
- "subType": "namedNode",
17
- "value": "http://example/abc",
18
- "loc": {
19
- "sourceLocationType": "source",
20
- "start": 56,
21
- "end": 76
22
- }
23
- },
24
- "predicate": {
25
- "type": "term",
26
- "subType": "variable",
27
- "value": "p",
28
- "loc": {
29
- "sourceLocationType": "source",
30
- "start": 77,
31
- "end": 79
32
- }
33
- },
34
- "object": {
13
+ "type": "term",
14
+ "subType": "variable",
15
+ "value": "v",
16
+ "loc": {
17
+ "sourceLocationType": "source",
18
+ "start": 21,
19
+ "end": 23
20
+ }
21
+ }
22
+ ],
23
+ "values": [
24
+ {
25
+ "v": {
35
26
  "type": "term",
36
27
  "subType": "literal",
37
- "value": "abc",
28
+ "value": "abc👾",
38
29
  "loc": {
39
30
  "sourceLocationType": "source",
40
- "start": 80,
41
- "end": 108
31
+ "start": 44,
32
+ "end": 82
42
33
  }
43
- },
44
- "annotations": [],
45
- "loc": {
46
- "sourceLocationType": "source",
47
- "start": 56,
48
- "end": 108
49
34
  }
50
35
  }
51
36
  ],
52
37
  "loc": {
53
38
  "sourceLocationType": "source",
54
- "start": 56,
55
- "end": 110
39
+ "start": 14,
40
+ "end": 86
56
41
  }
57
42
  }
58
43
  ],
59
44
  "loc": {
60
45
  "sourceLocationType": "source",
61
- "start": 41,
62
- "end": 112
46
+ "start": 10,
47
+ "end": 88
63
48
  }
64
49
  },
65
50
  "solutionModifiers": {},
@@ -72,26 +57,28 @@
72
57
  },
73
58
  "variables": [
74
59
  {
75
- "type": "wildcard",
60
+ "type": "term",
61
+ "subType": "variable",
62
+ "value": "v",
76
63
  "loc": {
77
64
  "sourceLocationType": "source",
78
- "start": 39,
79
- "end": 40
65
+ "start": 7,
66
+ "end": 9
80
67
  }
81
68
  }
82
69
  ],
83
70
  "loc": {
84
71
  "sourceLocationType": "inlinedSource",
85
- "newSource": "# Codepoint escape in a string\n\nSELECT * {\n ## 'abc'\n <http://example/abc> ?p '\\U00000061\\u0062\\U00000063' .\n}\n",
72
+ "newSource": "SELECT ?v {\n VALUES ?v {\n # \"abc👾\"\n '\\U00000061\\u0062\\U00000063\\U0001F47E'\n }\n}\n",
86
73
  "start": 0,
87
74
  "end": 9007199254740991,
88
75
  "loc": {
89
76
  "sourceLocationType": "source",
90
- "start": 32,
91
- "end": 112
77
+ "start": 0,
78
+ "end": 88
92
79
  },
93
- "startOnNew": 32,
94
- "endOnNew": 112
80
+ "startOnNew": 0,
81
+ "endOnNew": 88
95
82
  },
96
83
  "type": "query"
97
84
  }
@@ -0,0 +1,109 @@
1
+ {
2
+ "context": [
3
+ {
4
+ "type": "contextDef",
5
+ "subType": "prefix",
6
+ "key": "ex",
7
+ "value": {
8
+ "type": "term",
9
+ "subType": "namedNode",
10
+ "value": "http://example.org/",
11
+ "loc": {
12
+ "sourceLocationType": "source",
13
+ "start": 64,
14
+ "end": 85
15
+ }
16
+ },
17
+ "loc": {
18
+ "sourceLocationType": "source",
19
+ "start": 53,
20
+ "end": 85
21
+ }
22
+ }
23
+ ],
24
+ "subType": "construct",
25
+ "template": {
26
+ "type": "pattern",
27
+ "subType": "bgp",
28
+ "triples": [
29
+ {
30
+ "type": "triple",
31
+ "subject": {
32
+ "type": "term",
33
+ "subType": "namedNode",
34
+ "value": "s",
35
+ "loc": {
36
+ "sourceLocationType": "source",
37
+ "start": 119,
38
+ "end": 123
39
+ },
40
+ "prefix": "ex"
41
+ },
42
+ "predicate": {
43
+ "type": "term",
44
+ "subType": "namedNode",
45
+ "value": "p",
46
+ "loc": {
47
+ "sourceLocationType": "source",
48
+ "start": 124,
49
+ "end": 128
50
+ },
51
+ "prefix": "ex"
52
+ },
53
+ "object": {
54
+ "type": "term",
55
+ "subType": "literal",
56
+ "value": "a\t\n\r\b\f\"'\\a",
57
+ "loc": {
58
+ "sourceLocationType": "source",
59
+ "start": 129,
60
+ "end": 181
61
+ }
62
+ },
63
+ "annotations": [],
64
+ "loc": {
65
+ "sourceLocationType": "source",
66
+ "start": 119,
67
+ "end": 181
68
+ }
69
+ }
70
+ ],
71
+ "loc": {
72
+ "sourceLocationType": "source",
73
+ "start": 119,
74
+ "end": 181
75
+ }
76
+ },
77
+ "datasets": {
78
+ "type": "datasetClauses",
79
+ "clauses": [],
80
+ "loc": {
81
+ "sourceLocationType": "noMaterialize"
82
+ }
83
+ },
84
+ "where": {
85
+ "type": "pattern",
86
+ "subType": "group",
87
+ "patterns": [],
88
+ "loc": {
89
+ "sourceLocationType": "source",
90
+ "start": 190,
91
+ "end": 192
92
+ }
93
+ },
94
+ "solutionModifiers": {},
95
+ "loc": {
96
+ "sourceLocationType": "inlinedSource",
97
+ "newSource": "# Codepoint escape of special characters in strings\n\nPREFIX ex: <http://example.org/>\n# a\\t\\n\\r\\b\\f\\\"\\'\\\\a\nCONSTRUCT { ex:s ex:p \"a\\u0009\\u000A\\u000D\\u0008\\u000C\\u0022\\u0027\\u005Ca\" } WHERE {}\n",
98
+ "start": 0,
99
+ "end": 9007199254740991,
100
+ "loc": {
101
+ "sourceLocationType": "source",
102
+ "start": 53,
103
+ "end": 192
104
+ },
105
+ "startOnNew": 53,
106
+ "endOnNew": 192
107
+ },
108
+ "type": "query"
109
+ }
@@ -0,0 +1,168 @@
1
+ {
2
+ "context": [],
3
+ "subType": "select",
4
+ "where": {
5
+ "type": "pattern",
6
+ "subType": "group",
7
+ "patterns": [
8
+ {
9
+ "type": "pattern",
10
+ "subType": "values",
11
+ "variables": [
12
+ {
13
+ "type": "term",
14
+ "subType": "variable",
15
+ "value": "v",
16
+ "loc": {
17
+ "sourceLocationType": "source",
18
+ "start": 71,
19
+ "end": 73
20
+ }
21
+ }
22
+ ],
23
+ "values": [
24
+ {
25
+ "v": {
26
+ "type": "term",
27
+ "subType": "literal",
28
+ "value": "abc\\def",
29
+ "loc": {
30
+ "sourceLocationType": "source",
31
+ "start": 80,
32
+ "end": 94
33
+ }
34
+ }
35
+ },
36
+ {
37
+ "v": {
38
+ "type": "term",
39
+ "subType": "literal",
40
+ "value": "abc\\tuv",
41
+ "loc": {
42
+ "sourceLocationType": "source",
43
+ "start": 99,
44
+ "end": 113
45
+ }
46
+ }
47
+ },
48
+ {
49
+ "v": {
50
+ "type": "term",
51
+ "subType": "literal",
52
+ "value": "\\A",
53
+ "loc": {
54
+ "sourceLocationType": "source",
55
+ "start": 118,
56
+ "end": 127
57
+ }
58
+ }
59
+ },
60
+ {
61
+ "v": {
62
+ "type": "term",
63
+ "subType": "literal",
64
+ "value": "\\u005C",
65
+ "loc": {
66
+ "sourceLocationType": "source",
67
+ "start": 132,
68
+ "end": 141
69
+ }
70
+ }
71
+ },
72
+ {
73
+ "v": {
74
+ "type": "term",
75
+ "subType": "literal",
76
+ "value": "\\\\",
77
+ "loc": {
78
+ "sourceLocationType": "source",
79
+ "start": 146,
80
+ "end": 160
81
+ }
82
+ }
83
+ },
84
+ {
85
+ "v": {
86
+ "type": "term",
87
+ "subType": "literal",
88
+ "value": "\\\\",
89
+ "loc": {
90
+ "sourceLocationType": "source",
91
+ "start": 165,
92
+ "end": 175
93
+ }
94
+ }
95
+ },
96
+ {
97
+ "v": {
98
+ "type": "term",
99
+ "subType": "literal",
100
+ "value": "\\\\",
101
+ "loc": {
102
+ "sourceLocationType": "source",
103
+ "start": 180,
104
+ "end": 186
105
+ }
106
+ }
107
+ },
108
+ {
109
+ "v": {
110
+ "type": "term",
111
+ "subType": "literal",
112
+ "value": "\\n",
113
+ "loc": {
114
+ "sourceLocationType": "source",
115
+ "start": 191,
116
+ "end": 200
117
+ }
118
+ }
119
+ }
120
+ ],
121
+ "loc": {
122
+ "sourceLocationType": "source",
123
+ "start": 64,
124
+ "end": 204
125
+ }
126
+ }
127
+ ],
128
+ "loc": {
129
+ "sourceLocationType": "source",
130
+ "start": 60,
131
+ "end": 206
132
+ }
133
+ },
134
+ "solutionModifiers": {},
135
+ "datasets": {
136
+ "type": "datasetClauses",
137
+ "clauses": [],
138
+ "loc": {
139
+ "sourceLocationType": "noMaterialize"
140
+ }
141
+ },
142
+ "variables": [
143
+ {
144
+ "type": "term",
145
+ "subType": "variable",
146
+ "value": "v",
147
+ "loc": {
148
+ "sourceLocationType": "source",
149
+ "start": 57,
150
+ "end": 59
151
+ }
152
+ }
153
+ ],
154
+ "loc": {
155
+ "sourceLocationType": "inlinedSource",
156
+ "newSource": "# Codepoint escape are not reused during parsing\n\nSELECT ?v {\n VALUES ?v {\n \"abc\\u005Cdef\"\n \"abc\\u005Ctuv\"\n \"\\u005CA\"\n \"\\\\u005C\"\n \"\\u005C\\u005C\"\n \"\\\\\\u005C\"\n \"\\\\\\\\\"\n \"\\u005Cn\"\n }\n}\n",
157
+ "start": 0,
158
+ "end": 9007199254740991,
159
+ "loc": {
160
+ "sourceLocationType": "source",
161
+ "start": 50,
162
+ "end": 206
163
+ },
164
+ "startOnNew": 50,
165
+ "endOnNew": 206
166
+ },
167
+ "type": "query"
168
+ }
@@ -1,6 +1,6 @@
1
- # Codepoint escape in an IRI
2
-
3
- SELECT * {
4
- ## /abc
5
- <http://example/\u0061\U00000062\u0063> ?p ?o .
1
+ SELECT ?v {
2
+ VALUES ?v {
3
+ # abc👾
4
+ <http://example/\u0061\U00000062\u0063\U0001F47E>
5
+ }
6
6
  }
@@ -1,6 +1,6 @@
1
- # Codepoint escape in a string
2
-
3
- SELECT * {
4
- ## "abc"
5
- <http://example/abc> ?p "\U00000061\u0062\U00000063" .
1
+ SELECT ?v {
2
+ VALUES ?v {
3
+ # "abc👾"
4
+ "\U00000061\u0062\U00000063\U0001F47E"
5
+ }
6
6
  }
@@ -1,6 +1,6 @@
1
- # Codepoint escape in a string
2
-
3
- SELECT * {
4
- ## 'abc'
5
- <http://example/abc> ?p '\U00000061\u0062\U00000063' .
1
+ SELECT ?v {
2
+ VALUES ?v {
3
+ # "abc👾"
4
+ '\U00000061\u0062\U00000063\U0001F47E'
5
+ }
6
6
  }
@@ -0,0 +1,5 @@
1
+ # Codepoint escape of special characters in strings
2
+
3
+ PREFIX ex: <http://example.org/>
4
+ # a\t\n\r\b\f\"\'\\a
5
+ CONSTRUCT { ex:s ex:p "a\u0009\u000A\u000D\u0008\u000C\u0022\u0027\u005Ca" } WHERE {}