rdf-trig 1.0.0.beta1 → 1.0.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/{README.markdown → README.md} +0 -0
- data/VERSION +1 -1
- data/lib/rdf/trig.rb +0 -2
- data/lib/rdf/trig/meta.rb +1291 -1366
- data/lib/rdf/trig/reader.rb +14 -15
- metadata +137 -186
data/lib/rdf/trig/reader.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require 'rdf/trig/meta'
|
2
1
|
require 'rdf/turtle'
|
2
|
+
require 'rdf/trig/meta'
|
3
3
|
|
4
4
|
module RDF::TriG
|
5
5
|
##
|
@@ -11,32 +11,31 @@ module RDF::TriG
|
|
11
11
|
include RDF::TriG::Meta
|
12
12
|
|
13
13
|
# String terminals
|
14
|
-
terminal(nil, %r([\{\}\(\),.;\[\]a]|\^\^|@base|@prefix|true|false)) do |
|
14
|
+
terminal(nil, %r([\{\}\(\),.;\[\]a]|\^\^|@base|@prefix|true|false)) do |prod, token, input|
|
15
15
|
case token.value
|
16
|
-
when 'a'
|
17
|
-
when 'true', 'false'
|
18
|
-
|
16
|
+
when 'a' then input[:resource] = RDF.type
|
17
|
+
when 'true', 'false' then input[:resource] = RDF::Literal::Boolean.new(token.value)
|
18
|
+
when '@base', '@prefix' then input[:lang] = token.value[1..-1]
|
19
|
+
else input[:string] = token.value
|
19
20
|
end
|
20
21
|
end
|
21
|
-
terminal(:LANGTAG, LANGTAG) do |reader, prod, token, input|
|
22
|
-
input[:lang] = token.value[1..-1]
|
23
|
-
end
|
24
22
|
|
25
23
|
# Productions
|
26
24
|
# [3g] graph defines the basic creation of context
|
27
|
-
|
25
|
+
start_production(:graph) do |input, current, callback|
|
26
|
+
callback.call(:context, "graph", nil)
|
27
|
+
end
|
28
|
+
production(:graph) do |input, current, callback|
|
28
29
|
callback.call(:context, "graph", nil)
|
29
30
|
end
|
30
31
|
|
31
32
|
# [4g] graphIri
|
32
33
|
# Normally, just returns the IRIref, but if called from [3g], also
|
33
34
|
# sets the context for triples defined within that graph
|
34
|
-
production(:graphIri) do |
|
35
|
+
production(:graphIri) do |input, current, callback|
|
35
36
|
# If input contains set_graph_iri, use the returned value to set @context
|
36
|
-
|
37
|
-
|
38
|
-
callback.call(:context, "graphIri", current[:resource])
|
39
|
-
end
|
37
|
+
debug("graphIri") {"Set graph context to #{current[:resource]}"}
|
38
|
+
callback.call(:context, "graphIri", current[:resource])
|
40
39
|
end
|
41
40
|
|
42
41
|
##
|
@@ -64,7 +63,7 @@ module RDF::TriG
|
|
64
63
|
debug(loc, *data)
|
65
64
|
end
|
66
65
|
end
|
67
|
-
rescue
|
66
|
+
rescue EBNF::LL1::Parser::Error => e
|
68
67
|
debug("Parsing completed with errors:\n\t#{e.message}")
|
69
68
|
raise RDF::ReaderError, e.message if validate?
|
70
69
|
end
|
metadata
CHANGED
@@ -1,198 +1,163 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-trig
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease: 6
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 0
|
10
|
-
- beta
|
11
|
-
- 1
|
12
|
-
version: 1.0.0.beta1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0.beta3
|
13
5
|
platform: ruby
|
14
|
-
authors:
|
6
|
+
authors:
|
15
7
|
- Gregg Kellogg
|
16
8
|
autorequire:
|
17
9
|
bindir: bin
|
18
10
|
cert_chain: []
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2013-03-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
23
14
|
name: rdf
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
24
21
|
prerelease: false
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ebnf
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.2.0
|
35
34
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: rdf-turtle
|
39
35
|
prerelease: false
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.2.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rdf-turtle
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.0'
|
50
48
|
type: :runtime
|
51
|
-
version_requirements: *id002
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
|
-
name: open-uri-cached
|
54
49
|
prerelease: false
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: open-uri-cached
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
65
61
|
version: 0.0.5
|
66
62
|
type: :development
|
67
|
-
version_requirements: *id003
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
name: json-ld
|
70
63
|
prerelease: false
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.0.5
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: json-ld
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
80
76
|
type: :development
|
81
|
-
version_requirements: *id004
|
82
|
-
- !ruby/object:Gem::Dependency
|
83
|
-
name: rdf-n3
|
84
77
|
prerelease: false
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
segments:
|
92
|
-
- 0
|
93
|
-
version: "0"
|
94
|
-
type: :development
|
95
|
-
version_requirements: *id005
|
96
|
-
- !ruby/object:Gem::Dependency
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
97
84
|
name: rspec
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
- - ">="
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
hash: 63
|
105
|
-
segments:
|
106
|
-
- 2
|
107
|
-
- 12
|
108
|
-
- 0
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
109
89
|
version: 2.12.0
|
110
90
|
type: :development
|
111
|
-
version_requirements: *id006
|
112
|
-
- !ruby/object:Gem::Dependency
|
113
|
-
name: rdf-isomorphic
|
114
91
|
prerelease: false
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 2.12.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rdf-isomorphic
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
124
104
|
type: :development
|
125
|
-
version_requirements: *id007
|
126
|
-
- !ruby/object:Gem::Dependency
|
127
|
-
name: yard
|
128
105
|
prerelease: false
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: yard
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
139
117
|
version: 0.8.3
|
140
118
|
type: :development
|
141
|
-
version_requirements: *id008
|
142
|
-
- !ruby/object:Gem::Dependency
|
143
|
-
name: sxp
|
144
119
|
prerelease: false
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
segments:
|
152
|
-
- 0
|
153
|
-
version: "0"
|
154
|
-
type: :development
|
155
|
-
version_requirements: *id009
|
156
|
-
- !ruby/object:Gem::Dependency
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.8.3
|
125
|
+
- !ruby/object:Gem::Dependency
|
157
126
|
name: rdf-spec
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
- !ruby/object:Gem::Version
|
164
|
-
hash: 15
|
165
|
-
segments:
|
166
|
-
- 1
|
167
|
-
- 0
|
168
|
-
version: "1.0"
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ! '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '1.0'
|
169
132
|
type: :development
|
170
|
-
version_requirements: *id010
|
171
|
-
- !ruby/object:Gem::Dependency
|
172
|
-
name: rake
|
173
133
|
prerelease: false
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ! '>='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '1.0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rake
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ! '>='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
183
146
|
type: :development
|
184
|
-
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ! '>='
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
185
153
|
description: RDF::TriG is an TriG reader/writer for the RDF.rb library suite.
|
186
154
|
email: public-rdf-ruby@w3.org
|
187
155
|
executables: []
|
188
|
-
|
189
156
|
extensions: []
|
190
|
-
|
191
157
|
extra_rdoc_files: []
|
192
|
-
|
193
|
-
files:
|
158
|
+
files:
|
194
159
|
- AUTHORS
|
195
|
-
- README.
|
160
|
+
- README.md
|
196
161
|
- History
|
197
162
|
- UNLICENSE
|
198
163
|
- VERSION
|
@@ -203,42 +168,28 @@ files:
|
|
203
168
|
- lib/rdf/trig/writer.rb
|
204
169
|
- lib/rdf/trig.rb
|
205
170
|
homepage: http://github.com/ruby-rdf/rdf-trig
|
206
|
-
licenses:
|
171
|
+
licenses:
|
207
172
|
- Public Domain
|
173
|
+
metadata: {}
|
208
174
|
post_install_message:
|
209
175
|
rdoc_options: []
|
210
|
-
|
211
|
-
require_paths:
|
176
|
+
require_paths:
|
212
177
|
- lib
|
213
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
- !ruby/object:Gem::Version
|
218
|
-
hash: 53
|
219
|
-
segments:
|
220
|
-
- 1
|
221
|
-
- 8
|
222
|
-
- 1
|
178
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
179
|
+
requirements:
|
180
|
+
- - ! '>='
|
181
|
+
- !ruby/object:Gem::Version
|
223
182
|
version: 1.8.1
|
224
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
- !ruby/object:Gem::Version
|
229
|
-
hash: 25
|
230
|
-
segments:
|
231
|
-
- 1
|
232
|
-
- 3
|
233
|
-
- 1
|
183
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ! '>'
|
186
|
+
- !ruby/object:Gem::Version
|
234
187
|
version: 1.3.1
|
235
188
|
requirements: []
|
236
|
-
|
237
189
|
rubyforge_project: rdf-trig
|
238
|
-
rubygems_version:
|
190
|
+
rubygems_version: 2.0.3
|
239
191
|
signing_key:
|
240
|
-
specification_version:
|
192
|
+
specification_version: 4
|
241
193
|
summary: TriG reader/writer for Ruby.
|
242
194
|
test_files: []
|
243
|
-
|
244
195
|
has_rdoc: false
|