rdf-turtle 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History +4 -0
- data/README.markdown +2 -2
- data/VERSION +1 -1
- data/lib/rdf/ll1/lexer.rb +19 -4
- data/lib/rdf/ll1/parser.rb +126 -75
- data/lib/rdf/turtle.rb +0 -2
- data/lib/rdf/turtle/format.rb +3 -2
- data/lib/rdf/turtle/meta.rb +553 -126
- data/lib/rdf/turtle/reader.rb +26 -26
- data/lib/rdf/turtle/terminals.rb +20 -10
- data/lib/rdf/turtle/writer.rb +41 -36
- metadata +41 -19
- data/lib/rdf/turtle/patches.rb +0 -38
data/lib/rdf/turtle/reader.rb
CHANGED
@@ -96,7 +96,7 @@ module RDF::Turtle
|
|
96
96
|
next unless phase == :finish
|
97
97
|
prefix = current[:prefix]
|
98
98
|
iri = current[:resource]
|
99
|
-
callback.call(:trace, "prefixID", "Defined prefix #{prefix.inspect} mapping to #{iri.inspect}")
|
99
|
+
callback.call(:trace, "prefixID", lambda {"Defined prefix #{prefix.inspect} mapping to #{iri.inspect}"})
|
100
100
|
reader.prefix(prefix, iri)
|
101
101
|
end
|
102
102
|
|
@@ -104,19 +104,17 @@ module RDF::Turtle
|
|
104
104
|
production(:base) do |reader, phase, input, current, callback|
|
105
105
|
next unless phase == :finish
|
106
106
|
iri = current[:resource]
|
107
|
-
callback.call(:trace, "base", "Defined base as #{iri}")
|
107
|
+
callback.call(:trace, "base", lambda {"Defined base as #{iri}"})
|
108
108
|
reader.options[:base_uri] = iri
|
109
109
|
end
|
110
110
|
|
111
111
|
# [9] verb ::= predicate | "a"
|
112
112
|
production(:verb) do |reader, phase, input, current, callback|
|
113
|
-
next unless phase == :finish
|
114
113
|
input[:predicate] = current[:resource] if phase == :finish
|
115
114
|
end
|
116
115
|
|
117
116
|
# [10] subject ::= IRIref | blank
|
118
117
|
production(:subject) do |reader, phase, input, current, callback|
|
119
|
-
next unless phase == :finish
|
120
118
|
input[:subject] = current[:resource] if phase == :finish
|
121
119
|
end
|
122
120
|
|
@@ -127,7 +125,7 @@ module RDF::Turtle
|
|
127
125
|
# Part of an rdf:List collection
|
128
126
|
input[:object_list] << current[:resource]
|
129
127
|
else
|
130
|
-
callback.call(:trace, "object", "current: #{current.inspect}")
|
128
|
+
callback.call(:trace, "object", lambda {"current: #{current.inspect}"})
|
131
129
|
callback.call(:statement, "object", input[:subject], input[:predicate], current[:resource])
|
132
130
|
end
|
133
131
|
end
|
@@ -176,6 +174,10 @@ module RDF::Turtle
|
|
176
174
|
##
|
177
175
|
# Initializes a new reader instance.
|
178
176
|
#
|
177
|
+
# Note, the spec does not define a default mapping for the empty prefix,
|
178
|
+
# but it is so commonly used in examples that we define it to be the
|
179
|
+
# empty string anyway, except when validating.
|
180
|
+
#
|
179
181
|
# @param [String, #to_s] input
|
180
182
|
# @param [Hash{Symbol => Object}] options
|
181
183
|
# @option options [Hash] :prefixes (Hash.new)
|
@@ -199,6 +201,7 @@ module RDF::Turtle
|
|
199
201
|
def initialize(input = nil, options = {}, &block)
|
200
202
|
super do
|
201
203
|
@options = {:anon_base => "b0", :validate => false}.merge(options)
|
204
|
+
@options = {:prefixes => {nil => ""}}.merge(@options) unless @options[:validate]
|
202
205
|
|
203
206
|
debug("base IRI") {base_uri.inspect}
|
204
207
|
|
@@ -228,16 +231,21 @@ module RDF::Turtle
|
|
228
231
|
def each_statement(&block)
|
229
232
|
@callback = block
|
230
233
|
|
231
|
-
parse(@input, START.to_sym, @options.merge(:branch => BRANCH,
|
234
|
+
parse(@input, START.to_sym, @options.merge(:branch => BRANCH,
|
235
|
+
:first => FIRST,
|
236
|
+
:follow => FOLLOW)
|
237
|
+
) do |context, *data|
|
238
|
+
loc = data.shift
|
232
239
|
case context
|
233
240
|
when :statement
|
234
|
-
|
241
|
+
add_statement(loc, RDF::Statement.from(data))
|
235
242
|
when :trace
|
236
|
-
debug(*data)
|
243
|
+
debug(loc, *data)
|
237
244
|
end
|
238
245
|
end
|
239
246
|
rescue RDF::LL1::Parser::Error => e
|
240
|
-
|
247
|
+
debug("Parsing completed with errors:\n\t#{e.message}")
|
248
|
+
raise RDF::ReaderError, e.message if validate?
|
241
249
|
end
|
242
250
|
|
243
251
|
##
|
@@ -262,8 +270,7 @@ module RDF::Turtle
|
|
262
270
|
# @param [URI, Node, Literal] object:: the object of the statement
|
263
271
|
# @return [Statement]:: Added statement
|
264
272
|
# @raise [RDF::ReaderError]:: Checks parameter types and raises if they are incorrect if parsing mode is _validate_.
|
265
|
-
def
|
266
|
-
statement = RDF::Statement.new(subject, predicate, object)
|
273
|
+
def add_statement(node, statement)
|
267
274
|
if statement.valid?
|
268
275
|
debug(node) {"generate statement: #{statement}"}
|
269
276
|
@callback.call(statement)
|
@@ -334,28 +341,21 @@ module RDF::Turtle
|
|
334
341
|
@bnode_cache[value.to_s] ||= RDF::Node.new(value)
|
335
342
|
end
|
336
343
|
|
337
|
-
# @param [String] str Error string
|
338
|
-
# @param [Hash] options
|
339
|
-
# @option options [URI, #to_s] :production
|
340
|
-
# @option options [Token] :token
|
341
|
-
def error(node, message, options = {})
|
342
|
-
if !validate? && !options[:fatal]
|
343
|
-
debug(node, message, options)
|
344
|
-
else
|
345
|
-
raise RDF::ReaderError, message, options[:backtrace]
|
346
|
-
end
|
347
|
-
end
|
348
|
-
|
349
344
|
##
|
350
345
|
# Progress output when debugging
|
351
346
|
# @param [String] node relative location in input
|
352
347
|
# @param [String] message ("")
|
353
348
|
# @yieldreturn [String] added to message
|
354
|
-
def debug(
|
349
|
+
def debug(*args)
|
355
350
|
return unless @options[:debug] || RDF::Turtle.debug?
|
351
|
+
options = args.last.is_a?(Hash) ? args.pop : {}
|
356
352
|
depth = options[:depth] || self.depth
|
357
|
-
message
|
358
|
-
|
353
|
+
message = args.pop
|
354
|
+
message = message.call if message.is_a?(Proc)
|
355
|
+
args << message if message
|
356
|
+
args << yield if block_given?
|
357
|
+
message = "#{args.join(': ')}"
|
358
|
+
str = "[#{@lineno}]#{' ' * depth}#{message}"
|
359
359
|
@options[:debug] << str if @options[:debug].is_a?(Array)
|
360
360
|
$stderr.puts(str) if RDF::Turtle.debug?
|
361
361
|
end
|
data/lib/rdf/turtle/terminals.rb
CHANGED
@@ -14,6 +14,7 @@ module RDF::Turtle
|
|
14
14
|
[\\uF900-\\uFDCF]|[\\uFDF0-\\uFFFD]|[\\u{10000}-\\u{EFFFF}]
|
15
15
|
EOS
|
16
16
|
U_CHARS2 = Regexp.compile("\\u00B7|[\\u0300-\\u036F]|[\\u203F-\\u2040]")
|
17
|
+
IRI_RANGE = Regexp.compile("[[^<>\"{}|^`\\\\]&&[^\\x00-\\x20]]") # [^<>\"{}|^`\\] - [#x00-#x20]
|
17
18
|
else
|
18
19
|
##
|
19
20
|
# UTF-8 regular expressions for Ruby 1.8.x.
|
@@ -49,33 +50,42 @@ module RDF::Turtle
|
|
49
50
|
\\xCC[\\x80-\\xBF]|\\xCD[\\x80-\\xAF]| (?# [\\u0300-\\u036F]|)
|
50
51
|
\\xE2\\x80\\xBF|\\xE2\\x81\\x80 (?# [\\u203F-\\u2040])
|
51
52
|
EOS
|
53
|
+
IRI_RANGE = Regexp.compile(<<-EOS.gsub(/\s+/, ''))
|
54
|
+
\\x21| (?# ")
|
55
|
+
[\\x23-\\x3b]|\\x3d| (?# < & >)
|
56
|
+
[\\x3f-\\x5b]|\\x5d|\\x5f| (?# \ ^ `)
|
57
|
+
[\\x61-\\x7a]| (?# { } |)
|
58
|
+
[\\x7e-\\xff]
|
59
|
+
EOS
|
52
60
|
end
|
53
61
|
UCHAR = RDF::LL1::Lexer::UCHAR
|
54
62
|
|
55
63
|
WS = / |\t|\r|\n / # [93s]
|
64
|
+
PERCENT = /%[0-9A-Fa-f]{2}/ # [162s]
|
65
|
+
PN_LOCAL_ESC = /\\[_~\.\-\!$\&'\(\)\*\+,;=:\/\?\#@%]/ # [163s] # [163s]
|
66
|
+
PLX = /#{PERCENT}|#{PN_LOCAL_ESC}/ # [160s]
|
56
67
|
PN_CHARS_BASE = /[A-Z]|[a-z]|#{U_CHARS1}|#{UCHAR}/ # [95s]
|
57
68
|
PN_CHARS_U = /_|#{PN_CHARS_BASE}/ # [96s]
|
58
69
|
PN_CHARS = /-|[0-9]|#{PN_CHARS_U}|#{U_CHARS2}/ # [98s]
|
59
70
|
PN_CHARS_BODY = /(?:(?:\.|#{PN_CHARS})*#{PN_CHARS})?/
|
60
|
-
|
71
|
+
PN_LOCAL_BODY = /(?:(?:\.|#{PN_CHARS}|#{PLX})*(?:#{PN_CHARS}|#{PLX}))?/
|
72
|
+
PN_LOCAL = /(?:[0-9]|#{PN_CHARS_U}|#{PLX})#{PN_LOCAL_BODY}/ # [100s]
|
61
73
|
|
62
74
|
EXPONENT = /[eE][+-]?[0-9]+/ # [86s]
|
63
75
|
|
64
76
|
ANON = /\[#{WS}*\]/ # [94s]
|
65
77
|
BLANK_NODE_LABEL = /_:#{PN_LOCAL}/ # [73s]
|
66
|
-
DECIMAL = /(?:[0-9]+\.[0-9]
|
67
|
-
DECIMAL_NEGATIVE = /\-(?:[0-9]+\.[0-9]
|
68
|
-
DECIMAL_POSITIVE = /\+(?:[0-9]+\.[0-9]
|
69
|
-
DOUBLE = /(?:[0-9]+\.[0-9]
|
70
|
-
DOUBLE_NEGATIVE = /\-(?:[0-9]+\.[0-9]
|
71
|
-
DOUBLE_POSITIVE = /\+(?:[0-9]+\.[0-9]
|
78
|
+
DECIMAL = /(?:[0-9]+\.[0-9]+|\.[0-9]+)/ # [78s]
|
79
|
+
DECIMAL_NEGATIVE = /\-(?:[0-9]+\.[0-9]+|\.[0-9]+)/ # [83s]
|
80
|
+
DECIMAL_POSITIVE = /\+(?:[0-9]+\.[0-9]+|\.[0-9]+)/ # [81s]
|
81
|
+
DOUBLE = /(?:[0-9]+\.[0-9]+|\.[0-9]+|[0-9]+)#{EXPONENT}/ # [79s]
|
82
|
+
DOUBLE_NEGATIVE = /\-(?:[0-9]+\.[0-9]+|\.[0-9]+|[0-9]+)#{EXPONENT}/ # [79s]
|
83
|
+
DOUBLE_POSITIVE = /\+(?:[0-9]+\.[0-9]+|\.[0-9]+|[0-9]+)#{EXPONENT}/ # [79s]
|
72
84
|
ECHAR = /\\[tbnrf\\"']/ # [91s]
|
73
85
|
INTEGER = /[0-9]+/ # [77s]
|
74
86
|
INTEGER_NEGATIVE = /\-[0-9]+/ # [83s]
|
75
87
|
INTEGER_POSITIVE = /\+[0-9]+/ # [80s]
|
76
|
-
|
77
|
-
# provision for \^, as discussed elsewhere in the spec.
|
78
|
-
IRI_REF = /<(?:[^<>"{}|^`\\\x00-\x20]|#{U_CHARS1})*>/ # [70s]
|
88
|
+
IRI_REF = /<(?:#{IRI_RANGE}|#{UCHAR})*>/ # [70s]
|
79
89
|
LANGTAG = /@[a-zA-Z]+(?:-[a-zA-Z0-9]+)*/ # [76s]
|
80
90
|
PN_PREFIX = /#{PN_CHARS_BASE}#{PN_CHARS_BODY}/ # [99s]
|
81
91
|
PNAME_NS = /#{PN_PREFIX}?:/ # [71s]
|
data/lib/rdf/turtle/writer.rb
CHANGED
@@ -105,7 +105,7 @@ module RDF::Turtle
|
|
105
105
|
end
|
106
106
|
|
107
107
|
##
|
108
|
-
#
|
108
|
+
# Adds a statement to be serialized
|
109
109
|
# @param [RDF::Statement] statement
|
110
110
|
# @return [void]
|
111
111
|
def write_statement(statement)
|
@@ -113,7 +113,7 @@ module RDF::Turtle
|
|
113
113
|
end
|
114
114
|
|
115
115
|
##
|
116
|
-
#
|
116
|
+
# Adds a triple to be serialized
|
117
117
|
# @param [RDF::Resource] subject
|
118
118
|
# @param [RDF::URI] predicate
|
119
119
|
# @param [RDF::Value] object
|
@@ -135,7 +135,7 @@ module RDF::Turtle
|
|
135
135
|
|
136
136
|
self.reset
|
137
137
|
|
138
|
-
debug
|
138
|
+
debug("\nserialize") {"graph: #{@graph.size}"}
|
139
139
|
|
140
140
|
preprocess
|
141
141
|
start_document
|
@@ -166,14 +166,16 @@ module RDF::Turtle
|
|
166
166
|
when u = @uri_to_prefix.keys.detect {|u| uri.index(u.to_s) == 0}
|
167
167
|
# Use a defined prefix
|
168
168
|
prefix = @uri_to_prefix[u]
|
169
|
-
|
170
|
-
|
171
|
-
|
169
|
+
unless u.to_s.empty?
|
170
|
+
prefix(prefix, u) unless u.to_s.empty?
|
171
|
+
debug("get_pname") {"add prefix #{prefix.inspect} => #{u}"}
|
172
|
+
uri.sub(u.to_s, "#{prefix}:")
|
173
|
+
end
|
172
174
|
when @options[:standard_prefixes] && vocab = RDF::Vocabulary.each.to_a.detect {|v| uri.index(v.to_uri.to_s) == 0}
|
173
175
|
prefix = vocab.__name__.to_s.split('::').last.downcase
|
174
176
|
@uri_to_prefix[vocab.to_uri.to_s] = prefix
|
175
177
|
prefix(prefix, vocab.to_uri) # Define for output
|
176
|
-
debug {"
|
178
|
+
debug("get_pname") {"add standard prefix #{prefix.inspect} => #{vocab.to_uri}"}
|
177
179
|
uri.sub(vocab.to_uri.to_s, "#{prefix}:")
|
178
180
|
else
|
179
181
|
nil
|
@@ -208,7 +210,7 @@ module RDF::Turtle
|
|
208
210
|
prop_list << prop.to_s
|
209
211
|
end
|
210
212
|
|
211
|
-
debug
|
213
|
+
debug("sort_properties") {prop_list.join(', ')}
|
212
214
|
prop_list
|
213
215
|
end
|
214
216
|
|
@@ -246,7 +248,7 @@ module RDF::Turtle
|
|
246
248
|
# @return [String]
|
247
249
|
def format_uri(uri, options = {})
|
248
250
|
md = relativize(uri)
|
249
|
-
debug {"
|
251
|
+
debug("relativize") {"#{uri.inspect} => #{md.inspect}"} if md != uri.to_s
|
250
252
|
md != uri.to_s ? "<#{md}>" : (get_pname(uri) || "<#{uri}>")
|
251
253
|
end
|
252
254
|
|
@@ -263,11 +265,9 @@ module RDF::Turtle
|
|
263
265
|
protected
|
264
266
|
# Output @base and @prefix definitions
|
265
267
|
def start_document
|
266
|
-
@started = true
|
267
|
-
|
268
268
|
@output.write("#{indent}@base <#{base_uri}> .\n") unless base_uri.to_s.empty?
|
269
269
|
|
270
|
-
debug
|
270
|
+
debug("start_document") {prefixes.inspect}
|
271
271
|
prefixes.keys.sort_by(&:to_s).each do |prefix|
|
272
272
|
@output.write("#{indent}@prefix #{prefix}: <#{prefixes[prefix]}> .\n")
|
273
273
|
end
|
@@ -307,7 +307,7 @@ module RDF::Turtle
|
|
307
307
|
# Add distinguished classes
|
308
308
|
top_classes.each do |class_uri|
|
309
309
|
graph.query(:predicate => RDF.type, :object => class_uri).map {|st| st.subject}.sort.uniq.each do |subject|
|
310
|
-
debug
|
310
|
+
debug("order_subjects") {subject.inspect}
|
311
311
|
subjects << subject
|
312
312
|
seen[subject] = true
|
313
313
|
end
|
@@ -339,7 +339,7 @@ module RDF::Turtle
|
|
339
339
|
# prefixes.
|
340
340
|
# @param [Statement] statement
|
341
341
|
def preprocess_statement(statement)
|
342
|
-
#debug
|
342
|
+
#debug("preprocess") {statement.inspect}
|
343
343
|
references = ref_count(statement.object) + 1
|
344
344
|
@references[statement.object] = references
|
345
345
|
@subjects[statement.subject] = true
|
@@ -370,12 +370,9 @@ module RDF::Turtle
|
|
370
370
|
def reset
|
371
371
|
@depth = 0
|
372
372
|
@lists = {}
|
373
|
-
@namespaces = {}
|
374
373
|
@references = {}
|
375
374
|
@serialized = {}
|
376
375
|
@subjects = {}
|
377
|
-
@shortNames = {}
|
378
|
-
@started = false
|
379
376
|
end
|
380
377
|
|
381
378
|
##
|
@@ -392,28 +389,36 @@ module RDF::Turtle
|
|
392
389
|
end
|
393
390
|
end
|
394
391
|
|
395
|
-
|
392
|
+
protected
|
396
393
|
|
397
394
|
##
|
398
395
|
# Add debug event to debug array, if specified
|
399
396
|
# @param [String] message ("")
|
400
397
|
# @yieldreturn [String] added to message
|
401
|
-
def debug(
|
398
|
+
def debug(*args)
|
402
399
|
return unless @options[:debug] || RDF::Turtle.debug?
|
403
|
-
|
400
|
+
options = args.last.is_a?(Hash) ? args.pop : {}
|
401
|
+
depth = options[:depth] || @depth
|
402
|
+
message = args.pop
|
403
|
+
message = message.call if message.is_a?(Proc)
|
404
|
+
args << message if message
|
405
|
+
args << yield if block_given?
|
406
|
+
message = "#{args.join(': ')}"
|
404
407
|
@options[:debug] << message if @options[:debug].is_a?(Array)
|
405
408
|
$stderr.puts(message) if RDF::Turtle.debug?
|
406
409
|
end
|
407
410
|
|
411
|
+
private
|
412
|
+
|
408
413
|
# Checks if l is a valid RDF list, i.e. no nodes have other properties.
|
409
|
-
def is_valid_list(l)
|
410
|
-
#debug
|
414
|
+
def is_valid_list?(l)
|
415
|
+
#debug("is_valid_list?") {l.inspect}
|
411
416
|
return RDF::List.new(l, @graph).valid?
|
412
417
|
end
|
413
418
|
|
414
419
|
def do_list(l)
|
415
420
|
list = RDF::List.new(l, @graph)
|
416
|
-
debug
|
421
|
+
debug("do_list") {list.inspect}
|
417
422
|
position = :subject
|
418
423
|
list.each_statement do |st|
|
419
424
|
next unless st.predicate == RDF.first
|
@@ -425,8 +430,8 @@ module RDF::Turtle
|
|
425
430
|
end
|
426
431
|
|
427
432
|
def p_list(node, position)
|
428
|
-
return false if !is_valid_list(node)
|
429
|
-
#debug {"
|
433
|
+
return false if !is_valid_list?(node)
|
434
|
+
#debug("p_list") {"#{node.inspect}, #{position}"}
|
430
435
|
|
431
436
|
@output.write(position == :subject ? "(" : " (")
|
432
437
|
@depth += 2
|
@@ -444,7 +449,7 @@ module RDF::Turtle
|
|
444
449
|
def p_squared(node, position)
|
445
450
|
return false unless p_squared?(node, position)
|
446
451
|
|
447
|
-
#debug {"
|
452
|
+
#debug("p_squared") {"#{node.inspect}, #{position}"}
|
448
453
|
subject_done(node)
|
449
454
|
@output.write(position == :subject ? '[' : ' [')
|
450
455
|
@depth += 2
|
@@ -456,16 +461,16 @@ module RDF::Turtle
|
|
456
461
|
end
|
457
462
|
|
458
463
|
def p_default(node, position)
|
459
|
-
#debug {"
|
464
|
+
#debug("p_default") {"#{node.inspect}, #{position}"}
|
460
465
|
l = (position == :subject ? "" : " ") + format_value(node)
|
461
466
|
@output.write(l)
|
462
467
|
end
|
463
468
|
|
464
469
|
def path(node, position)
|
465
|
-
debug do
|
466
|
-
"
|
470
|
+
debug("path") do
|
471
|
+
"#{node.inspect}, " +
|
467
472
|
"pos: #{position}, " +
|
468
|
-
"[]: #{is_valid_list(node)}, " +
|
473
|
+
"[]: #{is_valid_list?(node)}, " +
|
469
474
|
"p2?: #{p_squared?(node, position)}, " +
|
470
475
|
"rc: #{ref_count(node)}"
|
471
476
|
end
|
@@ -473,7 +478,7 @@ module RDF::Turtle
|
|
473
478
|
end
|
474
479
|
|
475
480
|
def verb(node)
|
476
|
-
debug
|
481
|
+
debug("verb") {node.inspect}
|
477
482
|
if node == RDF.type
|
478
483
|
@output.write(" a")
|
479
484
|
else
|
@@ -482,7 +487,7 @@ module RDF::Turtle
|
|
482
487
|
end
|
483
488
|
|
484
489
|
def object_list(objects)
|
485
|
-
debug
|
490
|
+
debug("object_list") {objects.inspect}
|
486
491
|
return if objects.empty?
|
487
492
|
|
488
493
|
objects.each_with_index do |obj, i|
|
@@ -499,7 +504,7 @@ module RDF::Turtle
|
|
499
504
|
end
|
500
505
|
|
501
506
|
prop_list = sort_properties(properties) - [RDF.first.to_s, RDF.rest.to_s]
|
502
|
-
debug
|
507
|
+
debug("predicate_list") {prop_list.inspect}
|
503
508
|
return if prop_list.empty?
|
504
509
|
|
505
510
|
prop_list.each_with_index do |prop, i|
|
@@ -515,13 +520,13 @@ module RDF::Turtle
|
|
515
520
|
end
|
516
521
|
|
517
522
|
def s_squared?(subject)
|
518
|
-
ref_count(subject) == 0 && subject.is_a?(RDF::Node) && !is_valid_list(subject)
|
523
|
+
ref_count(subject) == 0 && subject.is_a?(RDF::Node) && !is_valid_list?(subject)
|
519
524
|
end
|
520
525
|
|
521
526
|
def s_squared(subject)
|
522
527
|
return false unless s_squared?(subject)
|
523
528
|
|
524
|
-
debug
|
529
|
+
debug("s_squared") {subject.inspect}
|
525
530
|
@output.write("\n#{indent} [")
|
526
531
|
@depth += 1
|
527
532
|
predicate_list(subject)
|
@@ -539,7 +544,7 @@ module RDF::Turtle
|
|
539
544
|
end
|
540
545
|
|
541
546
|
def statement(subject)
|
542
|
-
debug {"
|
547
|
+
debug("statement") {"#{subject.inspect}, s2?: #{s_squared?(subject)}"}
|
543
548
|
subject_done(subject)
|
544
549
|
s_squared(subject) || s_default(subject)
|
545
550
|
@output.puts
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-turtle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-12-22 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rdf
|
16
|
-
requirement: &
|
16
|
+
requirement: &2166587480 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,21 +21,32 @@ dependencies:
|
|
21
21
|
version: 0.3.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2166587480
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
27
|
-
requirement: &
|
26
|
+
name: open-uri-cached
|
27
|
+
requirement: &2166586740 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.
|
32
|
+
version: 0.0.4
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2166586740
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: spira
|
38
|
+
requirement: &2166586000 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 0.0.12
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *2166586000
|
36
47
|
- !ruby/object:Gem::Dependency
|
37
48
|
name: rspec
|
38
|
-
requirement: &
|
49
|
+
requirement: &2166585320 !ruby/object:Gem::Requirement
|
39
50
|
none: false
|
40
51
|
requirements:
|
41
52
|
- - ! '>='
|
@@ -43,10 +54,21 @@ dependencies:
|
|
43
54
|
version: 2.5.0
|
44
55
|
type: :development
|
45
56
|
prerelease: false
|
46
|
-
version_requirements: *
|
57
|
+
version_requirements: *2166585320
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: rdf-isomorphic
|
60
|
+
requirement: &2166584640 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 0.3.4
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *2166584640
|
47
69
|
- !ruby/object:Gem::Dependency
|
48
70
|
name: rdf-n3
|
49
|
-
requirement: &
|
71
|
+
requirement: &2166577480 !ruby/object:Gem::Requirement
|
50
72
|
none: false
|
51
73
|
requirements:
|
52
74
|
- - ! '>='
|
@@ -54,10 +76,10 @@ dependencies:
|
|
54
76
|
version: 0.3.5
|
55
77
|
type: :development
|
56
78
|
prerelease: false
|
57
|
-
version_requirements: *
|
79
|
+
version_requirements: *2166577480
|
58
80
|
- !ruby/object:Gem::Dependency
|
59
81
|
name: rdf-spec
|
60
|
-
requirement: &
|
82
|
+
requirement: &2166576800 !ruby/object:Gem::Requirement
|
61
83
|
none: false
|
62
84
|
requirements:
|
63
85
|
- - ! '>='
|
@@ -65,18 +87,18 @@ dependencies:
|
|
65
87
|
version: 0.3.4
|
66
88
|
type: :development
|
67
89
|
prerelease: false
|
68
|
-
version_requirements: *
|
90
|
+
version_requirements: *2166576800
|
69
91
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
71
|
-
requirement: &
|
92
|
+
name: yard
|
93
|
+
requirement: &2166576000 !ruby/object:Gem::Requirement
|
72
94
|
none: false
|
73
95
|
requirements:
|
74
96
|
- - ! '>='
|
75
97
|
- !ruby/object:Gem::Version
|
76
|
-
version: 0.
|
98
|
+
version: 0.6.0
|
77
99
|
type: :development
|
78
100
|
prerelease: false
|
79
|
-
version_requirements: *
|
101
|
+
version_requirements: *2166576000
|
80
102
|
description: RDF::Turtle is an Turtle reader/writer for the RDF.rb library suite.
|
81
103
|
email: public-rdf-ruby@w3.org
|
82
104
|
executables: []
|
@@ -93,7 +115,6 @@ files:
|
|
93
115
|
- lib/rdf/ll1/scanner.rb
|
94
116
|
- lib/rdf/turtle/format.rb
|
95
117
|
- lib/rdf/turtle/meta.rb
|
96
|
-
- lib/rdf/turtle/patches.rb
|
97
118
|
- lib/rdf/turtle/reader.rb
|
98
119
|
- lib/rdf/turtle/terminals.rb
|
99
120
|
- lib/rdf/turtle/version.rb
|
@@ -125,3 +146,4 @@ signing_key:
|
|
125
146
|
specification_version: 3
|
126
147
|
summary: Turtle reader/writer for Ruby.
|
127
148
|
test_files: []
|
149
|
+
has_rdoc: false
|