rdf 1.1.0.1 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/rdf/nquads.rb +1 -1
- data/lib/rdf/ntriples/reader.rb +3 -3
- data/lib/rdf/reader.rb +30 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 103746563b943a055874ff834ecb5dfc5f2799af
|
4
|
+
data.tar.gz: 2041f3080c55e3d276912dd02572642f796687c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c144b4120b8762714fd9aed3a832378238bf3fcb70067f3a5d236ad9e2e3ed3343ef12a9841ff8774d9b3e23fddf924ce49168cecdf5fae8e40e73fcc9634365
|
7
|
+
data.tar.gz: 76a75cb6ea42718f3eac37080c7aebf46ab5d256330d7650a61f38b5464175e70a06307bad4db100f56258f8188c3ce369d877df43bfc99e528c08a1e7eacfe8
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.1
|
data/lib/rdf/nquads.rb
CHANGED
@@ -83,7 +83,7 @@ module RDF
|
|
83
83
|
object = read_uriref || read_node || read_literal || fail_object
|
84
84
|
context = read_uriref || read_node
|
85
85
|
if validate? && !read_eos
|
86
|
-
raise RDF::ReaderError
|
86
|
+
raise RDF::ReaderError.new("ERROR [line #{lineno}] Expected end of statement (found: #{current_line.inspect})")
|
87
87
|
end
|
88
88
|
return [subject, predicate, object, {:context => context}]
|
89
89
|
end
|
data/lib/rdf/ntriples/reader.rb
CHANGED
@@ -212,7 +212,8 @@ module RDF::NTriples
|
|
212
212
|
object = read_uriref || read_node || read_literal || fail_object
|
213
213
|
|
214
214
|
if validate? && !read_eos
|
215
|
-
raise RDF::ReaderError
|
215
|
+
raise RDF::ReaderError.new("ERROR [line #{lineno}] Expected end of statement (found: #{current_line.inspect})",
|
216
|
+
lineno: lineno)
|
216
217
|
end
|
217
218
|
return [subject, predicate, object]
|
218
219
|
end
|
@@ -238,12 +239,11 @@ module RDF::NTriples
|
|
238
239
|
uri_str = self.class.unescape(uri_str)
|
239
240
|
uri = RDF::URI.send(intern? && options[:intern] ? :intern : :new, uri_str)
|
240
241
|
uri.validate! if validate?
|
241
|
-
raise RDF::ReaderError, "uri not absolute" if validate? && !uri.absolute?
|
242
242
|
uri.canonicalize! if canonicalize?
|
243
243
|
uri
|
244
244
|
end
|
245
245
|
rescue ArgumentError => e
|
246
|
-
raise RDF::ReaderError
|
246
|
+
raise RDF::ReaderError.new("ERROR [line #{lineno}] Invalid URI (found: \"<#{uri_str}>\")", lineno: lineno, token: "<#{uri_str}>")
|
247
247
|
end
|
248
248
|
|
249
249
|
##
|
data/lib/rdf/reader.rb
CHANGED
@@ -398,7 +398,8 @@ module RDF
|
|
398
398
|
# @return [void]
|
399
399
|
# @raise [RDF::ReaderError]
|
400
400
|
def fail_subject
|
401
|
-
raise RDF::ReaderError
|
401
|
+
raise RDF::ReaderError.new("ERROR [line #{lineno}] Expected subject (found: #{current_line.inspect})",
|
402
|
+
lineno: lineno)
|
402
403
|
end
|
403
404
|
|
404
405
|
##
|
@@ -407,7 +408,8 @@ module RDF
|
|
407
408
|
# @return [void]
|
408
409
|
# @raise [RDF::ReaderError]
|
409
410
|
def fail_predicate
|
410
|
-
raise RDF::ReaderError
|
411
|
+
raise RDF::ReaderError.new("ERROR [line #{lineno}] Expected predicate (found: #{current_line.inspect})",
|
412
|
+
lineno: lineno)
|
411
413
|
end
|
412
414
|
|
413
415
|
##
|
@@ -416,7 +418,8 @@ module RDF
|
|
416
418
|
# @return [void]
|
417
419
|
# @raise [RDF::ReaderError]
|
418
420
|
def fail_object
|
419
|
-
raise RDF::ReaderError
|
421
|
+
raise RDF::ReaderError.new("ERROR [line #{lineno}] Expected object (found: #{current_line.inspect})",
|
422
|
+
lineno: lineno)
|
420
423
|
end
|
421
424
|
|
422
425
|
##
|
@@ -526,5 +529,29 @@ module RDF
|
|
526
529
|
##
|
527
530
|
# The base class for RDF parsing errors.
|
528
531
|
class ReaderError < IOError
|
532
|
+
##
|
533
|
+
# The invalid token which triggered the error.
|
534
|
+
#
|
535
|
+
# @return [String]
|
536
|
+
attr_reader :token
|
537
|
+
|
538
|
+
##
|
539
|
+
# The line number where the error occurred.
|
540
|
+
#
|
541
|
+
# @return [Integer]
|
542
|
+
attr_reader :lineno
|
543
|
+
|
544
|
+
##
|
545
|
+
# Initializes a new lexer error instance.
|
546
|
+
#
|
547
|
+
# @param [String, #to_s] message
|
548
|
+
# @param [Hash{Symbol => Object}] options
|
549
|
+
# @option options [String] :token (nil)
|
550
|
+
# @option options [Integer] :lineno (nil)
|
551
|
+
def initialize(message, options = {})
|
552
|
+
@token = options[:token]
|
553
|
+
@lineno = options[:lineno] || (@token.lineno if @token.respond_to?(:lineno))
|
554
|
+
super(message.to_s)
|
555
|
+
end
|
529
556
|
end # ReaderError
|
530
557
|
end # RDF
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arto Bendiken
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-12-
|
13
|
+
date: 2013-12-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rdf-spec
|