rdf-n3 0.2.3.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/.gitignore +1 -0
  2. data/.yardopts +4 -3
  3. data/{History.txt → History.md} +30 -6
  4. data/{README.rdoc → README.md} +56 -19
  5. data/Rakefile +15 -29
  6. data/VERSION +1 -1
  7. data/example-files/sp2b.n3 +50177 -0
  8. data/lib/rdf/n3.rb +2 -2
  9. data/lib/rdf/n3/reader.rb +560 -367
  10. data/lib/rdf/n3/reader/meta.rb +640 -0
  11. data/lib/rdf/n3/reader/n3-selectors.n3 +0 -0
  12. data/lib/rdf/n3/reader/parser.rb +229 -0
  13. data/lib/rdf/n3/vocab.rb +1 -0
  14. data/lib/rdf/n3/writer.rb +324 -265
  15. data/rdf-n3.gemspec +24 -26
  16. data/script/build_meta +242 -0
  17. data/script/parse +62 -13
  18. data/script/tc +4 -4
  19. data/spec/cwm_spec.rb +11 -3
  20. data/spec/n3reader_spec.rb +233 -63
  21. data/spec/rdf_helper.rb +15 -15
  22. data/spec/spec_helper.rb +10 -4
  23. data/spec/swap_spec.rb +11 -35
  24. data/spec/swap_test/n3parser.tests +14 -14
  25. data/spec/swap_test/n3parser.yml +0 -19
  26. data/spec/swap_test/nodeID/classes.ref.rdf +1 -1
  27. data/spec/swap_test/ref/contexts-1.n3 +12 -0
  28. data/spec/swap_test/ref/prefix2.rdf +33 -0
  29. data/spec/swap_test/ref/strquot.n3 +0 -1
  30. data/spec/swap_test/ref/xml-syntax-basic-serialization.rdf +1 -1
  31. data/spec/swap_test/regression.n3 +5 -5
  32. data/spec/swap_test/regression.yml +53 -23
  33. data/spec/turtle/manifest-bad.yml +91 -0
  34. data/spec/turtle/manifest.yml +187 -0
  35. data/spec/turtle_spec.rb +12 -20
  36. data/spec/writer_spec.rb +39 -37
  37. metadata +43 -48
  38. data/lib/rdf/n3/patches/qname_hacks.rb +0 -57
  39. data/lib/rdf/n3/patches/seq.rb +0 -34
  40. data/lib/rdf/n3/reader/n3_grammar.rb +0 -3764
  41. data/lib/rdf/n3/reader/n3_grammar.treetop +0 -227
  42. data/lib/rdf/n3/reader/n3_grammar_18.rb +0 -3764
  43. data/lib/rdf/n3/reader/n3_grammar_18.treetop +0 -227
  44. data/spec/literal_spec.rb +0 -245
@@ -0,0 +1,640 @@
1
+ # This file is automatically generated by script/build_meta
2
+ # Branch and Regexp tables derived from http://www.w3.org/2000/10/swap/grammar/n3-selectors.n3
3
+ module RDF::N3::Meta
4
+ BRANCHES = {
5
+ :"_:_g0" => {
6
+ "." => [],
7
+ ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
8
+ :"_:_g5"],
9
+ "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
10
+ :"_:_g5"],
11
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
12
+ :"_:_g5"],
13
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
14
+ :"_:_g5"],
15
+ "}" => [],
16
+ },
17
+ :"_:_g1" => {
18
+ "." => [],
19
+ ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
20
+ :"_:_g4"],
21
+ "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
22
+ :"_:_g4"],
23
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
24
+ :"_:_g4"],
25
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
26
+ :"_:_g4"],
27
+ "}" => [],
28
+ },
29
+ :"_:_g2" => {
30
+ "." => [],
31
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#barename",
32
+ :"_:_g3"],
33
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#barename",
34
+ :"_:_g3"],
35
+ "}" => [],
36
+ },
37
+ :"_:_g3" => {
38
+ "," => [",",
39
+ :"http://www.w3.org/2000/10/swap/grammar/n3#barename",
40
+ :"_:_g3"],
41
+ "." => [],
42
+ "}" => [],
43
+ },
44
+ :"_:_g4" => {
45
+ "," => [",",
46
+ :"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
47
+ :"_:_g4"],
48
+ "." => [],
49
+ "}" => [],
50
+ },
51
+ :"_:_g5" => {
52
+ "," => [",",
53
+ :"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
54
+ :"_:_g5"],
55
+ "." => [],
56
+ "}" => [],
57
+ },
58
+ :"http://www.w3.org/2000/10/swap/grammar/n3#boolean" => {
59
+ "@false" => ["@false"],
60
+ "@true" => ["@true"],
61
+ },
62
+ :"http://www.w3.org/2000/10/swap/grammar/n3#declaration" => {
63
+ "@base" => ["@base",
64
+ :"http://www.w3.org/2000/10/swap/grammar/n3#explicituri"],
65
+ "@keywords" => ["@keywords",
66
+ :"_:_g2"],
67
+ "@prefix" => ["@prefix",
68
+ :"http://www.w3.org/2000/10/swap/grammar/n3#prefix",
69
+ :"http://www.w3.org/2000/10/swap/grammar/n3#explicituri"],
70
+ },
71
+ :"http://www.w3.org/2000/10/swap/grammar/n3#document" => {
72
+ "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
73
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
74
+ "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
75
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
76
+ "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
77
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
78
+ "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
79
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
80
+ "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
81
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
82
+ ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
83
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
84
+ "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
85
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
86
+ "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
87
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
88
+ "@EOFDUMMY" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
89
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
90
+ "@base" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
91
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
92
+ "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
93
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
94
+ "@forAll" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
95
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
96
+ "@forSome" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
97
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
98
+ "@keywords" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
99
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
100
+ "@prefix" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
101
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
102
+ "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
103
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
104
+ "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
105
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
106
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
107
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
108
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
109
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
110
+ "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
111
+ :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
112
+ },
113
+ :"http://www.w3.org/2000/10/swap/grammar/n3#dtlang" => {
114
+ "!" => [],
115
+ "\"" => [],
116
+ "(" => [],
117
+ ")" => [],
118
+ "+" => [],
119
+ "," => [],
120
+ "-" => [],
121
+ "." => [],
122
+ "0" => [],
123
+ ":" => [],
124
+ ";" => [],
125
+ "<" => [],
126
+ "<=" => [],
127
+ "=" => [],
128
+ "=>" => [],
129
+ "?" => [],
130
+ "@" => ["@",
131
+ :"http://www.w3.org/2000/10/swap/grammar/n3#langcode"],
132
+ "@a" => [],
133
+ "@false" => [],
134
+ "@has" => [],
135
+ "@is" => [],
136
+ "@of" => [],
137
+ "@true" => [],
138
+ "[" => [],
139
+ "]" => [],
140
+ "^" => [],
141
+ "^^" => ["^^",
142
+ :"http://www.w3.org/2000/10/swap/grammar/n3#symbol"],
143
+ "_" => [],
144
+ "a" => [],
145
+ "{" => [],
146
+ "}" => [],
147
+ },
148
+ :"http://www.w3.org/2000/10/swap/grammar/n3#existential" => {
149
+ "@forSome" => ["@forSome",
150
+ :"_:_g1"],
151
+ },
152
+ :"http://www.w3.org/2000/10/swap/grammar/n3#expression" => {
153
+ "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
154
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
155
+ "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
156
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
157
+ "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
158
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
159
+ "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
160
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
161
+ "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
162
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
163
+ ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
164
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
165
+ "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
166
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
167
+ "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
168
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
169
+ "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
170
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
171
+ "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
172
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
173
+ "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
174
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
175
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
176
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
177
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
178
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
179
+ "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
180
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
181
+ },
182
+ :"http://www.w3.org/2000/10/swap/grammar/n3#formulacontent" => {
183
+ "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
184
+ "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
185
+ "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
186
+ "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
187
+ "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
188
+ ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
189
+ "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
190
+ "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
191
+ "@base" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
192
+ "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
193
+ "@forAll" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
194
+ "@forSome" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
195
+ "@keywords" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
196
+ "@prefix" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
197
+ "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
198
+ "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
199
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
200
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
201
+ "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
202
+ "}" => [],
203
+ },
204
+ :"http://www.w3.org/2000/10/swap/grammar/n3#literal" => {
205
+ "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#string",
206
+ :"http://www.w3.org/2000/10/swap/grammar/n3#dtlang"],
207
+ },
208
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object" => {
209
+ "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
210
+ "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
211
+ "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
212
+ "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
213
+ "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
214
+ ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
215
+ "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
216
+ "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
217
+ "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
218
+ "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
219
+ "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
220
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
221
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
222
+ "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
223
+ },
224
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail" => {
225
+ "," => [",",
226
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
227
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail"],
228
+ "." => [],
229
+ ";" => [],
230
+ "]" => [],
231
+ "}" => [],
232
+ },
233
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathitem" => {
234
+ "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#literal"],
235
+ "(" => ["(",
236
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist",
237
+ ")"],
238
+ "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#numericliteral"],
239
+ "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#numericliteral"],
240
+ "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#numericliteral"],
241
+ ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol"],
242
+ "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol"],
243
+ "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#quickvariable"],
244
+ "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#boolean"],
245
+ "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#boolean"],
246
+ "[" => ["[",
247
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist",
248
+ "]"],
249
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol"],
250
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol"],
251
+ "{" => ["{",
252
+ :"http://www.w3.org/2000/10/swap/grammar/n3#formulacontent",
253
+ "}"],
254
+ },
255
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist" => {
256
+ "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
257
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
258
+ "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
259
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
260
+ ")" => [],
261
+ "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
262
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
263
+ "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
264
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
265
+ "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
266
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
267
+ ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
268
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
269
+ "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
270
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
271
+ "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
272
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
273
+ "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
274
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
275
+ "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
276
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
277
+ "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
278
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
279
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
280
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
281
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
282
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
283
+ "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
284
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
285
+ },
286
+ :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail" => {
287
+ "!" => ["!",
288
+ :"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
289
+ "\"" => [],
290
+ "(" => [],
291
+ ")" => [],
292
+ "+" => [],
293
+ "," => [],
294
+ "-" => [],
295
+ "." => [],
296
+ "0" => [],
297
+ ":" => [],
298
+ ";" => [],
299
+ "<" => [],
300
+ "<=" => [],
301
+ "=" => [],
302
+ "=>" => [],
303
+ "?" => [],
304
+ "@a" => [],
305
+ "@false" => [],
306
+ "@has" => [],
307
+ "@is" => [],
308
+ "@of" => [],
309
+ "@true" => [],
310
+ "[" => [],
311
+ "]" => [],
312
+ "^" => ["^",
313
+ :"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
314
+ "_" => [],
315
+ "a" => [],
316
+ "{" => [],
317
+ "}" => [],
318
+ },
319
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist" => {
320
+ "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
321
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
322
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
323
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
324
+ "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
325
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
326
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
327
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
328
+ "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
329
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
330
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
331
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
332
+ "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
333
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
334
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
335
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
336
+ "." => [],
337
+ "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
338
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
339
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
340
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
341
+ ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
342
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
343
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
344
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
345
+ "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
346
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
347
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
348
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
349
+ "<=" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
350
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
351
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
352
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
353
+ "=" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
354
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
355
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
356
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
357
+ "=>" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
358
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
359
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
360
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
361
+ "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
362
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
363
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
364
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
365
+ "@a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
366
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
367
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
368
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
369
+ "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
370
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
371
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
372
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
373
+ "@has" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
374
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
375
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
376
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
377
+ "@is" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
378
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
379
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
380
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
381
+ "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
382
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
383
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
384
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
385
+ "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
386
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
387
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
388
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
389
+ "]" => [],
390
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
391
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
392
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
393
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
394
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
395
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
396
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
397
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
398
+ "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
399
+ :"http://www.w3.org/2000/10/swap/grammar/n3#object",
400
+ :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
401
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
402
+ "}" => [],
403
+ },
404
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail" => {
405
+ "." => [],
406
+ ";" => [";",
407
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
408
+ "]" => [],
409
+ "}" => [],
410
+ },
411
+ :"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement" => {
412
+ "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
413
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
414
+ "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
415
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
416
+ "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
417
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
418
+ "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
419
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
420
+ "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
421
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
422
+ ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
423
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
424
+ "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
425
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
426
+ "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
427
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
428
+ "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
429
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
430
+ "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
431
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
432
+ "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
433
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
434
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
435
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
436
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
437
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
438
+ "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
439
+ :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
440
+ },
441
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statement" => {
442
+ "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
443
+ "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
444
+ "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
445
+ "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
446
+ "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
447
+ ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
448
+ "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
449
+ "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
450
+ "@base" => [:"http://www.w3.org/2000/10/swap/grammar/n3#declaration"],
451
+ "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
452
+ "@forAll" => [:"http://www.w3.org/2000/10/swap/grammar/n3#universal"],
453
+ "@forSome" => [:"http://www.w3.org/2000/10/swap/grammar/n3#existential"],
454
+ "@keywords" => [:"http://www.w3.org/2000/10/swap/grammar/n3#declaration"],
455
+ "@prefix" => [:"http://www.w3.org/2000/10/swap/grammar/n3#declaration"],
456
+ "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
457
+ "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
458
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
459
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
460
+ "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
461
+ },
462
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementlist" => {
463
+ "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
464
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
465
+ "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
466
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
467
+ "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
468
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
469
+ "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
470
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
471
+ "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
472
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
473
+ ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
474
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
475
+ "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
476
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
477
+ "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
478
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
479
+ "@base" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
480
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
481
+ "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
482
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
483
+ "@forAll" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
484
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
485
+ "@forSome" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
486
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
487
+ "@keywords" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
488
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
489
+ "@prefix" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
490
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
491
+ "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
492
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
493
+ "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
494
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
495
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
496
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
497
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
498
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
499
+ "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
500
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
501
+ "}" => [],
502
+ },
503
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional" => {
504
+ "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
505
+ ".",
506
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
507
+ "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
508
+ ".",
509
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
510
+ "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
511
+ ".",
512
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
513
+ "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
514
+ ".",
515
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
516
+ "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
517
+ ".",
518
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
519
+ ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
520
+ ".",
521
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
522
+ "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
523
+ ".",
524
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
525
+ "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
526
+ ".",
527
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
528
+ "@EOFDUMMY" => [],
529
+ "@base" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
530
+ ".",
531
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
532
+ "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
533
+ ".",
534
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
535
+ "@forAll" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
536
+ ".",
537
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
538
+ "@forSome" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
539
+ ".",
540
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
541
+ "@keywords" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
542
+ ".",
543
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
544
+ "@prefix" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
545
+ ".",
546
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
547
+ "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
548
+ ".",
549
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
550
+ "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
551
+ ".",
552
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
553
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
554
+ ".",
555
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
556
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
557
+ ".",
558
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
559
+ "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
560
+ ".",
561
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
562
+ },
563
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail" => {
564
+ "." => [".",
565
+ :"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
566
+ "}" => [],
567
+ },
568
+ :"http://www.w3.org/2000/10/swap/grammar/n3#subject" => {
569
+ "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
570
+ "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
571
+ "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
572
+ "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
573
+ "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
574
+ ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
575
+ "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
576
+ "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
577
+ "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
578
+ "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
579
+ "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
580
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
581
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
582
+ "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
583
+ },
584
+ :"http://www.w3.org/2000/10/swap/grammar/n3#symbol" => {
585
+ ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#qname"],
586
+ "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#explicituri"],
587
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#qname"],
588
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#qname"],
589
+ },
590
+ :"http://www.w3.org/2000/10/swap/grammar/n3#universal" => {
591
+ "@forAll" => ["@forAll",
592
+ :"_:_g0"],
593
+ },
594
+ :"http://www.w3.org/2000/10/swap/grammar/n3#verb" => {
595
+ "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
596
+ "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
597
+ "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
598
+ "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
599
+ "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
600
+ ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
601
+ "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
602
+ "<=" => ["<="],
603
+ "=" => ["="],
604
+ "=>" => ["=>"],
605
+ "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
606
+ "@a" => ["@a"],
607
+ "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
608
+ "@has" => ["@has",
609
+ :"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
610
+ "@is" => ["@is",
611
+ :"http://www.w3.org/2000/10/swap/grammar/n3#expression",
612
+ "@of"],
613
+ "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
614
+ "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
615
+ "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
616
+ "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
617
+ "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
618
+ },
619
+ }
620
+
621
+ if RUBY_VERSION >= "1.9.0"
622
+ BARENAME_START = "A-Z_a-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd\u{10000}-\u{effff}"
623
+ BARENAME_TAIL = "0-9#{BARENAME_START}\u00b7\u0300-\u036f\u203f-\u2040\\-"
624
+ else
625
+ BARENAME_START = "A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\xff"
626
+ BARENAME_TAIL = "0-9#{BARENAME_START}\xb7\\-"
627
+ end
628
+ REGEXPS = {
629
+ :"http://www.w3.org/2000/10/swap/grammar/n3#barename" => Regexp.compile(%(^[#{BARENAME_START}][#{BARENAME_TAIL}]*)),
630
+ :"http://www.w3.org/2000/10/swap/grammar/n3#explicituri" => Regexp.compile("^<[^>]*>"),
631
+ :"http://www.w3.org/2000/10/swap/grammar/n3#langcode" => Regexp.compile("^[a-zA-Z]+(-[a-zA-Z0-9]+)*"),
632
+ :"http://www.w3.org/2000/10/swap/grammar/n3#prefix" => Regexp.compile(%(^([#{BARENAME_START}][#{BARENAME_TAIL}]*)?:)),
633
+ :"http://www.w3.org/2000/10/swap/grammar/n3#qname" => Regexp.compile(%(^(([#{BARENAME_START}][#{BARENAME_TAIL}]*)?:)?([#{BARENAME_START}][#{BARENAME_TAIL}]*)?)),
634
+ :"http://www.w3.org/2000/10/swap/grammar/n3#quickvariable" => Regexp.compile(%(^\\?[#{BARENAME_START}][#{BARENAME_TAIL}]*)),
635
+ :"http://www.w3.org/2000/10/swap/grammar/n3#string" => Regexp.compile("(\"\"\"[^\"\\\\]*(?:(?:\\\\.|\"(?!\"\"))[^\"\\\\]*)*\"\"\")|(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\")"),
636
+
637
+ # Hack to replace integer|double|decimal with numericliteral
638
+ :"http://www.w3.org/2000/10/swap/grammar/n3#numericliteral" => Regexp.compile(%(^[-+]?[0-9]+(\\.[0-9]+)?(e[-+]?[0-9]+)?))
639
+ }
640
+ end