rdf 3.1.4 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/rdf +2 -2
- data/lib/rdf.rb +3 -0
- data/lib/rdf/cli.rb +11 -3
- data/lib/rdf/model/uri.rb +3 -3
- data/lib/rdf/util/file.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3024b8471983ae96eef2df1b95ef2fc1d72bba082d43e3567c9e8c30970cb6db
|
4
|
+
data.tar.gz: 3104532cffa328bb403fe3403deb30188ceb00a119b8f4e1dbccc7c01fd69712
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b62e3081278305f44f09c7aa77d3143a5110779bd1963e702ffde2ffacae8fa4ee0abcb861441675ea70c409f33270e7f4a2e0cf45c66c4956188bebef6ae80
|
7
|
+
data.tar.gz: 23674e4180517963dd92f26ac4d40c7c3eea672be96e64f8d719ff94c084ef229e5e21473d1d4dd0336fbb8ae3ad2c3b200ff1f7da6b7a352ead2ff98d4dd83c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.5
|
data/bin/rdf
CHANGED
data/lib/rdf.rb
CHANGED
data/lib/rdf/cli.rb
CHANGED
@@ -8,7 +8,7 @@ begin
|
|
8
8
|
require 'linkeddata'
|
9
9
|
rescue LoadError
|
10
10
|
# Silently load without linkeddata, but try some others
|
11
|
-
%w(
|
11
|
+
%w(microdata n3 rdfa rdfxml reasoner tabular trig trix turtle vocab xsd json/ld ld/patch).each do |ser|
|
12
12
|
begin
|
13
13
|
require ser.include?('/') ? ser : "rdf/#{ser}"
|
14
14
|
rescue LoadError
|
@@ -296,6 +296,12 @@ module RDF
|
|
296
296
|
control: :none,
|
297
297
|
on: ["-o", "--output FILE"],
|
298
298
|
description: "File to write output, defaults to STDOUT") {|arg| File.open(arg, "w")},
|
299
|
+
RDF::CLI::Option.new(
|
300
|
+
symbol: :ordered,
|
301
|
+
control: :checkbox,
|
302
|
+
datatype: TrueClass,
|
303
|
+
on: ["--ordered"],
|
304
|
+
description: "Use order preserving repository"),
|
299
305
|
RDF::CLI::Option.new(
|
300
306
|
symbol: :format,
|
301
307
|
control: :select,
|
@@ -495,14 +501,16 @@ module RDF
|
|
495
501
|
options[:format] = options[:format].to_sym if options[:format]
|
496
502
|
options[:output_format] = options[:output_format].to_sym if options[:output_format]
|
497
503
|
|
498
|
-
@repository =
|
504
|
+
@repository = options[:ordered] ?
|
505
|
+
[].extend(RDF::Enumerable, RDF::Queryable) :
|
506
|
+
RDF::Repository.new
|
499
507
|
|
500
508
|
# Parse input files if any command requires it
|
501
509
|
if cmds.any? {|c| COMMANDS[c.to_sym][:parse]}
|
502
510
|
start = Time.new
|
503
511
|
count = 0
|
504
512
|
self.parse(args, **options) do |reader|
|
505
|
-
@repository <<
|
513
|
+
reader.each_statement {|st| @repository << st}
|
506
514
|
end
|
507
515
|
secs = Time.new - start
|
508
516
|
options[:logger].info "Parsed #{repository.count} statements with #{@readers.join(', ')} in #{secs} seconds @ #{count/secs} statements/second."
|
data/lib/rdf/model/uri.rb
CHANGED
@@ -902,7 +902,7 @@ module RDF
|
|
902
902
|
# Normalized version of user
|
903
903
|
# @return [String]
|
904
904
|
def normalized_user
|
905
|
-
URI.encode(CGI.unescape(user), /[^#{IUNRESERVED}|#{SUB_DELIMS}]/) if user
|
905
|
+
URI.encode(CGI.unescape(user), /[^#{IUNRESERVED}|#{SUB_DELIMS}]/).force_encoding(Encoding::UTF_8) if user
|
906
906
|
end
|
907
907
|
|
908
908
|
##
|
@@ -928,7 +928,7 @@ module RDF
|
|
928
928
|
# Normalized version of password
|
929
929
|
# @return [String]
|
930
930
|
def normalized_password
|
931
|
-
URI.encode(CGI.unescape(password), /[^#{IUNRESERVED}|#{SUB_DELIMS}]/) if password
|
931
|
+
URI.encode(CGI.unescape(password), /[^#{IUNRESERVED}|#{SUB_DELIMS}]/).force_encoding(Encoding::UTF_8) if password
|
932
932
|
end
|
933
933
|
|
934
934
|
HOST_FROM_AUTHORITY_RE = /(?:[^@]+@)?([^:]+)(?::.*)?$/.freeze
|
@@ -1295,7 +1295,7 @@ module RDF
|
|
1295
1295
|
value = value.dup.force_encoding(Encoding::UTF_8)
|
1296
1296
|
decoded = CGI.unescape(value)
|
1297
1297
|
decoded.downcase! if downcase
|
1298
|
-
URI.encode(decoded, /[^(?:#{expr})]/)
|
1298
|
+
URI.encode(decoded, /[^(?:#{expr})]/).force_encoding(Encoding::UTF_8)
|
1299
1299
|
end
|
1300
1300
|
end
|
1301
1301
|
|
data/lib/rdf/util/file.rb
CHANGED
@@ -14,7 +14,7 @@ module RDF; module Util
|
|
14
14
|
# allowing the use of `Rack::Cache` to avoid network access.
|
15
15
|
#
|
16
16
|
# To use other HTTP clients, consumers can subclass
|
17
|
-
# {RDF::Util::File::HttpAdapter} and set the {RDF::Util::File.
|
17
|
+
# {RDF::Util::File::HttpAdapter} and set the {RDF::Util::File.}.
|
18
18
|
#
|
19
19
|
# Also supports the file: scheme for access to local files.
|
20
20
|
#
|
@@ -121,8 +121,8 @@ module RDF; module Util
|
|
121
121
|
|
122
122
|
redirect_count = 0
|
123
123
|
max_redirects = 5
|
124
|
-
parsed_url = ::URI.parse(base_uri)
|
125
|
-
parsed_proxy = ::URI.parse(proxy.to_s)
|
124
|
+
parsed_url = RDF::URI.parse(base_uri)
|
125
|
+
parsed_proxy = RDF::URI.parse(proxy.to_s)
|
126
126
|
base_uri = parsed_url.to_s
|
127
127
|
remote_document = nil
|
128
128
|
|
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.1.
|
4
|
+
version: 3.1.5
|
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: 2020-
|
13
|
+
date: 2020-08-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: link_header
|