rdf-turtle 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OGU0NjNjOTY4OGRhZDhlYzZlMjUxNWZlMGVkZTYzNmY1NmY3ODc4MQ==
5
+ data.tar.gz: !binary |-
6
+ YTVjMGZjNDI2YTBiNmQyZmY4OGMyNGFjOTkxNTVlYTYzODJmZDljMA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MWExYmZhNGI0Y2Y4YzE4NDQzY2ExNjlkZmExM2NlYzgzMjUxNWQwZTk4Mzhl
10
+ YzY5NTgyZWM2NjQyZWY2NWIxNWMwNWRmNTRlYWYzMzhmMWQzNmY5YmExMjQ0
11
+ ZDMyOTYzZTA5NzU1MTQxZDAyMmJjZWEyMDVkMGZjOWQwMmY1MzQ=
12
+ data.tar.gz: !binary |-
13
+ NDQxNzlmNGIwYjFlNmU3M2QwNGIwZmEyMWM4ZTBhMDJlMWU1OTg0YjQ4N2Ey
14
+ NmEyNDlmYzZlY2Q3MmVhZjcxZDBhMmU4MjkyODRjOWVjMzE3YmU2MjE3ZWU5
15
+ MmEzMjdmZDRhOTM0Mjk0Y2ZkYWI0YmQ1MjIwMGQyZjBhYjY1NGI=
data/README.md CHANGED
@@ -45,16 +45,18 @@ Full documentation available on [Rubydoc.info][Turtle doc]
45
45
  ### Variations from the spec
46
46
  In some cases, the specification is unclear on certain issues:
47
47
 
48
- * For the time being, plain literals are generated without an xsd:string datatype, but literals with an xsd:string
49
- datatype are saved as non-datatyped triples in the graph. This will be updated in the future when the rest of the
50
- library suite is brought up to date with RDF 1.1.
48
+ * The LC version of the [Turtle][] specification separates rules for `@base` and `@prefix` with
49
+ closing '.' from the
50
+ SPARQL-like `BASE` and `PREFIX` without closing '.'. This version implements a more flexible
51
+ syntax where the `@` and closing `.` are optional and `base/prefix` are matched case independently.
52
+ * Additionally, both `a` and `A` match `rdf:type`.
51
53
 
52
54
  ### Freebase-specific Reader
53
55
  There is a special reader useful for processing [Freebase Dumps][]. To invoke
54
56
  this, add the `:freebase => true` option to the {RDF::Turtle::Reader.new}, or
55
57
  use {RDF::Turtle::FreebaseReader} directly. As with {RDF::Turtle::Reader},
56
58
  prefix definitions may be passed in using the `:prefixes` option to
57
- {RDF::Turtle::FreebaseReader#initialize} using the standard mechanism defined
59
+ RDF::Turtle::FreebaseReader} using the standard mechanism defined
58
60
  for `RDF::Reader`.
59
61
 
60
62
  The [Freebase Dumps][] have a very normalized form, similar to N-Triples but
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.6
1
+ 1.0.7
@@ -1,4 +1,4 @@
1
- # This file is automatically generated by /Users/gregg/.rvm/gems/ruby-1.9.3-p374/bundler/gems/ebnf-a5c008da3a01/bin/ebnf
1
+ # This file is automatically generated by /Users/gregg/.rvm/gems/ruby-1.9.3-p392/bundler/gems/ebnf-af9a669d518f/bin/ebnf
2
2
  # BRANCH derived from etc/turtle.bnf
3
3
  module RDF::Turtle::Meta
4
4
  START = :turtleDoc
@@ -66,7 +66,19 @@ module RDF::Turtle::Meta
66
66
  :STRING_LITERAL_SINGLE_QUOTE => [:STRING_LITERAL_SINGLE_QUOTE],
67
67
  },
68
68
  :base => {
69
- "@base" => ["@base", :IRIREF, "."],
69
+ :BASE => [:BASE, :IRIREF, :_base_1],
70
+ },
71
+ :_base_1 => {
72
+ "(" => [],
73
+ "." => ["."],
74
+ :ANON => [],
75
+ :BASE => [],
76
+ :BLANK_NODE_LABEL => [],
77
+ :IRIREF => [],
78
+ :PNAME_LN => [],
79
+ :PNAME_NS => [],
80
+ :PREFIX => [],
81
+ "[" => [],
70
82
  },
71
83
  :blankNodePropertyList => {
72
84
  "[" => ["[", :predicateObjectList, "]"],
@@ -112,10 +124,8 @@ module RDF::Turtle::Meta
112
124
  "true" => [:object, :_collection_1],
113
125
  },
114
126
  :directive => {
115
- "@base" => [:base],
116
- "@prefix" => [:prefixID],
117
- :SPARQL_BASE => [:sparqlBase],
118
- :SPARQL_PREFIX => [:sparqlPrefix],
127
+ :BASE => [:base],
128
+ :PREFIX => [:prefixID],
119
129
  },
120
130
  :iri => {
121
131
  :IRIREF => [:IRIREF],
@@ -187,6 +197,7 @@ module RDF::Turtle::Meta
187
197
  :PNAME_NS => [:iri],
188
198
  },
189
199
  :predicateObjectList => {
200
+ "A" => [:verb, :objectList, :_predicateObjectList_1],
190
201
  :IRIREF => [:verb, :objectList, :_predicateObjectList_1],
191
202
  :PNAME_LN => [:verb, :objectList, :_predicateObjectList_1],
192
203
  :PNAME_NS => [:verb, :objectList, :_predicateObjectList_1],
@@ -206,6 +217,7 @@ module RDF::Turtle::Meta
206
217
  :_predicateObjectList_4 => {
207
218
  "." => [],
208
219
  ";" => [],
220
+ "A" => [:_predicateObjectList_5],
209
221
  :IRIREF => [:_predicateObjectList_5],
210
222
  :PNAME_LN => [:_predicateObjectList_5],
211
223
  :PNAME_NS => [:_predicateObjectList_5],
@@ -213,31 +225,36 @@ module RDF::Turtle::Meta
213
225
  "a" => [:_predicateObjectList_5],
214
226
  },
215
227
  :_predicateObjectList_5 => {
228
+ "A" => [:verb, :objectList],
216
229
  :IRIREF => [:verb, :objectList],
217
230
  :PNAME_LN => [:verb, :objectList],
218
231
  :PNAME_NS => [:verb, :objectList],
219
232
  "a" => [:verb, :objectList],
220
233
  },
221
234
  :prefixID => {
222
- "@prefix" => ["@prefix", :PNAME_NS, :IRIREF, "."],
223
- },
224
- :sparqlBase => {
225
- :SPARQL_BASE => [:SPARQL_BASE, :IRIREF],
235
+ :PREFIX => [:PREFIX, :PNAME_NS, :IRIREF, :_prefixID_1],
226
236
  },
227
- :sparqlPrefix => {
228
- :SPARQL_PREFIX => [:SPARQL_PREFIX, :PNAME_NS, :IRIREF],
237
+ :_prefixID_1 => {
238
+ "(" => [],
239
+ "." => ["."],
240
+ :ANON => [],
241
+ :BASE => [],
242
+ :BLANK_NODE_LABEL => [],
243
+ :IRIREF => [],
244
+ :PNAME_LN => [],
245
+ :PNAME_NS => [],
246
+ :PREFIX => [],
247
+ "[" => [],
229
248
  },
230
249
  :statement => {
231
250
  "(" => [:_statement_1],
232
- "@base" => [:directive],
233
- "@prefix" => [:directive],
234
251
  :ANON => [:_statement_1],
252
+ :BASE => [:directive],
235
253
  :BLANK_NODE_LABEL => [:_statement_1],
236
254
  :IRIREF => [:_statement_1],
237
255
  :PNAME_LN => [:_statement_1],
238
256
  :PNAME_NS => [:_statement_1],
239
- :SPARQL_BASE => [:directive],
240
- :SPARQL_PREFIX => [:directive],
257
+ :PREFIX => [:directive],
241
258
  "[" => [:_statement_1],
242
259
  },
243
260
  :_statement_1 => {
@@ -279,6 +296,7 @@ module RDF::Turtle::Meta
279
296
  },
280
297
  :_triples_3 => {
281
298
  "." => [],
299
+ "A" => [:predicateObjectList],
282
300
  :IRIREF => [:predicateObjectList],
283
301
  :PNAME_LN => [:predicateObjectList],
284
302
  :PNAME_NS => [:predicateObjectList],
@@ -286,31 +304,28 @@ module RDF::Turtle::Meta
286
304
  },
287
305
  :turtleDoc => {
288
306
  "(" => [:_turtleDoc_1],
289
- "@base" => [:_turtleDoc_1],
290
- "@prefix" => [:_turtleDoc_1],
291
307
  :ANON => [:_turtleDoc_1],
308
+ :BASE => [:_turtleDoc_1],
292
309
  :BLANK_NODE_LABEL => [:_turtleDoc_1],
293
310
  :IRIREF => [:_turtleDoc_1],
294
311
  :PNAME_LN => [:_turtleDoc_1],
295
312
  :PNAME_NS => [:_turtleDoc_1],
296
- :SPARQL_BASE => [:_turtleDoc_1],
297
- :SPARQL_PREFIX => [:_turtleDoc_1],
313
+ :PREFIX => [:_turtleDoc_1],
298
314
  "[" => [:_turtleDoc_1],
299
315
  },
300
316
  :_turtleDoc_1 => {
301
317
  "(" => [:statement, :turtleDoc],
302
- "@base" => [:statement, :turtleDoc],
303
- "@prefix" => [:statement, :turtleDoc],
304
318
  :ANON => [:statement, :turtleDoc],
319
+ :BASE => [:statement, :turtleDoc],
305
320
  :BLANK_NODE_LABEL => [:statement, :turtleDoc],
306
321
  :IRIREF => [:statement, :turtleDoc],
307
322
  :PNAME_LN => [:statement, :turtleDoc],
308
323
  :PNAME_NS => [:statement, :turtleDoc],
309
- :SPARQL_BASE => [:statement, :turtleDoc],
310
- :SPARQL_PREFIX => [:statement, :turtleDoc],
324
+ :PREFIX => [:statement, :turtleDoc],
311
325
  "[" => [:statement, :turtleDoc],
312
326
  },
313
327
  :verb => {
328
+ "A" => ["A"],
314
329
  :IRIREF => [:predicate],
315
330
  :PNAME_LN => [:predicate],
316
331
  :PNAME_NS => [:predicate],
@@ -323,9 +338,9 @@ module RDF::Turtle::Meta
323
338
  ",",
324
339
  ".",
325
340
  ";",
326
- "@base",
327
- "@prefix",
341
+ "A",
328
342
  :ANON,
343
+ :BASE,
329
344
  :BLANK_NODE_LABEL,
330
345
  :DECIMAL,
331
346
  :DOUBLE,
@@ -334,8 +349,7 @@ module RDF::Turtle::Meta
334
349
  :LANGTAG,
335
350
  :PNAME_LN,
336
351
  :PNAME_NS,
337
- :SPARQL_BASE,
338
- :SPARQL_PREFIX,
352
+ :PREFIX,
339
353
  :STRING_LITERAL_LONG_QUOTE,
340
354
  :STRING_LITERAL_LONG_SINGLE_QUOTE,
341
355
  :STRING_LITERAL_QUOTE,
@@ -385,12 +399,19 @@ module RDF::Turtle::Meta
385
399
  :STRING_LITERAL_LONG_SINGLE_QUOTE,
386
400
  :STRING_LITERAL_LONG_QUOTE],
387
401
  :base => [
388
- "@base"],
402
+ :BASE],
389
403
  :_base_1 => [
404
+ ".",
405
+ :_eps],
406
+ :_base_2 => [
390
407
  :IRIREF],
408
+ :_base_3 => [
409
+ ".",
410
+ :_eps],
391
411
  :blankNodePropertyList => [
392
412
  "["],
393
413
  :_blankNodePropertyList_1 => [
414
+ "A",
394
415
  "a",
395
416
  :IRIREF,
396
417
  :PNAME_LN,
@@ -473,10 +494,8 @@ module RDF::Turtle::Meta
473
494
  :_collection_5 => [
474
495
  ")"],
475
496
  :directive => [
476
- "@prefix",
477
- "@base",
478
- :SPARQL_PREFIX,
479
- :SPARQL_BASE],
497
+ :PREFIX,
498
+ :BASE],
480
499
  :_empty => [
481
500
  :_eps],
482
501
  :iri => [
@@ -562,6 +581,7 @@ module RDF::Turtle::Meta
562
581
  :PNAME_LN,
563
582
  :PNAME_NS],
564
583
  :predicateObjectList => [
584
+ "A",
565
585
  "a",
566
586
  :IRIREF,
567
587
  :PNAME_LN,
@@ -575,11 +595,13 @@ module RDF::Turtle::Meta
575
595
  ";"],
576
596
  :_predicateObjectList_4 => [
577
597
  :_eps,
598
+ "A",
578
599
  "a",
579
600
  :IRIREF,
580
601
  :PNAME_LN,
581
602
  :PNAME_NS],
582
603
  :_predicateObjectList_5 => [
604
+ "A",
583
605
  "a",
584
606
  :IRIREF,
585
607
  :PNAME_LN,
@@ -606,6 +628,7 @@ module RDF::Turtle::Meta
606
628
  ";"],
607
629
  :_predicateObjectList_8 => [
608
630
  :_eps,
631
+ "A",
609
632
  "a",
610
633
  :IRIREF,
611
634
  :PNAME_LN,
@@ -628,22 +651,20 @@ module RDF::Turtle::Meta
628
651
  :STRING_LITERAL_LONG_SINGLE_QUOTE,
629
652
  :STRING_LITERAL_LONG_QUOTE],
630
653
  :prefixID => [
631
- "@prefix"],
654
+ :PREFIX],
632
655
  :_prefixID_1 => [
656
+ ".",
657
+ :_eps],
658
+ :_prefixID_2 => [
633
659
  :PNAME_NS],
634
- :sparqlBase => [
635
- :SPARQL_BASE],
636
- :_sparqlBase_1 => [
660
+ :_prefixID_3 => [
637
661
  :IRIREF],
638
- :sparqlPrefix => [
639
- :SPARQL_PREFIX],
640
- :_sparqlPrefix_1 => [
641
- :PNAME_NS],
662
+ :_prefixID_4 => [
663
+ ".",
664
+ :_eps],
642
665
  :statement => [
643
- "@prefix",
644
- "@base",
645
- :SPARQL_PREFIX,
646
- :SPARQL_BASE,
666
+ :PREFIX,
667
+ :BASE,
647
668
  "[",
648
669
  :IRIREF,
649
670
  :BLANK_NODE_LABEL,
@@ -687,27 +708,28 @@ module RDF::Turtle::Meta
687
708
  "["],
688
709
  :_triples_3 => [
689
710
  :_eps,
711
+ "A",
690
712
  "a",
691
713
  :IRIREF,
692
714
  :PNAME_LN,
693
715
  :PNAME_NS],
694
716
  :_triples_4 => [
717
+ "A",
695
718
  "a",
696
719
  :IRIREF,
697
720
  :PNAME_LN,
698
721
  :PNAME_NS],
699
722
  :_triples_5 => [
700
723
  :_eps,
724
+ "A",
701
725
  "a",
702
726
  :IRIREF,
703
727
  :PNAME_LN,
704
728
  :PNAME_NS],
705
729
  :turtleDoc => [
706
730
  :_eps,
707
- "@prefix",
708
- "@base",
709
- :SPARQL_PREFIX,
710
- :SPARQL_BASE,
731
+ :PREFIX,
732
+ :BASE,
711
733
  "[",
712
734
  :IRIREF,
713
735
  :BLANK_NODE_LABEL,
@@ -716,10 +738,8 @@ module RDF::Turtle::Meta
716
738
  :PNAME_LN,
717
739
  :PNAME_NS],
718
740
  :_turtleDoc_1 => [
719
- "@prefix",
720
- "@base",
721
- :SPARQL_PREFIX,
722
- :SPARQL_BASE,
741
+ :PREFIX,
742
+ :BASE,
723
743
  "[",
724
744
  :IRIREF,
725
745
  :BLANK_NODE_LABEL,
@@ -729,10 +749,8 @@ module RDF::Turtle::Meta
729
749
  :PNAME_NS],
730
750
  :_turtleDoc_2 => [
731
751
  :_eps,
732
- "@prefix",
733
- "@base",
734
- :SPARQL_PREFIX,
735
- :SPARQL_BASE,
752
+ :PREFIX,
753
+ :BASE,
736
754
  "[",
737
755
  :IRIREF,
738
756
  :BLANK_NODE_LABEL,
@@ -741,6 +759,7 @@ module RDF::Turtle::Meta
741
759
  :PNAME_LN,
742
760
  :PNAME_NS],
743
761
  :verb => [
762
+ "A",
744
763
  "a",
745
764
  :IRIREF,
746
765
  :PNAME_LN,
@@ -748,6 +767,7 @@ module RDF::Turtle::Meta
748
767
  }.freeze
749
768
  FOLLOW = {
750
769
  :BlankNode => [
770
+ "A",
751
771
  "a",
752
772
  ")",
753
773
  ",",
@@ -815,6 +835,7 @@ module RDF::Turtle::Meta
815
835
  :STRING_LITERAL_LONG_SINGLE_QUOTE,
816
836
  :STRING_LITERAL_LONG_QUOTE],
817
837
  :PrefixedName => [
838
+ "A",
818
839
  "a",
819
840
  :IRIREF,
820
841
  :BLANK_NODE_LABEL,
@@ -973,10 +994,8 @@ module RDF::Turtle::Meta
973
994
  :STRING_LITERAL_LONG_QUOTE],
974
995
  :base => [
975
996
  :_eof,
976
- "@prefix",
977
- "@base",
978
- :SPARQL_PREFIX,
979
- :SPARQL_BASE,
997
+ :PREFIX,
998
+ :BASE,
980
999
  "[",
981
1000
  :IRIREF,
982
1001
  :BLANK_NODE_LABEL,
@@ -986,10 +1005,30 @@ module RDF::Turtle::Meta
986
1005
  :PNAME_NS],
987
1006
  :_base_1 => [
988
1007
  :_eof,
989
- "@prefix",
990
- "@base",
991
- :SPARQL_PREFIX,
992
- :SPARQL_BASE,
1008
+ :PREFIX,
1009
+ :BASE,
1010
+ "[",
1011
+ :IRIREF,
1012
+ :BLANK_NODE_LABEL,
1013
+ :ANON,
1014
+ "(",
1015
+ :PNAME_LN,
1016
+ :PNAME_NS],
1017
+ :_base_2 => [
1018
+ :_eof,
1019
+ :PREFIX,
1020
+ :BASE,
1021
+ "[",
1022
+ :IRIREF,
1023
+ :BLANK_NODE_LABEL,
1024
+ :ANON,
1025
+ "(",
1026
+ :PNAME_LN,
1027
+ :PNAME_NS],
1028
+ :_base_3 => [
1029
+ :_eof,
1030
+ :PREFIX,
1031
+ :BASE,
993
1032
  "[",
994
1033
  :IRIREF,
995
1034
  :BLANK_NODE_LABEL,
@@ -999,6 +1038,7 @@ module RDF::Turtle::Meta
999
1038
  :PNAME_NS],
1000
1039
  :blankNodePropertyList => [
1001
1040
  ".",
1041
+ "A",
1002
1042
  "a",
1003
1043
  ")",
1004
1044
  ",",
@@ -1022,6 +1062,7 @@ module RDF::Turtle::Meta
1022
1062
  :STRING_LITERAL_LONG_QUOTE],
1023
1063
  :_blankNodePropertyList_1 => [
1024
1064
  ".",
1065
+ "A",
1025
1066
  "a",
1026
1067
  ")",
1027
1068
  ",",
@@ -1045,6 +1086,7 @@ module RDF::Turtle::Meta
1045
1086
  :STRING_LITERAL_LONG_QUOTE],
1046
1087
  :_blankNodePropertyList_2 => [
1047
1088
  ".",
1089
+ "A",
1048
1090
  "a",
1049
1091
  ")",
1050
1092
  ",",
@@ -1067,6 +1109,7 @@ module RDF::Turtle::Meta
1067
1109
  :STRING_LITERAL_LONG_SINGLE_QUOTE,
1068
1110
  :STRING_LITERAL_LONG_QUOTE],
1069
1111
  :collection => [
1112
+ "A",
1070
1113
  "a",
1071
1114
  ")",
1072
1115
  ",",
@@ -1094,6 +1137,7 @@ module RDF::Turtle::Meta
1094
1137
  :_collection_2 => [
1095
1138
  ")"],
1096
1139
  :_collection_3 => [
1140
+ "A",
1097
1141
  "a",
1098
1142
  ")",
1099
1143
  ",",
@@ -1119,6 +1163,7 @@ module RDF::Turtle::Meta
1119
1163
  :_collection_4 => [
1120
1164
  ")"],
1121
1165
  :_collection_5 => [
1166
+ "A",
1122
1167
  "a",
1123
1168
  ")",
1124
1169
  ",",
@@ -1143,10 +1188,8 @@ module RDF::Turtle::Meta
1143
1188
  :STRING_LITERAL_LONG_QUOTE],
1144
1189
  :directive => [
1145
1190
  :_eof,
1146
- "@prefix",
1147
- "@base",
1148
- :SPARQL_PREFIX,
1149
- :SPARQL_BASE,
1191
+ :PREFIX,
1192
+ :BASE,
1150
1193
  "[",
1151
1194
  :IRIREF,
1152
1195
  :BLANK_NODE_LABEL,
@@ -1155,6 +1198,7 @@ module RDF::Turtle::Meta
1155
1198
  :PNAME_LN,
1156
1199
  :PNAME_NS],
1157
1200
  :iri => [
1201
+ "A",
1158
1202
  "a",
1159
1203
  :IRIREF,
1160
1204
  :BLANK_NODE_LABEL,
@@ -1310,10 +1354,8 @@ module RDF::Turtle::Meta
1310
1354
  "]"],
1311
1355
  :prefixID => [
1312
1356
  :_eof,
1313
- "@prefix",
1314
- "@base",
1315
- :SPARQL_PREFIX,
1316
- :SPARQL_BASE,
1357
+ :PREFIX,
1358
+ :BASE,
1317
1359
  "[",
1318
1360
  :IRIREF,
1319
1361
  :BLANK_NODE_LABEL,
@@ -1323,23 +1365,8 @@ module RDF::Turtle::Meta
1323
1365
  :PNAME_NS],
1324
1366
  :_prefixID_1 => [
1325
1367
  :_eof,
1326
- "@prefix",
1327
- "@base",
1328
- :SPARQL_PREFIX,
1329
- :SPARQL_BASE,
1330
- "[",
1331
- :IRIREF,
1332
- :BLANK_NODE_LABEL,
1333
- :ANON,
1334
- "(",
1335
- :PNAME_LN,
1336
- :PNAME_NS],
1337
- :sparqlBase => [
1338
- :_eof,
1339
- "@prefix",
1340
- "@base",
1341
- :SPARQL_PREFIX,
1342
- :SPARQL_BASE,
1368
+ :PREFIX,
1369
+ :BASE,
1343
1370
  "[",
1344
1371
  :IRIREF,
1345
1372
  :BLANK_NODE_LABEL,
@@ -1347,12 +1374,10 @@ module RDF::Turtle::Meta
1347
1374
  "(",
1348
1375
  :PNAME_LN,
1349
1376
  :PNAME_NS],
1350
- :_sparqlBase_1 => [
1377
+ :_prefixID_2 => [
1351
1378
  :_eof,
1352
- "@prefix",
1353
- "@base",
1354
- :SPARQL_PREFIX,
1355
- :SPARQL_BASE,
1379
+ :PREFIX,
1380
+ :BASE,
1356
1381
  "[",
1357
1382
  :IRIREF,
1358
1383
  :BLANK_NODE_LABEL,
@@ -1360,12 +1385,10 @@ module RDF::Turtle::Meta
1360
1385
  "(",
1361
1386
  :PNAME_LN,
1362
1387
  :PNAME_NS],
1363
- :sparqlPrefix => [
1388
+ :_prefixID_3 => [
1364
1389
  :_eof,
1365
- "@prefix",
1366
- "@base",
1367
- :SPARQL_PREFIX,
1368
- :SPARQL_BASE,
1390
+ :PREFIX,
1391
+ :BASE,
1369
1392
  "[",
1370
1393
  :IRIREF,
1371
1394
  :BLANK_NODE_LABEL,
@@ -1373,12 +1396,10 @@ module RDF::Turtle::Meta
1373
1396
  "(",
1374
1397
  :PNAME_LN,
1375
1398
  :PNAME_NS],
1376
- :_sparqlPrefix_1 => [
1399
+ :_prefixID_4 => [
1377
1400
  :_eof,
1378
- "@prefix",
1379
- "@base",
1380
- :SPARQL_PREFIX,
1381
- :SPARQL_BASE,
1401
+ :PREFIX,
1402
+ :BASE,
1382
1403
  "[",
1383
1404
  :IRIREF,
1384
1405
  :BLANK_NODE_LABEL,
@@ -1388,10 +1409,8 @@ module RDF::Turtle::Meta
1388
1409
  :PNAME_NS],
1389
1410
  :statement => [
1390
1411
  :_eof,
1391
- "@prefix",
1392
- "@base",
1393
- :SPARQL_PREFIX,
1394
- :SPARQL_BASE,
1412
+ :PREFIX,
1413
+ :BASE,
1395
1414
  "[",
1396
1415
  :IRIREF,
1397
1416
  :BLANK_NODE_LABEL,
@@ -1401,10 +1420,8 @@ module RDF::Turtle::Meta
1401
1420
  :PNAME_NS],
1402
1421
  :_statement_1 => [
1403
1422
  :_eof,
1404
- "@prefix",
1405
- "@base",
1406
- :SPARQL_PREFIX,
1407
- :SPARQL_BASE,
1423
+ :PREFIX,
1424
+ :BASE,
1408
1425
  "[",
1409
1426
  :IRIREF,
1410
1427
  :BLANK_NODE_LABEL,
@@ -1414,10 +1431,8 @@ module RDF::Turtle::Meta
1414
1431
  :PNAME_NS],
1415
1432
  :_statement_2 => [
1416
1433
  :_eof,
1417
- "@prefix",
1418
- "@base",
1419
- :SPARQL_PREFIX,
1420
- :SPARQL_BASE,
1434
+ :PREFIX,
1435
+ :BASE,
1421
1436
  "[",
1422
1437
  :IRIREF,
1423
1438
  :BLANK_NODE_LABEL,
@@ -1426,6 +1441,7 @@ module RDF::Turtle::Meta
1426
1441
  :PNAME_LN,
1427
1442
  :PNAME_NS],
1428
1443
  :subject => [
1444
+ "A",
1429
1445
  "a",
1430
1446
  :IRIREF,
1431
1447
  :PNAME_LN,
@@ -67,26 +67,26 @@ module RDF::Turtle
67
67
  end
68
68
 
69
69
  # String terminals
70
- terminal(nil, %r([\(\),.;\[\]a]|\^\^|@base|@prefix|true|false)) do |prod, token, input|
70
+ terminal(nil, %r([\(\),.;\[\]Aa]|\^\^|true|false)) do |prod, token, input|
71
71
  case token.value
72
- when 'a' then input[:resource] = RDF.type
72
+ when 'A', 'a' then input[:resource] = RDF.type
73
73
  when 'true', 'false' then input[:resource] = RDF::Literal::Boolean.new(token.value)
74
74
  when '@base', '@prefix' then input[:lang] = token.value[1..-1]
75
75
  else input[:string] = token.value
76
76
  end
77
77
  end
78
78
 
79
- terminal(:LANGTAG, LANGTAG) do |prod, token, input|
80
- input[:lang] = token.value[1..-1]
81
- end
82
-
83
- terminal(:SPARQL_PREFIX, SPARQL_PREFIX) do |prod, token, input|
79
+ terminal(:PREFIX, PREFIX) do |prod, token, input|
84
80
  input[:string_value] = token.value.downcase
85
81
  end
86
- terminal(:SPARQL_BASE, SPARQL_BASE) do |prod, token, input|
82
+ terminal(:BASE, BASE) do |prod, token, input|
87
83
  input[:string_value] = token.value.downcase
88
84
  end
89
85
 
86
+ terminal(:LANGTAG, LANGTAG) do |prod, token, input|
87
+ input[:lang] = token.value[1..-1]
88
+ end
89
+
90
90
  # Productions
91
91
  # [4] prefixID defines a prefix mapping
92
92
  production(:prefixID) do |input, current, callback|
@@ -103,21 +103,6 @@ module RDF::Turtle
103
103
  options[:base_uri] = iri
104
104
  end
105
105
 
106
- # [28s] sparqlPrefix ::= [Pp][Rr][Ee][Ff][Ii][Xx] PNAME_NS IRIREF
107
- production(:sparqlPrefix) do |input, current, callback|
108
- prefix = current[:prefix]
109
- iri = current[:resource]
110
- debug("sparqlPrefix") {"Defined prefix #{prefix.inspect} mapping to #{iri.inspect}"}
111
- prefix(prefix, iri)
112
- end
113
-
114
- # [29s] sparqlBase ::= [Bb][Aa][Ss][Ee] IRIREF
115
- production(:sparqlBase) do |input, current, callback|
116
- iri = current[:resource]
117
- debug("base") {"Defined base as #{iri}"}
118
- options[:base_uri] = iri
119
- end
120
-
121
106
  # [6] triples
122
107
  start_production(:triples) do |input, current, callback|
123
108
  # Note production as triples for blankNodePropertyList
@@ -176,20 +161,15 @@ module RDF::Turtle
176
161
 
177
162
  production(:collection) do |input, current, callback|
178
163
  # Create an RDF list
179
- bnode = self.bnode
180
164
  objects = current[:object_list]
181
- list = RDF::List.new(bnode, nil, objects)
165
+ list = RDF::List[*objects]
182
166
  list.each_statement do |statement|
183
- # Spec Confusion, referenced section "Collection" is missing from the spec.
184
- # Anicdodal evidence indicates that some expect each node to be of type rdf:list,
185
- # but existing Notation3 and Turtle tests (http://www.w3.org/2001/sw/DataAccess/df1/tests/manifest.ttl) do not.
186
167
  next if statement.predicate == RDF.type && statement.object == RDF.List
187
168
  callback.call(:statement, "collection", statement.subject, statement.predicate, statement.object)
188
169
  end
189
- bnode = RDF.nil if list.empty?
190
170
 
191
171
  # Return bnode as resource
192
- input[:resource] = bnode
172
+ input[:resource] = list.subject
193
173
  end
194
174
 
195
175
  # [16] RDFLiteral ::= String ( LanguageTag | ( "^^" IRIref ) )?
@@ -100,22 +100,22 @@ module RDF::Turtle
100
100
  # 21
101
101
  DOUBLE = /[+-]?(?:[0-9]+\.[0-9]*#{EXPONENT}|\.?[0-9]+#{EXPONENT})/.freeze
102
102
  # 22
103
- STRING_LITERAL_QUOTE = /'(?:[^\'\\\n\r]|#{ECHAR}|#{UCHAR})*'/.freeze
103
+ STRING_LITERAL_SINGLE_QUOTE = /'(?:[^\'\\\n\r]|#{ECHAR}|#{UCHAR})*'/.freeze
104
104
  # 23
105
- STRING_LITERAL_SINGLE_QUOTE = /"(?:[^\"\\\n\r]|#{ECHAR}|#{UCHAR})*"/.freeze.freeze
105
+ STRING_LITERAL_QUOTE = /"(?:[^\"\\\n\r]|#{ECHAR}|#{UCHAR})*"/.freeze.freeze
106
106
  # 24
107
107
  STRING_LITERAL_LONG_SINGLE_QUOTE = /'''(?:(?:'|'')?(?:[^'\\]|#{ECHAR}|#{UCHAR}))*'''/m.freeze
108
108
  # 25
109
- STRING_LITERAL_LONG_QUOTE = /"""(?:(?:"|"")?(?:[^"\\]|#{ECHAR}|#{UCHAR}))*"""/m.freeze
109
+ STRING_LITERAL_LONG_QUOTE = /"""(?:(?:"|"")?(?:[^"\\]|#{ECHAR}|#{UCHAR}))*"""/m.freeze
110
110
 
111
111
  # 161s
112
112
  WS = / |\t|\r|\n /.freeze
113
113
  # 162s
114
114
  ANON = /\[#{WS}*\]/m.freeze
115
115
  # 28t
116
- SPARQL_PREFIX = /prefix/i.freeze
116
+ PREFIX = /@?prefix/i.freeze
117
117
  # 29t
118
- SPARQL_BASE = /base/i.freeze
118
+ BASE = /@?base/i.freeze
119
119
 
120
120
  end
121
121
  end
metadata CHANGED
@@ -1,36 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-turtle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
5
- prerelease:
4
+ version: 1.0.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Gregg Kellogg
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-05-11 00:00:00.000000000 Z
11
+ date: 2013-06-16 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rdf
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
21
- version: '1.0'
19
+ version: 1.0.7
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
29
- version: '1.0'
26
+ version: 1.0.7
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: ebnf
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: open-uri-cached
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rspec
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rdf-isomorphic
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ! '>='
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ! '>='
92
81
  - !ruby/object:Gem::Version
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: json-ld
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ! '>='
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ! '>='
108
95
  - !ruby/object:Gem::Version
@@ -110,7 +97,6 @@ dependencies:
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: yard
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
101
  - - ! '>='
116
102
  - !ruby/object:Gem::Version
@@ -118,7 +104,6 @@ dependencies:
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
108
  - - ! '>='
124
109
  - !ruby/object:Gem::Version
@@ -126,7 +111,6 @@ dependencies:
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: rdf-spec
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
115
  - - ! '>='
132
116
  - !ruby/object:Gem::Version
@@ -134,7 +118,6 @@ dependencies:
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
122
  - - ! '>='
140
123
  - !ruby/object:Gem::Version
@@ -142,7 +125,6 @@ dependencies:
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: rake
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
129
  - - ! '>='
148
130
  - !ruby/object:Gem::Version
@@ -150,7 +132,6 @@ dependencies:
150
132
  type: :development
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
136
  - - ! '>='
156
137
  - !ruby/object:Gem::Version
@@ -177,30 +158,26 @@ files:
177
158
  homepage: http://ruby-rdf.github.com/rdf-turtle
178
159
  licenses:
179
160
  - Public Domain
161
+ metadata: {}
180
162
  post_install_message:
181
163
  rdoc_options: []
182
164
  require_paths:
183
165
  - lib
184
166
  required_ruby_version: !ruby/object:Gem::Requirement
185
- none: false
186
167
  requirements:
187
168
  - - ! '>='
188
169
  - !ruby/object:Gem::Version
189
170
  version: 1.8.1
190
171
  required_rubygems_version: !ruby/object:Gem::Requirement
191
- none: false
192
172
  requirements:
193
173
  - - ! '>='
194
174
  - !ruby/object:Gem::Version
195
175
  version: '0'
196
- segments:
197
- - 0
198
- hash: -221020975256303301
199
176
  requirements: []
200
177
  rubyforge_project: rdf-turtle
201
- rubygems_version: 1.8.25
178
+ rubygems_version: 2.0.3
202
179
  signing_key:
203
- specification_version: 3
180
+ specification_version: 4
204
181
  summary: Turtle reader/writer for Ruby.
205
182
  test_files: []
206
183
  has_rdoc: false