rdf-turtle 0.3.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +2 -2
- data/VERSION +1 -1
- data/lib/ebnf.rb +14 -5
- data/lib/rdf/ll1/lexer.rb +4 -2
- data/lib/rdf/ll1/parser.rb +2 -1
- data/lib/rdf/ll1/scanner.rb +2 -1
- data/lib/rdf/turtle/meta.rb +132 -175
- data/lib/rdf/turtle/reader.rb +5 -5
- data/lib/rdf/turtle/terminals.rb +9 -11
- metadata +152 -142
data/README.markdown
CHANGED
@@ -11,7 +11,7 @@ Install with `gem install rdf-turtle`
|
|
11
11
|
|
12
12
|
* 100% free and unencumbered [public domain](http://unlicense.org/) software.
|
13
13
|
* Implements a complete parser for [Turtle][].
|
14
|
-
* Compatible with Ruby 1.8.7+, Ruby 1.9.x, and JRuby 1.
|
14
|
+
* Compatible with Ruby 1.8.7+, Ruby 1.9.x, and JRuby 1.7+.
|
15
15
|
|
16
16
|
## Usage
|
17
17
|
Instantiate a reader from a local file:
|
@@ -74,7 +74,7 @@ Future releases will replace the need for cym using Ruby-native graph inference.
|
|
74
74
|
## Dependencies
|
75
75
|
|
76
76
|
* [Ruby](http://ruby-lang.org/) (>= 1.8.7) or (>= 1.8.1 with [Backports][])
|
77
|
-
* [RDF.rb](http://rubygems.org/gems/rdf) (>= 0
|
77
|
+
* [RDF.rb](http://rubygems.org/gems/rdf) (>= 1.0)
|
78
78
|
|
79
79
|
## Installation
|
80
80
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
1.0.0
|
data/lib/ebnf.rb
CHANGED
@@ -98,15 +98,24 @@ require 'strscan'
|
|
98
98
|
# @author Gregg Kellogg
|
99
99
|
class EBNF
|
100
100
|
class Rule
|
101
|
-
#
|
101
|
+
# @!attribute [r] sym for rule
|
102
|
+
# @return [Symbol]
|
102
103
|
attr_reader :sym
|
103
|
-
|
104
|
+
|
105
|
+
# @!attribute [r] id of rule
|
106
|
+
# @return [String]
|
104
107
|
attr_reader :id
|
105
|
-
|
108
|
+
|
109
|
+
# @!attribute [r] kind of rule
|
110
|
+
# @return [:rule, :token, or :pass]
|
106
111
|
attr_accessor :kind
|
107
|
-
|
112
|
+
|
113
|
+
# @!attribute [r] expr rule expression
|
114
|
+
# @return [Array]
|
108
115
|
attr_reader :expr
|
109
|
-
|
116
|
+
|
117
|
+
# @!attribute [r] orig original rule
|
118
|
+
# @return [String]
|
110
119
|
attr_accessor :orig
|
111
120
|
|
112
121
|
# @param [Integer] id
|
data/lib/rdf/ll1/lexer.rb
CHANGED
@@ -53,11 +53,13 @@ module RDF::LL1
|
|
53
53
|
ML_START = /\'\'\'|\"\"\"/ # Beginning of terminals that may span lines
|
54
54
|
|
55
55
|
##
|
56
|
-
#
|
56
|
+
# @!attribute whitespace
|
57
|
+
# @return [Regexp] defines whitespace, defaults to WS
|
57
58
|
attr_reader :whitespace
|
58
59
|
|
59
60
|
##
|
60
|
-
#
|
61
|
+
# @!attribute comment
|
62
|
+
# @return [Regexp] defines single-line comment, defaults to COMMENT
|
61
63
|
attr_reader :comment
|
62
64
|
|
63
65
|
##
|
data/lib/rdf/ll1/parser.rb
CHANGED
data/lib/rdf/ll1/scanner.rb
CHANGED
data/lib/rdf/turtle/meta.rb
CHANGED
@@ -12,7 +12,7 @@ module RDF::Turtle::Meta
|
|
12
12
|
:PNAME_NS => [:predicateObjectList],
|
13
13
|
},
|
14
14
|
:"_:_g1" => {
|
15
|
-
";" => [:"_:
|
15
|
+
";" => [:"_:g70106313082060"],
|
16
16
|
:"ebnf:empty" => [],
|
17
17
|
},
|
18
18
|
:"_:_g2" => {
|
@@ -34,7 +34,7 @@ module RDF::Turtle::Meta
|
|
34
34
|
:PNAME_NS => [:verb, :objectList],
|
35
35
|
},
|
36
36
|
:"_:_g5" => {
|
37
|
-
"," => [:"_:
|
37
|
+
"," => [:"_:g70106311924700"],
|
38
38
|
";" => [],
|
39
39
|
:"ebnf:empty" => [],
|
40
40
|
},
|
@@ -42,23 +42,23 @@ module RDF::Turtle::Meta
|
|
42
42
|
"," => [",", :object],
|
43
43
|
},
|
44
44
|
:"_:_g7" => {
|
45
|
-
"(" => [:"_:
|
46
|
-
"[" => [:"_:
|
47
|
-
"false" => [:"_:
|
45
|
+
"(" => [:"_:g70106311405120"],
|
46
|
+
"[" => [:"_:g70106311405120"],
|
47
|
+
"false" => [:"_:g70106311405120"],
|
48
48
|
:"ebnf:empty" => [],
|
49
|
-
:ANON => [:"_:
|
50
|
-
:BLANK_NODE_LABEL => [:"_:
|
51
|
-
:DECIMAL => [:"_:
|
52
|
-
:DOUBLE => [:"_:
|
53
|
-
:INTEGER => [:"_:
|
54
|
-
:IRIREF => [:"_:
|
55
|
-
:PNAME_LN => [:"_:
|
56
|
-
:PNAME_NS => [:"_:
|
57
|
-
:STRING_LITERAL_LONG_QUOTE => [:"_:
|
58
|
-
:STRING_LITERAL_LONG_SINGLE_QUOTE => [:"_:
|
59
|
-
:STRING_LITERAL_QUOTE => [:"_:
|
60
|
-
:STRING_LITERAL_SINGLE_QUOTE => [:"_:
|
61
|
-
"true" => [:"_:
|
49
|
+
:ANON => [:"_:g70106311405120"],
|
50
|
+
:BLANK_NODE_LABEL => [:"_:g70106311405120"],
|
51
|
+
:DECIMAL => [:"_:g70106311405120"],
|
52
|
+
:DOUBLE => [:"_:g70106311405120"],
|
53
|
+
:INTEGER => [:"_:g70106311405120"],
|
54
|
+
:IRIREF => [:"_:g70106311405120"],
|
55
|
+
:PNAME_LN => [:"_:g70106311405120"],
|
56
|
+
:PNAME_NS => [:"_:g70106311405120"],
|
57
|
+
:STRING_LITERAL_LONG_QUOTE => [:"_:g70106311405120"],
|
58
|
+
:STRING_LITERAL_LONG_SINGLE_QUOTE => [:"_:g70106311405120"],
|
59
|
+
:STRING_LITERAL_QUOTE => [:"_:g70106311405120"],
|
60
|
+
:STRING_LITERAL_SINGLE_QUOTE => [:"_:g70106311405120"],
|
61
|
+
"true" => [:"_:g70106311405120"],
|
62
62
|
},
|
63
63
|
:"_:_g8" => {
|
64
64
|
"(" => [],
|
@@ -86,7 +86,7 @@ module RDF::Turtle::Meta
|
|
86
86
|
"(" => [],
|
87
87
|
"," => [],
|
88
88
|
"[" => [],
|
89
|
-
"^^" => [:"_:
|
89
|
+
"^^" => [:"_:g70106312390580"],
|
90
90
|
"false" => [],
|
91
91
|
:ANON => [],
|
92
92
|
:BLANK_NODE_LABEL => [],
|
@@ -103,21 +103,7 @@ module RDF::Turtle::Meta
|
|
103
103
|
:STRING_LITERAL_SINGLE_QUOTE => [],
|
104
104
|
"true" => [],
|
105
105
|
},
|
106
|
-
:"_:
|
107
|
-
"[" => [:blankNodePropertyList, :"_:_g0"],
|
108
|
-
},
|
109
|
-
:"_:g70259508693960" => {
|
110
|
-
"(" => [:subject, :predicateObjectList],
|
111
|
-
:ANON => [:subject, :predicateObjectList],
|
112
|
-
:BLANK_NODE_LABEL => [:subject, :predicateObjectList],
|
113
|
-
:IRIREF => [:subject, :predicateObjectList],
|
114
|
-
:PNAME_LN => [:subject, :predicateObjectList],
|
115
|
-
:PNAME_NS => [:subject, :predicateObjectList],
|
116
|
-
},
|
117
|
-
:"_:g70259508899400" => {
|
118
|
-
";" => [:"_:_g2", :"_:_g1"],
|
119
|
-
},
|
120
|
-
:"_:g70259509658260" => {
|
106
|
+
:"_:g70106311405120" => {
|
121
107
|
"(" => [:object, :"_:_g7"],
|
122
108
|
"[" => [:object, :"_:_g7"],
|
123
109
|
"false" => [:object, :"_:_g7"],
|
@@ -135,7 +121,7 @@ module RDF::Turtle::Meta
|
|
135
121
|
:STRING_LITERAL_SINGLE_QUOTE => [:object, :"_:_g7"],
|
136
122
|
"true" => [:object, :"_:_g7"],
|
137
123
|
},
|
138
|
-
:"_:
|
124
|
+
:"_:g70106311764020" => {
|
139
125
|
"(" => [:triples, "."],
|
140
126
|
"@base" => [],
|
141
127
|
"@prefix" => [],
|
@@ -148,11 +134,11 @@ module RDF::Turtle::Meta
|
|
148
134
|
:SPARQL_BASE => [],
|
149
135
|
:SPARQL_PREFIX => [],
|
150
136
|
},
|
151
|
-
:"_:
|
137
|
+
:"_:g70106311924700" => {
|
152
138
|
"," => [:"_:_g6", :"_:_g5"],
|
153
139
|
";" => [],
|
154
140
|
},
|
155
|
-
:"_:
|
141
|
+
:"_:g70106312390580" => {
|
156
142
|
"(" => [],
|
157
143
|
"," => [],
|
158
144
|
"[" => [],
|
@@ -172,7 +158,7 @@ module RDF::Turtle::Meta
|
|
172
158
|
:STRING_LITERAL_SINGLE_QUOTE => [],
|
173
159
|
"true" => [],
|
174
160
|
},
|
175
|
-
:"_:
|
161
|
+
:"_:g70106312474340" => {
|
176
162
|
"(" => [:statement, :turtleDoc],
|
177
163
|
"@base" => [:statement, :turtleDoc],
|
178
164
|
"@prefix" => [:statement, :turtleDoc],
|
@@ -186,6 +172,20 @@ module RDF::Turtle::Meta
|
|
186
172
|
:SPARQL_BASE => [:statement, :turtleDoc],
|
187
173
|
:SPARQL_PREFIX => [:statement, :turtleDoc],
|
188
174
|
},
|
175
|
+
:"_:g70106312865040" => {
|
176
|
+
"[" => [:blankNodePropertyList, :"_:_g0"],
|
177
|
+
},
|
178
|
+
:"_:g70106312954760" => {
|
179
|
+
"(" => [:subject, :predicateObjectList],
|
180
|
+
:ANON => [:subject, :predicateObjectList],
|
181
|
+
:BLANK_NODE_LABEL => [:subject, :predicateObjectList],
|
182
|
+
:IRIREF => [:subject, :predicateObjectList],
|
183
|
+
:PNAME_LN => [:subject, :predicateObjectList],
|
184
|
+
:PNAME_NS => [:subject, :predicateObjectList],
|
185
|
+
},
|
186
|
+
:"_:g70106313082060" => {
|
187
|
+
";" => [:"_:_g2", :"_:_g1"],
|
188
|
+
},
|
189
189
|
:BlankNode => {
|
190
190
|
"(" => [],
|
191
191
|
"," => [],
|
@@ -304,26 +304,6 @@ module RDF::Turtle::Meta
|
|
304
304
|
:SPARQL_BASE => [],
|
305
305
|
:SPARQL_PREFIX => [],
|
306
306
|
},
|
307
|
-
:blank => {
|
308
|
-
"(" => [:collection],
|
309
|
-
"," => [],
|
310
|
-
"[" => [],
|
311
|
-
"a" => [],
|
312
|
-
"false" => [],
|
313
|
-
:ANON => [:BlankNode],
|
314
|
-
:BLANK_NODE_LABEL => [:BlankNode],
|
315
|
-
:DECIMAL => [],
|
316
|
-
:DOUBLE => [],
|
317
|
-
:INTEGER => [],
|
318
|
-
:IRIREF => [],
|
319
|
-
:PNAME_LN => [],
|
320
|
-
:PNAME_NS => [],
|
321
|
-
:STRING_LITERAL_LONG_QUOTE => [],
|
322
|
-
:STRING_LITERAL_LONG_SINGLE_QUOTE => [],
|
323
|
-
:STRING_LITERAL_QUOTE => [],
|
324
|
-
:STRING_LITERAL_SINGLE_QUOTE => [],
|
325
|
-
"true" => [],
|
326
|
-
},
|
327
307
|
:blankNodePropertyList => {
|
328
308
|
"(" => [],
|
329
309
|
"," => [],
|
@@ -417,12 +397,12 @@ module RDF::Turtle::Meta
|
|
417
397
|
"true" => [:BooleanLiteral],
|
418
398
|
},
|
419
399
|
:object => {
|
420
|
-
"(" => [:
|
400
|
+
"(" => [:collection],
|
421
401
|
"," => [],
|
422
402
|
"[" => [:blankNodePropertyList],
|
423
403
|
"false" => [:literal],
|
424
|
-
:ANON => [:
|
425
|
-
:BLANK_NODE_LABEL => [:
|
404
|
+
:ANON => [:BlankNode],
|
405
|
+
:BLANK_NODE_LABEL => [:BlankNode],
|
426
406
|
:DECIMAL => [:literal],
|
427
407
|
:DOUBLE => [:literal],
|
428
408
|
:INTEGER => [:literal],
|
@@ -518,50 +498,50 @@ module RDF::Turtle::Meta
|
|
518
498
|
:SPARQL_PREFIX => [:SPARQL_PREFIX, :PNAME_NS, :IRIREF],
|
519
499
|
},
|
520
500
|
:statement => {
|
521
|
-
"(" => [:"_:
|
501
|
+
"(" => [:"_:g70106311764020"],
|
522
502
|
"@base" => [:directive],
|
523
503
|
"@prefix" => [:directive],
|
524
|
-
"[" => [:"_:
|
525
|
-
:ANON => [:"_:
|
526
|
-
:BLANK_NODE_LABEL => [:"_:
|
527
|
-
:IRIREF => [:"_:
|
528
|
-
:PNAME_LN => [:"_:
|
529
|
-
:PNAME_NS => [:"_:
|
504
|
+
"[" => [:"_:g70106311764020"],
|
505
|
+
:ANON => [:"_:g70106311764020"],
|
506
|
+
:BLANK_NODE_LABEL => [:"_:g70106311764020"],
|
507
|
+
:IRIREF => [:"_:g70106311764020"],
|
508
|
+
:PNAME_LN => [:"_:g70106311764020"],
|
509
|
+
:PNAME_NS => [:"_:g70106311764020"],
|
530
510
|
:SPARQL_BASE => [:directive],
|
531
511
|
:SPARQL_PREFIX => [:directive],
|
532
512
|
},
|
533
513
|
:subject => {
|
534
|
-
"(" => [:
|
514
|
+
"(" => [:collection],
|
535
515
|
"a" => [],
|
536
|
-
:ANON => [:
|
537
|
-
:BLANK_NODE_LABEL => [:
|
516
|
+
:ANON => [:BlankNode],
|
517
|
+
:BLANK_NODE_LABEL => [:BlankNode],
|
538
518
|
:IRIREF => [:iri],
|
539
519
|
:PNAME_LN => [:iri],
|
540
520
|
:PNAME_NS => [:iri],
|
541
521
|
},
|
542
522
|
:triples => {
|
543
|
-
"(" => [:"_:
|
544
|
-
"[" => [:"_:
|
545
|
-
:ANON => [:"_:
|
546
|
-
:BLANK_NODE_LABEL => [:"_:
|
547
|
-
:IRIREF => [:"_:
|
548
|
-
:PNAME_LN => [:"_:
|
549
|
-
:PNAME_NS => [:"_:
|
523
|
+
"(" => [:"_:g70106312954760"],
|
524
|
+
"[" => [:"_:g70106312865040"],
|
525
|
+
:ANON => [:"_:g70106312954760"],
|
526
|
+
:BLANK_NODE_LABEL => [:"_:g70106312954760"],
|
527
|
+
:IRIREF => [:"_:g70106312954760"],
|
528
|
+
:PNAME_LN => [:"_:g70106312954760"],
|
529
|
+
:PNAME_NS => [:"_:g70106312954760"],
|
550
530
|
},
|
551
531
|
:turtleDoc => {
|
552
|
-
"(" => [:"_:
|
553
|
-
"@base" => [:"_:
|
554
|
-
"@prefix" => [:"_:
|
555
|
-
"[" => [:"_:
|
532
|
+
"(" => [:"_:g70106312474340"],
|
533
|
+
"@base" => [:"_:g70106312474340"],
|
534
|
+
"@prefix" => [:"_:g70106312474340"],
|
535
|
+
"[" => [:"_:g70106312474340"],
|
556
536
|
:"ebnf:empty" => [],
|
557
537
|
:"ebnf:eof" => [],
|
558
|
-
:ANON => [:"_:
|
559
|
-
:BLANK_NODE_LABEL => [:"_:
|
560
|
-
:IRIREF => [:"_:
|
561
|
-
:PNAME_LN => [:"_:
|
562
|
-
:PNAME_NS => [:"_:
|
563
|
-
:SPARQL_BASE => [:"_:
|
564
|
-
:SPARQL_PREFIX => [:"_:
|
538
|
+
:ANON => [:"_:g70106312474340"],
|
539
|
+
:BLANK_NODE_LABEL => [:"_:g70106312474340"],
|
540
|
+
:IRIREF => [:"_:g70106312474340"],
|
541
|
+
:PNAME_LN => [:"_:g70106312474340"],
|
542
|
+
:PNAME_NS => [:"_:g70106312474340"],
|
543
|
+
:SPARQL_BASE => [:"_:g70106312474340"],
|
544
|
+
:SPARQL_PREFIX => [:"_:g70106312474340"],
|
565
545
|
},
|
566
546
|
:verb => {
|
567
547
|
"(" => [],
|
@@ -660,34 +640,7 @@ module RDF::Turtle::Meta
|
|
660
640
|
:"_:_g9" => [
|
661
641
|
"^^",
|
662
642
|
:LANGTAG],
|
663
|
-
:"_:
|
664
|
-
"["],
|
665
|
-
:"_:g70259508546080" => [
|
666
|
-
";"],
|
667
|
-
:"_:g70259508693960" => [
|
668
|
-
"(",
|
669
|
-
:ANON,
|
670
|
-
:BLANK_NODE_LABEL,
|
671
|
-
:IRIREF,
|
672
|
-
:PNAME_LN,
|
673
|
-
:PNAME_NS],
|
674
|
-
:"_:g70259508899400" => [
|
675
|
-
";"],
|
676
|
-
:"_:g70259509060380" => [
|
677
|
-
"(",
|
678
|
-
"@base",
|
679
|
-
"@prefix",
|
680
|
-
"[",
|
681
|
-
:ANON,
|
682
|
-
:BLANK_NODE_LABEL,
|
683
|
-
:IRIREF,
|
684
|
-
:PNAME_LN,
|
685
|
-
:PNAME_NS,
|
686
|
-
:SPARQL_BASE,
|
687
|
-
:SPARQL_PREFIX],
|
688
|
-
:"_:g70259509587660" => [
|
689
|
-
","],
|
690
|
-
:"_:g70259509658260" => [
|
643
|
+
:"_:g70106306670700" => [
|
691
644
|
"(",
|
692
645
|
"[",
|
693
646
|
"false",
|
@@ -704,12 +657,12 @@ module RDF::Turtle::Meta
|
|
704
657
|
:STRING_LITERAL_LONG_SINGLE_QUOTE,
|
705
658
|
:STRING_LITERAL_QUOTE,
|
706
659
|
:STRING_LITERAL_SINGLE_QUOTE],
|
707
|
-
:"_:
|
660
|
+
:"_:g70106306750360" => [
|
708
661
|
"a",
|
709
662
|
:IRIREF,
|
710
663
|
:PNAME_LN,
|
711
664
|
:PNAME_NS],
|
712
|
-
:"_:
|
665
|
+
:"_:g70106311405120" => [
|
713
666
|
"(",
|
714
667
|
"[",
|
715
668
|
"false",
|
@@ -726,15 +679,14 @@ module RDF::Turtle::Meta
|
|
726
679
|
:STRING_LITERAL_LONG_SINGLE_QUOTE,
|
727
680
|
:STRING_LITERAL_QUOTE,
|
728
681
|
:STRING_LITERAL_SINGLE_QUOTE],
|
729
|
-
:"_:
|
682
|
+
:"_:g70106311473420" => [
|
730
683
|
"a",
|
731
684
|
:IRIREF,
|
732
685
|
:PNAME_LN,
|
733
686
|
:PNAME_NS],
|
734
|
-
:"_:
|
735
|
-
"
|
736
|
-
|
737
|
-
:"_:g70259511991280" => [
|
687
|
+
:"_:g70106311617580" => [
|
688
|
+
","],
|
689
|
+
:"_:g70106311648220" => [
|
738
690
|
"(",
|
739
691
|
"[",
|
740
692
|
"false",
|
@@ -751,28 +703,34 @@ module RDF::Turtle::Meta
|
|
751
703
|
:STRING_LITERAL_LONG_SINGLE_QUOTE,
|
752
704
|
:STRING_LITERAL_QUOTE,
|
753
705
|
:STRING_LITERAL_SINGLE_QUOTE],
|
754
|
-
:"_:
|
706
|
+
:"_:g70106311701340" => [
|
707
|
+
";"],
|
708
|
+
:"_:g70106311764020" => [
|
709
|
+
"(",
|
710
|
+
"[",
|
711
|
+
:ANON,
|
712
|
+
:BLANK_NODE_LABEL,
|
755
713
|
:IRIREF,
|
756
714
|
:PNAME_LN,
|
757
715
|
:PNAME_NS],
|
758
|
-
:"_:
|
716
|
+
:"_:g70106311788540" => [
|
759
717
|
"(",
|
718
|
+
"@base",
|
719
|
+
"@prefix",
|
760
720
|
"[",
|
761
721
|
:ANON,
|
762
722
|
:BLANK_NODE_LABEL,
|
763
723
|
:IRIREF,
|
764
724
|
:PNAME_LN,
|
765
|
-
:PNAME_NS
|
766
|
-
|
725
|
+
:PNAME_NS,
|
726
|
+
:SPARQL_BASE,
|
727
|
+
:SPARQL_PREFIX],
|
728
|
+
:"_:g70106311845200" => [
|
767
729
|
"a",
|
768
730
|
:IRIREF,
|
769
731
|
:PNAME_LN,
|
770
732
|
:PNAME_NS],
|
771
|
-
:"_:
|
772
|
-
","],
|
773
|
-
:"_:g70259512303120" => [
|
774
|
-
"^^"],
|
775
|
-
:"_:g70259512433500" => [
|
733
|
+
:"_:g70106311892240" => [
|
776
734
|
"(",
|
777
735
|
"[",
|
778
736
|
"false",
|
@@ -789,19 +747,9 @@ module RDF::Turtle::Meta
|
|
789
747
|
:STRING_LITERAL_LONG_SINGLE_QUOTE,
|
790
748
|
:STRING_LITERAL_QUOTE,
|
791
749
|
:STRING_LITERAL_SINGLE_QUOTE],
|
792
|
-
:"_:
|
793
|
-
"
|
794
|
-
|
795
|
-
"@prefix",
|
796
|
-
"[",
|
797
|
-
:ANON,
|
798
|
-
:BLANK_NODE_LABEL,
|
799
|
-
:IRIREF,
|
800
|
-
:PNAME_LN,
|
801
|
-
:PNAME_NS,
|
802
|
-
:SPARQL_BASE,
|
803
|
-
:SPARQL_PREFIX],
|
804
|
-
:"_:g70259512530480" => [
|
750
|
+
:"_:g70106311924700" => [
|
751
|
+
","],
|
752
|
+
:"_:g70106312383740" => [
|
805
753
|
"(",
|
806
754
|
"[",
|
807
755
|
"false",
|
@@ -818,12 +766,35 @@ module RDF::Turtle::Meta
|
|
818
766
|
:STRING_LITERAL_LONG_SINGLE_QUOTE,
|
819
767
|
:STRING_LITERAL_QUOTE,
|
820
768
|
:STRING_LITERAL_SINGLE_QUOTE],
|
821
|
-
:"_:
|
769
|
+
:"_:g70106312390580" => [
|
770
|
+
"^^"],
|
771
|
+
:"_:g70106312474340" => [
|
772
|
+
"(",
|
773
|
+
"@base",
|
774
|
+
"@prefix",
|
775
|
+
"[",
|
776
|
+
:ANON,
|
777
|
+
:BLANK_NODE_LABEL,
|
778
|
+
:IRIREF,
|
779
|
+
:PNAME_LN,
|
780
|
+
:PNAME_NS,
|
781
|
+
:SPARQL_BASE,
|
782
|
+
:SPARQL_PREFIX],
|
783
|
+
:"_:g70106312854060" => [
|
822
784
|
"a",
|
823
785
|
:IRIREF,
|
824
786
|
:PNAME_LN,
|
825
787
|
:PNAME_NS],
|
826
|
-
:"_:
|
788
|
+
:"_:g70106312865040" => [
|
789
|
+
"["],
|
790
|
+
:"_:g70106312954760" => [
|
791
|
+
"(",
|
792
|
+
:ANON,
|
793
|
+
:BLANK_NODE_LABEL,
|
794
|
+
:IRIREF,
|
795
|
+
:PNAME_LN,
|
796
|
+
:PNAME_NS],
|
797
|
+
:"_:g70106312957380" => [
|
827
798
|
"(",
|
828
799
|
"[",
|
829
800
|
"false",
|
@@ -840,6 +811,15 @@ module RDF::Turtle::Meta
|
|
840
811
|
:STRING_LITERAL_LONG_SINGLE_QUOTE,
|
841
812
|
:STRING_LITERAL_QUOTE,
|
842
813
|
:STRING_LITERAL_SINGLE_QUOTE],
|
814
|
+
:"_:g70106313082060" => [
|
815
|
+
";"],
|
816
|
+
:"_:g70106313147300" => [
|
817
|
+
:IRIREF,
|
818
|
+
:PNAME_LN,
|
819
|
+
:PNAME_NS],
|
820
|
+
:"_:g70106313218100" => [
|
821
|
+
"^^",
|
822
|
+
:LANGTAG],
|
843
823
|
:BlankNode => [
|
844
824
|
:ANON,
|
845
825
|
:BLANK_NODE_LABEL],
|
@@ -865,10 +845,6 @@ module RDF::Turtle::Meta
|
|
865
845
|
:STRING_LITERAL_SINGLE_QUOTE],
|
866
846
|
:base => [
|
867
847
|
"@base"],
|
868
|
-
:blank => [
|
869
|
-
"(",
|
870
|
-
:ANON,
|
871
|
-
:BLANK_NODE_LABEL],
|
872
848
|
:blankNodePropertyList => [
|
873
849
|
"["],
|
874
850
|
:collection => [
|
@@ -1045,7 +1021,7 @@ module RDF::Turtle::Meta
|
|
1045
1021
|
:STRING_LITERAL_LONG_SINGLE_QUOTE,
|
1046
1022
|
:STRING_LITERAL_QUOTE,
|
1047
1023
|
:STRING_LITERAL_SINGLE_QUOTE],
|
1048
|
-
:"_:
|
1024
|
+
:"_:g70106311764020" => [
|
1049
1025
|
"(",
|
1050
1026
|
"@base",
|
1051
1027
|
"@prefix",
|
@@ -1057,9 +1033,9 @@ module RDF::Turtle::Meta
|
|
1057
1033
|
:PNAME_NS,
|
1058
1034
|
:SPARQL_BASE,
|
1059
1035
|
:SPARQL_PREFIX],
|
1060
|
-
:"_:
|
1036
|
+
:"_:g70106311924700" => [
|
1061
1037
|
";"],
|
1062
|
-
:"_:
|
1038
|
+
:"_:g70106312390580" => [
|
1063
1039
|
"(",
|
1064
1040
|
",",
|
1065
1041
|
"[",
|
@@ -1077,7 +1053,7 @@ module RDF::Turtle::Meta
|
|
1077
1053
|
:STRING_LITERAL_LONG_SINGLE_QUOTE,
|
1078
1054
|
:STRING_LITERAL_QUOTE,
|
1079
1055
|
:STRING_LITERAL_SINGLE_QUOTE],
|
1080
|
-
:"_:
|
1056
|
+
:"_:g70106312474340" => [
|
1081
1057
|
:"ebnf:eof"],
|
1082
1058
|
"a" => [
|
1083
1059
|
"(",
|
@@ -1424,25 +1400,6 @@ module RDF::Turtle::Meta
|
|
1424
1400
|
:PNAME_NS,
|
1425
1401
|
:SPARQL_BASE,
|
1426
1402
|
:SPARQL_PREFIX],
|
1427
|
-
:blank => [
|
1428
|
-
"(",
|
1429
|
-
",",
|
1430
|
-
"[",
|
1431
|
-
"a",
|
1432
|
-
"false",
|
1433
|
-
"true",
|
1434
|
-
:ANON,
|
1435
|
-
:BLANK_NODE_LABEL,
|
1436
|
-
:DECIMAL,
|
1437
|
-
:DOUBLE,
|
1438
|
-
:INTEGER,
|
1439
|
-
:IRIREF,
|
1440
|
-
:PNAME_LN,
|
1441
|
-
:PNAME_NS,
|
1442
|
-
:STRING_LITERAL_LONG_QUOTE,
|
1443
|
-
:STRING_LITERAL_LONG_SINGLE_QUOTE,
|
1444
|
-
:STRING_LITERAL_QUOTE,
|
1445
|
-
:STRING_LITERAL_SINGLE_QUOTE],
|
1446
1403
|
:blankNodePropertyList => [
|
1447
1404
|
"(",
|
1448
1405
|
",",
|
data/lib/rdf/turtle/reader.rb
CHANGED
@@ -139,13 +139,13 @@ module RDF::Turtle
|
|
139
139
|
input[:predicate] = current[:resource] if phase == :finish
|
140
140
|
end
|
141
141
|
|
142
|
-
# [10] subject ::= IRIref |
|
142
|
+
# [10] subject ::= IRIref | BlankNode | collection
|
143
143
|
production(:subject) do |reader, phase, input, current, callback|
|
144
144
|
current[:triples] = nil if phase == :start
|
145
145
|
input[:subject] = current[:resource] if phase == :finish
|
146
146
|
end
|
147
147
|
|
148
|
-
# [12] object ::= iri |
|
148
|
+
# [12] object ::= iri | BlankNode | collection | blankNodePropertyList | literal
|
149
149
|
production(:object) do |reader, phase, input, current, callback|
|
150
150
|
next unless phase == :finish
|
151
151
|
if input[:object_list]
|
@@ -157,7 +157,7 @@ module RDF::Turtle
|
|
157
157
|
end
|
158
158
|
end
|
159
159
|
|
160
|
-
# [
|
160
|
+
# [14] blankNodePropertyList ::= "[" predicateObjectList "]"
|
161
161
|
production(:blankNodePropertyList) do |reader, phase, input, current, callback|
|
162
162
|
if phase == :start
|
163
163
|
current[:subject] = reader.bnode
|
@@ -168,7 +168,7 @@ module RDF::Turtle
|
|
168
168
|
end
|
169
169
|
end
|
170
170
|
|
171
|
-
# [
|
171
|
+
# [15] collection ::= "(" object* ")"
|
172
172
|
production(:collection) do |reader, phase, input, current, callback|
|
173
173
|
if phase == :start
|
174
174
|
current[:object_list] = [] # Tells the object production to collect and not generate statements
|
@@ -191,7 +191,7 @@ module RDF::Turtle
|
|
191
191
|
end
|
192
192
|
end
|
193
193
|
|
194
|
-
# [
|
194
|
+
# [16] RDFLiteral ::= String ( LanguageTag | ( "^^" IRIref ) )?
|
195
195
|
production(:RDFLiteral) do |reader, phase, input, current, callback|
|
196
196
|
next unless phase == :finish
|
197
197
|
opts = {}
|
data/lib/rdf/turtle/terminals.rb
CHANGED
@@ -59,7 +59,7 @@ module RDF::Turtle
|
|
59
59
|
EOS
|
60
60
|
end
|
61
61
|
|
62
|
-
#
|
62
|
+
# 26
|
63
63
|
UCHAR = RDF::LL1::Lexer::UCHAR
|
64
64
|
# 170s
|
65
65
|
PERCENT = /%[0-9A-Fa-f]{2}/
|
@@ -83,7 +83,7 @@ module RDF::Turtle
|
|
83
83
|
EXPONENT = /[eE][+-]?[0-9]+/
|
84
84
|
# 159s
|
85
85
|
ECHAR = /\\[tbnrf\\"']/
|
86
|
-
#
|
86
|
+
# 18
|
87
87
|
IRIREF = /<(?:#{IRI_RANGE}|#{UCHAR})*>/
|
88
88
|
# 139s
|
89
89
|
PNAME_NS = /#{PN_PREFIX}?:/
|
@@ -93,25 +93,23 @@ module RDF::Turtle
|
|
93
93
|
BLANK_NODE_LABEL = /_:(?:[0-9]|#{PN_CHARS_U})(#{PN_CHARS}|\.)*/
|
94
94
|
# 144s
|
95
95
|
LANGTAG = /@[a-zA-Z]+(?:-[a-zA-Z0-9]+)*/
|
96
|
-
#
|
96
|
+
# 19
|
97
97
|
INTEGER = /[+-]?[0-9]+/
|
98
|
-
#
|
98
|
+
# 20
|
99
99
|
DECIMAL = /[+-]?(?:[0-9]*\.[0-9]+)/
|
100
|
-
#
|
100
|
+
# 21
|
101
101
|
DOUBLE = /[+-]?(?:[0-9]+\.[0-9]*#{EXPONENT}|\.?[0-9]+#{EXPONENT})/
|
102
|
-
#
|
102
|
+
# 22
|
103
103
|
STRING_LITERAL_QUOTE = /'(?:[^\'\\\n\r]|#{ECHAR}|#{UCHAR})*'/
|
104
|
-
#
|
104
|
+
# 23
|
105
105
|
STRING_LITERAL_SINGLE_QUOTE = /"(?:[^\"\\\n\r]|#{ECHAR}|#{UCHAR})*"/
|
106
|
-
#
|
106
|
+
# 24
|
107
107
|
STRING_LITERAL_LONG_SINGLE_QUOTE = /'''(?:(?:'|'')?(?:[^'\\]|#{ECHAR}|#{UCHAR}))*'''/m
|
108
|
-
#
|
108
|
+
# 25
|
109
109
|
STRING_LITERAL_LONG_QUOTE = /"""(?:(?:"|"")?(?:[^"\\]|#{ECHAR}|#{UCHAR}))*"""/m
|
110
110
|
|
111
111
|
# 161s
|
112
112
|
WS = / |\t|\r|\n /
|
113
|
-
# 160s
|
114
|
-
NIL = /\(#{WS}*\)/
|
115
113
|
# 162s
|
116
114
|
ANON = /\[#{WS}*\]/
|
117
115
|
# 28t
|
metadata
CHANGED
@@ -1,166 +1,165 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-turtle
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Gregg Kellogg
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2013-01-19 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: rdf
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 0.3.11
|
22
|
-
type: :runtime
|
23
22
|
prerelease: false
|
24
|
-
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 15
|
29
|
+
segments:
|
30
|
+
- 1
|
31
|
+
- 0
|
32
|
+
version: "1.0"
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
31
36
|
name: open-uri-cached
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: 0.0.4
|
38
|
-
type: :development
|
39
37
|
prerelease: false
|
40
|
-
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: 2.12.0
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 21
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
- 0
|
47
|
+
- 5
|
48
|
+
version: 0.0.5
|
54
49
|
type: :development
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: rspec
|
55
53
|
prerelease: false
|
56
|
-
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- -
|
60
|
-
- !ruby/object:Gem::Version
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 63
|
60
|
+
segments:
|
61
|
+
- 2
|
62
|
+
- 12
|
63
|
+
- 0
|
61
64
|
version: 2.12.0
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: rdf-isomorphic
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ! '>='
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: 0.3.4
|
70
65
|
type: :development
|
66
|
+
version_requirements: *id003
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: rdf-isomorphic
|
71
69
|
prerelease: false
|
72
|
-
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- -
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
none: false
|
82
|
-
requirements:
|
83
|
-
- - ! '>='
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: 0.3.1
|
70
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
hash: 3
|
76
|
+
segments:
|
77
|
+
- 0
|
78
|
+
version: "0"
|
86
79
|
type: :development
|
80
|
+
version_requirements: *id004
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: json-ld
|
87
83
|
prerelease: false
|
88
|
-
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- -
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
none: false
|
98
|
-
requirements:
|
99
|
-
- - ! '>='
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: 0.8.3
|
84
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
hash: 3
|
90
|
+
segments:
|
91
|
+
- 0
|
92
|
+
version: "0"
|
102
93
|
type: :development
|
94
|
+
version_requirements: *id005
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: yard
|
103
97
|
prerelease: false
|
104
|
-
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- -
|
108
|
-
- !ruby/object:Gem::Version
|
98
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
hash: 57
|
104
|
+
segments:
|
105
|
+
- 0
|
106
|
+
- 8
|
107
|
+
- 3
|
109
108
|
version: 0.8.3
|
110
|
-
- !ruby/object:Gem::Dependency
|
111
|
-
name: sxp
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
|
-
requirements:
|
115
|
-
- - ! '>='
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: 0.0.14
|
118
109
|
type: :development
|
110
|
+
version_requirements: *id006
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: sxp
|
119
113
|
prerelease: false
|
120
|
-
|
121
|
-
none: false
|
122
|
-
requirements:
|
123
|
-
- -
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
none: false
|
130
|
-
requirements:
|
131
|
-
- - ! '>='
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
version: 0.3.1
|
114
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
hash: 3
|
120
|
+
segments:
|
121
|
+
- 0
|
122
|
+
version: "0"
|
134
123
|
type: :development
|
124
|
+
version_requirements: *id007
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rdf-spec
|
135
127
|
prerelease: false
|
136
|
-
|
137
|
-
none: false
|
138
|
-
requirements:
|
139
|
-
- -
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
requirements:
|
147
|
-
- - ! '>='
|
148
|
-
- !ruby/object:Gem::Version
|
149
|
-
version: '0'
|
128
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
hash: 15
|
134
|
+
segments:
|
135
|
+
- 1
|
136
|
+
- 0
|
137
|
+
version: "1.0"
|
150
138
|
type: :development
|
139
|
+
version_requirements: *id008
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: rake
|
151
142
|
prerelease: false
|
152
|
-
|
153
|
-
none: false
|
154
|
-
requirements:
|
155
|
-
- -
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
|
143
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
144
|
+
none: false
|
145
|
+
requirements:
|
146
|
+
- - ">="
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
hash: 3
|
149
|
+
segments:
|
150
|
+
- 0
|
151
|
+
version: "0"
|
152
|
+
type: :development
|
153
|
+
version_requirements: *id009
|
158
154
|
description: RDF::Turtle is an Turtle reader/writer for the RDF.rb library suite.
|
159
155
|
email: public-rdf-ruby@w3.org
|
160
156
|
executables: []
|
157
|
+
|
161
158
|
extensions: []
|
159
|
+
|
162
160
|
extra_rdoc_files: []
|
163
|
-
|
161
|
+
|
162
|
+
files:
|
164
163
|
- AUTHORS
|
165
164
|
- README.markdown
|
166
165
|
- History
|
@@ -178,29 +177,40 @@ files:
|
|
178
177
|
- lib/rdf/turtle/writer.rb
|
179
178
|
- lib/rdf/turtle.rb
|
180
179
|
homepage: http://github.com/ruby-rdf/rdf-turtle
|
181
|
-
licenses:
|
180
|
+
licenses:
|
182
181
|
- Public Domain
|
183
182
|
post_install_message:
|
184
183
|
rdoc_options: []
|
185
|
-
|
184
|
+
|
185
|
+
require_paths:
|
186
186
|
- lib
|
187
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
187
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
188
188
|
none: false
|
189
|
-
requirements:
|
190
|
-
- -
|
191
|
-
- !ruby/object:Gem::Version
|
189
|
+
requirements:
|
190
|
+
- - ">="
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
hash: 53
|
193
|
+
segments:
|
194
|
+
- 1
|
195
|
+
- 8
|
196
|
+
- 1
|
192
197
|
version: 1.8.1
|
193
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
194
199
|
none: false
|
195
|
-
requirements:
|
196
|
-
- -
|
197
|
-
- !ruby/object:Gem::Version
|
198
|
-
|
200
|
+
requirements:
|
201
|
+
- - ">="
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
hash: 3
|
204
|
+
segments:
|
205
|
+
- 0
|
206
|
+
version: "0"
|
199
207
|
requirements: []
|
208
|
+
|
200
209
|
rubyforge_project: rdf-turtle
|
201
210
|
rubygems_version: 1.8.24
|
202
211
|
signing_key:
|
203
212
|
specification_version: 3
|
204
213
|
summary: Turtle reader/writer for Ruby.
|
205
214
|
test_files: []
|
215
|
+
|
206
216
|
has_rdoc: false
|