rdf-trix 1.99.0 → 2.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da8741a141629c95c4a59c8bc20199b72e2e76dd
4
- data.tar.gz: 6b042b85dacae9bc0b0b11e80678113ca274b504
3
+ metadata.gz: 3d7c42646bb226196e34424a8a78e48bdd982f71
4
+ data.tar.gz: 57cb0bef6641edf06f0a44c99f9ba54e121d5115
5
5
  SHA512:
6
- metadata.gz: af098f72570473df003bd2596d5c6ed4bf396c3bfac325d80c0b69592ae6b38115a086a0b2b4e31447ef9bbb97d4d4afef975b3abf37b38f3cea704dbe163630
7
- data.tar.gz: 24213449a5a9883db54aade7ec03a3cfe78de923b8a84c6765d3000b26edd8f22edbe19c0b682854ec5cbcd0daefe2f2e3ea1299935ed6518e6f89ede71d3300
6
+ metadata.gz: 7d2b1c94581bb2188d0ab68f50c658f9665dd2fc3339afd219e6848dcf9044393294b01050e71447985d63bcbff79512347387b9c5160ca81f10c5515b37b8b2
7
+ data.tar.gz: 9a8d0781b3cb057333c3a3ee550a00f31d8d36ed6353183f8236e4c9348bb6ba0c4dcdfedb46e752865816ac8ed5128613b0bfa10c9063c73efd611b950c18ce
@@ -22,7 +22,7 @@ Documentation
22
22
  Dependencies
23
23
  ------------
24
24
 
25
- * [RDF.rb](http://rubygems.org/gems/rdf) (>= 1.1)
25
+ * [RDF.rb](http://rubygems.org/gems/rdf) (>= 2.0)
26
26
  [Nokogiri](http://rubygems.org/gems/nokogiri) (>= 1.6.0)
27
27
 
28
28
  Installation
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.99.0
1
+ 2.0.0.beta
@@ -96,7 +96,12 @@ module RDF::TriX
96
96
  end
97
97
  self.extend(@implementation)
98
98
 
99
- initialize_xml(options)
99
+ begin
100
+ initialize_xml(options)
101
+ rescue
102
+ log_error("Malformed document: #{$!.message}")
103
+ end
104
+
100
105
  if block_given?
101
106
  case block.arity
102
107
  when 0 then instance_eval(&block)
@@ -162,7 +167,7 @@ module RDF::TriX
162
167
  literal.canonicalize! if canonicalize?
163
168
  literal
164
169
  else
165
- raise RDF::ReaderError, "expected element name to be 'id', 'uri', 'typedLiteral', or 'plainLiteral', but got #{name.inspect}"
170
+ log_error "expected element name to be 'id', 'uri', 'typedLiteral', or 'plainLiteral', but got #{name.inspect}"
166
171
  end
167
172
  end
168
173
  end # Reader
@@ -72,7 +72,7 @@ module RDF::TriX
72
72
  triple = triple_element.children.select { |node| node.element? }[0..2]
73
73
  triple = triple.map { |element| parse_element(element.name, element.attributes, element.content) }
74
74
  triple << {:context => context} if context
75
- block.call(RDF::Statement.new(*triple))
75
+ block.call(RDF::Statement(*triple))
76
76
  end
77
77
  end
78
78
  end # LibXML
@@ -23,6 +23,8 @@ module RDF::TriX
23
23
  def initialize_xml(options = {})
24
24
  require 'nokogiri' unless defined?(::Nokogiri)
25
25
  @xml = ::Nokogiri::XML(@input)
26
+ log_error("Errors: #{@xml.errors.join('\n')}") unless @xml.errors.empty?
27
+ @xml
26
28
  end
27
29
 
28
30
  ##
@@ -68,7 +70,7 @@ module RDF::TriX
68
70
  triple = triple_element.children.select { |node| node.element? }[0..2]
69
71
  triple = triple.map { |element| parse_element(element.name, element, element.content) }
70
72
  triple << {:context => context} if context
71
- block.call(RDF::Statement.new(*triple))
73
+ block.call(RDF::Statement(*triple))
72
74
  end
73
75
  end
74
76
  end # Nokogiri
@@ -68,7 +68,7 @@ module RDF::TriX
68
68
  triple = triple_element.elements.to_a[0..2]
69
69
  triple = triple.map { |element| parse_element(element.name, element.attributes, element.text) }
70
70
  triple << {:context => context} if context
71
- block.call(RDF::Statement.new(*triple))
71
+ block.call(RDF::Statement(*triple))
72
72
  end
73
73
  end
74
74
  end # REXML
@@ -149,15 +149,18 @@ module RDF::TriX
149
149
  end
150
150
 
151
151
  ##
152
- # Generates the TriX representation of an RDF statement.
152
+ # Generates the TriX representation of a quad.
153
153
  #
154
- # @param [RDF::Statement] statement
154
+ # @param [RDF::Resource] subject
155
+ # @param [RDF::URI] predicate
156
+ # @param [RDF::Value] object
157
+ # @param [RDF::Resource] graph_name
155
158
  # @return [void]
156
- def write_statement(statement)
157
- unless nested? || statement.graph_name.to_s == @graph_name.to_s
158
- @graph = create_graph(@graph_name = statement.graph_name)
159
+ def write_quad(subject, predicate, object, graph_name)
160
+ unless nested? || graph_name.to_s == @graph_name.to_s
161
+ @graph = create_graph(@graph_name = graph_name)
159
162
  end
160
- write_triple(*statement.to_triple)
163
+ write_triple(subject, predicate, object)
161
164
  end
162
165
 
163
166
  ##
@@ -170,6 +173,8 @@ module RDF::TriX
170
173
  def write_triple(subject, predicate, object)
171
174
  @graph = create_graph unless @graph
172
175
  @graph << format_triple(subject, predicate, object)
176
+ rescue ArgumentError => e
177
+ log_error(subject, predicate, object, e.message)
173
178
  end
174
179
 
175
180
  ##
@@ -39,6 +39,7 @@ module RDF::TriX
39
39
  def write_epilogue
40
40
  puts @xml.to_xml
41
41
  @xml = @trix = nil
42
+ super
42
43
  end
43
44
 
44
45
  ##
@@ -42,6 +42,7 @@ module RDF::TriX
42
42
  formatter.write(@xml, @output)
43
43
  puts # add a line break after the last line
44
44
  @xml = @trix = nil
45
+ super
45
46
  end
46
47
 
47
48
  ##
metadata CHANGED
@@ -1,71 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-trix
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.99.0
4
+ version: 2.0.0.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arto Bendiken
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-27 00:00:00.000000000 Z
11
+ date: 2016-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdf
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.0.beta
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '1.1'
22
+ version: '3'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: '1.1'
29
+ version: 2.0.0.beta
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rdf-spec
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - "~>"
37
+ - - ">="
32
38
  - !ruby/object:Gem::Version
33
- version: '1.1'
39
+ version: 2.0.0.beta
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '3'
34
43
  type: :development
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
38
- - - "~>"
47
+ - - ">="
39
48
  - !ruby/object:Gem::Version
40
- version: '1.1'
49
+ version: 2.0.0.beta
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '3'
41
53
  - !ruby/object:Gem::Dependency
42
54
  name: rspec
43
55
  requirement: !ruby/object:Gem::Requirement
44
56
  requirements:
45
57
  - - "~>"
46
58
  - !ruby/object:Gem::Version
47
- version: '3.0'
59
+ version: '3.4'
48
60
  type: :development
49
61
  prerelease: false
50
62
  version_requirements: !ruby/object:Gem::Requirement
51
63
  requirements:
52
64
  - - "~>"
53
65
  - !ruby/object:Gem::Version
54
- version: '3.0'
66
+ version: '3.4'
55
67
  - !ruby/object:Gem::Dependency
56
68
  name: rspec-its
57
69
  requirement: !ruby/object:Gem::Requirement
58
70
  requirements:
59
71
  - - "~>"
60
72
  - !ruby/object:Gem::Version
61
- version: '1.0'
73
+ version: '1.2'
62
74
  type: :development
63
75
  prerelease: false
64
76
  version_requirements: !ruby/object:Gem::Requirement
65
77
  requirements:
66
78
  - - "~>"
67
79
  - !ruby/object:Gem::Version
68
- version: '1.0'
80
+ version: '1.2'
69
81
  - !ruby/object:Gem::Dependency
70
82
  name: yard
71
83
  requirement: !ruby/object:Gem::Requirement
@@ -116,7 +128,7 @@ extra_rdoc_files: []
116
128
  files:
117
129
  - AUTHORS
118
130
  - CREDITS
119
- - README
131
+ - README.md
120
132
  - UNLICENSE
121
133
  - VERSION
122
134
  - etc/doap.xml
@@ -132,7 +144,7 @@ files:
132
144
  - lib/rdf/trix/writer/rexml.rb
133
145
  homepage: http://ruby-rdf.github.com/rdf-trix
134
146
  licenses:
135
- - Public Domain
147
+ - Unlicense
136
148
  metadata: {}
137
149
  post_install_message:
138
150
  rdoc_options: []
@@ -142,15 +154,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
154
  requirements:
143
155
  - - ">="
144
156
  - !ruby/object:Gem::Version
145
- version: 1.9.2
157
+ version: '2.0'
146
158
  required_rubygems_version: !ruby/object:Gem::Requirement
147
159
  requirements:
148
- - - ">="
160
+ - - ">"
149
161
  - !ruby/object:Gem::Version
150
- version: '0'
162
+ version: 1.3.1
151
163
  requirements: []
152
164
  rubyforge_project: rdf
153
- rubygems_version: 2.4.5.1
165
+ rubygems_version: 2.5.1
154
166
  signing_key:
155
167
  specification_version: 4
156
168
  summary: TriX support for RDF.rb.