rdf-normalize 0.3.1 → 0.5.0

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
- SHA1:
3
- metadata.gz: bba920e9dddcb07198cfcf1604d6c500d0634979
4
- data.tar.gz: 9c17207f8fce5faa7b74d42363c253b9d694e910
2
+ SHA256:
3
+ metadata.gz: 60932e4daabb349e76fb838c46aeea30ea39ff2406d7fd2f08b4df20b22975e4
4
+ data.tar.gz: d1f1b87ac1a46ad18c7a1e848c8e7306b20cedbdb374cc1a197f8a2235875b27
5
5
  SHA512:
6
- metadata.gz: 016b2437c6e376bdbded0f9ee3d83aa0ce0ccb431d37224020abc6469cf1411e6d0686b620a6fac006ea0b6ffda06bb5ef087b7a11734106cbee4c7f7026bd8f
7
- data.tar.gz: 6f83182eee27eefe79d6d9bb68efab7ff3d5712b49ed7a87c0779e061b1512859ae61643a41022eb83e5000a66b281966fcba6507e930084b5bd4a46515e998d
6
+ metadata.gz: 263602b7c6861bf74745600e5828f5095cb9a3a3f08974621d050982a78bc6d4d6e1c6e421cc69e5bc9fa0146cfd0521b0f4817989b8644b4d25fa02c13015dd
7
+ data.tar.gz: 98a1391dd232a2db5ea8353a51268fcfe9def16dc7a8f309bb305c7feeb9df85f8e96c8cc5dbcf4b3486e34d0133b33bdb353d2aa567bb948d412bb36be5e202
data/LICENSE CHANGED
@@ -21,5 +21,5 @@ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
21
  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
22
  OTHER DEALINGS IN THE SOFTWARE.
23
23
 
24
- For more information, please refer to <http://unlicense.org>
24
+ For more information, please refer to <https://unlicense.org>
25
25
 
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # RDF::Normalize
2
2
  RDF Graph normalizer for [RDF.rb][RDF.rb].
3
3
 
4
- [![Gem Version](https://badge.fury.io/rb/rdf-normalize.png)](http://badge.fury.io/rb/rdf-normalize)
5
- [![Build Status](https://secure.travis-ci.org/ruby-rdf/rdf-normalize.png?branch=master)](http://travis-ci.org/ruby-rdf/rdf-normalize)
4
+ [![Gem Version](https://badge.fury.io/rb/rdf-normalize.png)](https://badge.fury.io/rb/rdf-normalize)
5
+ [![Build Status](https://github.com/ruby-rdf/rdf-normalize/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf-normalize/actions?query=workflow%3ACI)
6
+ [![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-normalize/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/rdf-normalize?branch=develop)
7
+ [![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
6
8
 
7
9
  ## Description
8
10
  This is a [Ruby][] implementation of a [RDF Normalize][] for [RDF.rb][].
@@ -14,13 +16,13 @@ to serialize normalized statements.
14
16
 
15
17
  Algorithms implemented:
16
18
 
17
- * [URGNA2012](http://json-ld.github.io/normalization/spec/index.html#dfn-urgna2012)
18
- * [URDNA2015](http://json-ld.github.io/normalization/spec/index.html#dfn-urdna2015)
19
+ * [URGNA2012](https://json-ld.github.io/normalization/spec/index.html#dfn-urgna2012)
20
+ * [URDNA2015](https://json-ld.github.io/normalization/spec/index.html#dfn-urdna2015)
19
21
 
20
22
  Install with `gem install rdf-normalize`
21
23
 
22
- * 100% free and unencumbered [public domain](http://unlicense.org/) software.
23
- * Compatible with Ruby >= 2.2.2.
24
+ * 100% free and unencumbered [public domain](https://unlicense.org/) software.
25
+ * Compatible with Ruby >= 2.6.
24
26
 
25
27
  ## Usage
26
28
 
@@ -38,21 +40,21 @@ Full documentation available on [Rubydoc.info][Normalize doc]
38
40
 
39
41
  ## Dependencies
40
42
 
41
- * [Ruby](http://ruby-lang.org/) (>= 2.0)
42
- * [RDF.rb](http://rubygems.org/gems/rdf) (~> 2.0)
43
+ * [Ruby](https://ruby-lang.org/) (>= 2.6)
44
+ * [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.2)
43
45
 
44
46
  ## Installation
45
47
 
46
- The recommended installation method is via [RubyGems](http://rubygems.org/).
48
+ The recommended installation method is via [RubyGems](https://rubygems.org/).
47
49
  To install the latest official release of the `RDF::Normalize` gem, do:
48
50
 
49
51
  % [sudo] gem install rdf-normalize
50
52
 
51
53
  ## Mailing List
52
- * <http://lists.w3.org/Archives/Public/public-rdf-ruby/>
54
+ * <https://lists.w3.org/Archives/Public/public-rdf-ruby/>
53
55
 
54
56
  ## Author
55
- * [Gregg Kellogg](http://github.com/gkellogg) - <http://greggkellogg.net/>
57
+ * [Gregg Kellogg](https://github.com/gkellogg) - <https://greggkellogg.net/>
56
58
 
57
59
  ## Contributing
58
60
  * Do your best to adhere to the existing coding conventions and idioms.
@@ -65,18 +67,20 @@ To install the latest official release of the `RDF::Normalize` gem, do:
65
67
  list in the the `README`. Alphabetical order applies.
66
68
  * Do note that in order for us to merge any non-trivial changes (as a rule
67
69
  of thumb, additions larger than about 15 lines of code), we need an
68
- explicit [public domain dedication][PDD] on record from you.
70
+ explicit [public domain dedication][PDD] on record from you,
71
+ which you will be asked to agree to on the first commit to a repo within the organization.
72
+ Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.
69
73
 
70
74
  ## License
71
75
  This is free and unencumbered public domain software. For more information,
72
- see <http://unlicense.org/> or the accompanying {file:LICENSE} file.
73
-
74
- [Ruby]: http://ruby-lang.org/
75
- [RDF]: http://www.w3.org/RDF/
76
- [YARD]: http://yardoc.org/
77
- [YARD-GS]: http://rubydoc.info/docs/yard/file/docs/GettingStarted.md
78
- [PDD]: http://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
79
- [RDF.rb]: http://rubydoc.info/github/ruby-rdf/rdf-normalize
80
- [N-Triples]: http://www.w3.org/TR/rdf-testcases/#ntriples
81
- [RDF Normalize]:http://json-ld.github.io/normalization/spec/
82
- [Normalize doc]:http://rubydoc.info/github/ruby-rdf/rdf-normalize/master/file/README.markdown
76
+ see <https://unlicense.org/> or the accompanying {file:LICENSE} file.
77
+
78
+ [Ruby]: https://ruby-lang.org/
79
+ [RDF]: https://www.w3.org/RDF/
80
+ [YARD]: https://yardoc.org/
81
+ [YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
82
+ [PDD]: https://unlicense.org/#unlicensing-contributions
83
+ [RDF.rb]: https://rubydoc.info/github/ruby-rdf/rdf-normalize
84
+ [N-Triples]: https://www.w3.org/TR/rdf-testcases/#ntriples
85
+ [RDF Normalize]:https://json-ld.github.io/normalization/spec/
86
+ [Normalize doc]:https://rubydoc.info/github/ruby-rdf/rdf-normalize/master
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.5.0
@@ -9,7 +9,7 @@ module RDF::Normalize
9
9
  #
10
10
  # @param [RDF::Enumerable] enumerable
11
11
  # @return [RDF::Enumerable]
12
- def initialize(enumerable, options)
12
+ def initialize(enumerable, **options)
13
13
  @dataset = enumerable
14
14
  end
15
15
 
@@ -2,6 +2,7 @@ require 'rdf/nquads'
2
2
 
3
3
  module RDF::Normalize
4
4
  class Format < RDF::Format
5
+ content_type 'application/normalized+n-quads', alias: 'application/x-normalized+n-quads'
5
6
  content_encoding 'utf-8'
6
7
 
7
8
  # It reads like normal N-Quads
@@ -9,7 +9,7 @@ module RDF::Normalize
9
9
  #
10
10
  # @param [RDF::Enumerable] enumerable
11
11
  # @return [RDF::Enumerable]
12
- def initialize(enumerable, options)
12
+ def initialize(enumerable, **options)
13
13
  @dataset, @options = enumerable, options
14
14
  end
15
15
 
@@ -0,0 +1,18 @@
1
+ module RDF::Normalize::VERSION
2
+ VERSION_FILE = File.join(File.expand_path(File.dirname(__FILE__)), "..", "..", "..", "VERSION")
3
+ MAJOR, MINOR, TINY, EXTRA = File.read(VERSION_FILE).chop.split(".")
4
+
5
+ STRING = [MAJOR, MINOR, TINY, EXTRA].compact.join('.')
6
+
7
+ ##
8
+ # @return [String]
9
+ def self.to_s() STRING end
10
+
11
+ ##
12
+ # @return [String]
13
+ def self.to_str() STRING end
14
+
15
+ ##
16
+ # @return [Array(Integer, Integer, Integer)]
17
+ def self.to_a() STRING.split(".") end
18
+ end
@@ -4,11 +4,11 @@ module RDF::Normalize
4
4
  #
5
5
  # Normalizes the enumerated statements into normal form in the form of N-Quads.
6
6
  #
7
- # @author [Gregg Kellogg](http://kellogg-assoc.com/)
7
+ # @author [Gregg Kellogg](http://greggkellogg.net/)
8
8
  class Writer < RDF::NQuads::Writer
9
9
  format RDF::Normalize::Format
10
10
 
11
- # @attr_accessor [RDF::Repository] Repository of statements to serialized
11
+ # @return [RDF::Repository] Repository of statements to serialized
12
12
  attr_accessor :repo
13
13
 
14
14
  ##
@@ -23,7 +23,7 @@ module RDF::Normalize
23
23
  # @yieldreturn [void]
24
24
  # @yield [writer]
25
25
  # @yieldparam [RDF::Writer] writer
26
- def initialize(output = $stdout, options = {}, &block)
26
+ def initialize(output = $stdout, **options, &block)
27
27
  super do
28
28
  @repo = RDF::Repository.new
29
29
  if block_given?
@@ -53,7 +53,7 @@ module RDF::Normalize
53
53
  #
54
54
  # @return [void]
55
55
  def write_epilogue
56
- statements = RDF::Normalize.new(@repo, @options).
56
+ statements = RDF::Normalize.new(@repo, **@options).
57
57
  statements.
58
58
  reject(&:variable?).
59
59
  map {|s| format_statement(s)}.
@@ -69,7 +69,7 @@ module RDF::Normalize
69
69
  ##
70
70
  # Insert an Enumerable
71
71
  #
72
- # @param [RDF::Enumerable] graph
72
+ # @param [RDF::Enumerable] enumerable
73
73
  # @return [void]
74
74
  def insert_statements(enumerable)
75
75
  @repo = enumerable
data/lib/rdf/normalize.rb CHANGED
@@ -53,11 +53,11 @@ module RDF
53
53
  # One of `:carroll2001`, `:urgna2012`, or `:urdna2015`
54
54
  # @return [RDF::Normalize::Base]
55
55
  # @raise [ArgumentError] selected algorithm not defined
56
- def new(enumerable, options = {})
56
+ def new(enumerable, **options)
57
57
  algorithm = options.fetch(:algorithm, :urdna2015)
58
58
  raise ArgumentError, "No algoritm defined for #{algorithm.to_sym}" unless ALGORITHMS.has_key?(algorithm)
59
59
  algorithm_class = const_get(ALGORITHMS[algorithm])
60
- algorithm_class.new(enumerable, options)
60
+ algorithm_class.new(enumerable, **options)
61
61
  end
62
62
  module_function :new
63
63
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-normalize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregg Kellogg
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-31 00:00:00.000000000 Z
11
+ date: 2021-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdf
@@ -16,104 +16,84 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '3.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: '3.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rdf-spec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.0'
33
+ version: '3.2'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.0'
41
- - !ruby/object:Gem::Dependency
42
- name: open-uri-cached
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '0.0'
48
- - - ">="
49
- - !ruby/object:Gem::Version
50
- version: 0.0.5
51
- type: :development
52
- prerelease: false
53
- version_requirements: !ruby/object:Gem::Requirement
54
- requirements:
55
- - - "~>"
56
- - !ruby/object:Gem::Version
57
- version: '0.0'
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: 0.0.5
40
+ version: '3.2'
61
41
  - !ruby/object:Gem::Dependency
62
42
  name: rspec
63
43
  requirement: !ruby/object:Gem::Requirement
64
44
  requirements:
65
45
  - - "~>"
66
46
  - !ruby/object:Gem::Version
67
- version: '3.4'
47
+ version: '3.10'
68
48
  type: :development
69
49
  prerelease: false
70
50
  version_requirements: !ruby/object:Gem::Requirement
71
51
  requirements:
72
52
  - - "~>"
73
53
  - !ruby/object:Gem::Version
74
- version: '3.4'
54
+ version: '3.10'
75
55
  - !ruby/object:Gem::Dependency
76
56
  name: webmock
77
57
  requirement: !ruby/object:Gem::Requirement
78
58
  requirements:
79
59
  - - "~>"
80
60
  - !ruby/object:Gem::Version
81
- version: '2.3'
61
+ version: '3.11'
82
62
  type: :development
83
63
  prerelease: false
84
64
  version_requirements: !ruby/object:Gem::Requirement
85
65
  requirements:
86
66
  - - "~>"
87
67
  - !ruby/object:Gem::Version
88
- version: '2.3'
68
+ version: '3.11'
89
69
  - !ruby/object:Gem::Dependency
90
70
  name: json-ld
91
71
  requirement: !ruby/object:Gem::Requirement
92
72
  requirements:
93
73
  - - "~>"
94
74
  - !ruby/object:Gem::Version
95
- version: '2.0'
75
+ version: '3.2'
96
76
  type: :development
97
77
  prerelease: false
98
78
  version_requirements: !ruby/object:Gem::Requirement
99
79
  requirements:
100
80
  - - "~>"
101
81
  - !ruby/object:Gem::Version
102
- version: '2.0'
82
+ version: '3.2'
103
83
  - !ruby/object:Gem::Dependency
104
84
  name: yard
105
85
  requirement: !ruby/object:Gem::Requirement
106
86
  requirements:
107
87
  - - "~>"
108
88
  - !ruby/object:Gem::Version
109
- version: '0.8'
89
+ version: '0.9'
110
90
  type: :development
111
91
  prerelease: false
112
92
  version_requirements: !ruby/object:Gem::Requirement
113
93
  requirements:
114
94
  - - "~>"
115
95
  - !ruby/object:Gem::Version
116
- version: '0.8'
96
+ version: '0.9'
117
97
  description: RDF::Normalize is a Graph normalizer for the RDF.rb library suite.
118
98
  email: public-rdf-ruby@w3.org
119
99
  executables: []
@@ -130,12 +110,13 @@ files:
130
110
  - lib/rdf/normalize/format.rb
131
111
  - lib/rdf/normalize/urdna2015.rb
132
112
  - lib/rdf/normalize/urgna2012.rb
113
+ - lib/rdf/normalize/version.rb
133
114
  - lib/rdf/normalize/writer.rb
134
- homepage: http://github.com/gkellogg/rdf-normalize
115
+ homepage: https://github.com/ruby-rdf/rdf-normalize
135
116
  licenses:
136
117
  - Unlicense
137
118
  metadata: {}
138
- post_install_message:
119
+ post_install_message:
139
120
  rdoc_options: []
140
121
  require_paths:
141
122
  - lib
@@ -143,16 +124,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
143
124
  requirements:
144
125
  - - ">="
145
126
  - !ruby/object:Gem::Version
146
- version: 2.2.2
127
+ version: '2.6'
147
128
  required_rubygems_version: !ruby/object:Gem::Requirement
148
129
  requirements:
149
130
  - - ">="
150
131
  - !ruby/object:Gem::Version
151
132
  version: '0'
152
133
  requirements: []
153
- rubyforge_project: rdf-normalize
154
- rubygems_version: 2.6.8
155
- signing_key:
134
+ rubygems_version: 3.3.3
135
+ signing_key:
156
136
  specification_version: 4
157
137
  summary: RDF Graph normalizer for Ruby.
158
138
  test_files: []