rdf 3.0.1 → 3.0.2

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
  SHA256:
3
- metadata.gz: ebe49e2d90f8231d8595f66232f97b167fa0e4f90edbeb1112536c968d5b0598
4
- data.tar.gz: 2d14168594558213b9c6f855e8a3407287f2a9a9d913ec2e8ae4b98aa0c7b8ac
3
+ metadata.gz: 310f7614fec8b30d87c0325fd5bceaa0e0dd6a5165ddf863a2d0460982f5be67
4
+ data.tar.gz: dca8aa6de3cd44cd1bcb09e57f1b4c1cc8a3413cd0ce08c39466b566dcb27fc3
5
5
  SHA512:
6
- metadata.gz: 470a83b9eb6412b8b52517c7fd12f327e4b8983d1410e95556d3a67e170cd1f4d25e72e0489d329dec73986f224488cd6717e014cec73d6a8ab37c41643ef971
7
- data.tar.gz: b5e022cd1cfdb6c9aa4b9075fecf5447bdef0d8c39318d68f5242840a3e53b71bd3a06d427f08f74ae4cb94ac8448951e757251386fc0dfc0bdf29124b8b3c1a
6
+ metadata.gz: cb9ceb047dac566de6d389194c5ee875b624021cada5a3b29e7bd0c5f2b1ce87820441b9f137e754ee86505877fe63699cf4a5eac5cb93168d17c3d838e732b1
7
+ data.tar.gz: 5deb0de70b72a4c00e637e50555c80364e0721f6f968481b7db463131f84f38176686b7a36556d17bd936a34c09ef16ec4429651d229ba70edc3bf9e6ddc7018
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.1
1
+ 3.0.2
@@ -407,7 +407,7 @@ module RDF
407
407
  # @see <http://tools.ietf.org/html/rfc3986#section-5.2>
408
408
  # @see RDF::URI#/
409
409
  # @see RDF::URI#+
410
- # @param [Array<String, RDF::URI, #to_s>] uris
410
+ # @param [Array<String, RDF::URI, #to_s>] uris absolute or relative URIs.
411
411
  # @return [RDF::URI]
412
412
  # @see http://tools.ietf.org/html/rfc3986#section-5.2.2
413
413
  # @see http://tools.ietf.org/html/rfc3986#section-5.2.3
@@ -458,6 +458,8 @@ module RDF
458
458
  # this method does not perform any normalization, removal of spurious
459
459
  # paths, or removal of parent directory references `(/../)`.
460
460
  #
461
+ # When `fragment` is a path segment containing a colon, best practice is to prepend a `./` and use {#join}, which resolves dot-segments.
462
+ #
461
463
  # See also `#+`, which concatenates the string forms of two URIs without
462
464
  # any sort of checking or processing.
463
465
  #
@@ -207,7 +207,9 @@ module RDF
207
207
 
208
208
  Util::File.open_file(filename, options) do |file|
209
209
  format_options = options.dup
210
- format_options[:content_type] ||= file.content_type if file.respond_to?(:content_type)
210
+ format_options[:content_type] ||= file.content_type if
211
+ file.respond_to?(:content_type) &&
212
+ !file.content_type.to_s.include?('text/plain')
211
213
  format_options[:file_name] ||= filename
212
214
  reader = if self == RDF::Reader
213
215
  # We are the abstract reader class, find an appropriate reader
@@ -231,6 +231,17 @@ module RDF
231
231
  value.to_ruby(indent: indent + " ")
232
232
  elsif value.is_a?(RDF::Term)
233
233
  "#{value.to_s.inspect}.freeze"
234
+ elsif value.is_a?(RDF::List)
235
+ list_elements = value.map do |u|
236
+ if u.uri?
237
+ "#{u.pname.inspect}.freeze"
238
+ elsif u.respond_to?(:to_ruby)
239
+ u.to_ruby(indent: indent + " ")
240
+ else
241
+ "#{u.to_s.inspect}.freeze"
242
+ end
243
+ end
244
+ "list(#{list_elements.join(', ')})"
234
245
  else
235
246
  "#{value.inspect}.freeze"
236
247
  end
@@ -492,6 +492,10 @@ module RDF
492
492
  else statement.predicate.pname.to_sym
493
493
  end
494
494
 
495
+ # Skip literals other than plain or english
496
+ # This is because the ruby representation does not preserve language
497
+ next if statement.object.literal? && (statement.object.language || :en).to_s !~ /^en-?/
498
+
495
499
  (term[key] ||= []) << statement.object
496
500
  end
497
501
 
@@ -1080,7 +1084,7 @@ module RDF
1080
1084
  "term(" +
1081
1085
  (self.uri? ? self.to_s.inspect + ",\n" : "\n") +
1082
1086
  "#{indent} " +
1083
- attributes.keys.map do |k|
1087
+ attributes.keys.sort.map do |k|
1084
1088
  values = attribute_value(k)
1085
1089
  values = [values].compact unless values.is_a?(Array)
1086
1090
  values = values.map do |value|
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: 3.0.1
4
+ version: 3.0.2
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: 2017-12-30 00:00:00.000000000 Z
13
+ date: 2018-03-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: link_header
@@ -297,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
297
  version: '0'
298
298
  requirements: []
299
299
  rubyforge_project:
300
- rubygems_version: 2.7.3
300
+ rubygems_version: 2.7.4
301
301
  signing_key:
302
302
  specification_version: 4
303
303
  summary: A Ruby library for working with Resource Description Framework (RDF) data.