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 +5 -5
- data/LICENSE +1 -1
- data/README.md +27 -23
- data/VERSION +1 -1
- data/lib/rdf/normalize/carroll2001.rb +1 -1
- data/lib/rdf/normalize/format.rb +1 -0
- data/lib/rdf/normalize/urdna2015.rb +1 -1
- data/lib/rdf/normalize/version.rb +18 -0
- data/lib/rdf/normalize/writer.rb +5 -5
- data/lib/rdf/normalize.rb +2 -2
- metadata +21 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 60932e4daabb349e76fb838c46aeea30ea39ff2406d7fd2f08b4df20b22975e4
|
4
|
+
data.tar.gz: d1f1b87ac1a46ad18c7a1e848c8e7306b20cedbdb374cc1a197f8a2235875b27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 <
|
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)](
|
5
|
-
[![Build Status](https://
|
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](
|
18
|
-
* [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](
|
23
|
-
* Compatible with Ruby >= 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](
|
42
|
-
* [RDF.rb](
|
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](
|
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
|
-
* <
|
54
|
+
* <https://lists.w3.org/Archives/Public/public-rdf-ruby/>
|
53
55
|
|
54
56
|
## Author
|
55
|
-
* [Gregg Kellogg](
|
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 <
|
73
|
-
|
74
|
-
[Ruby]:
|
75
|
-
[RDF]:
|
76
|
-
[YARD]:
|
77
|
-
[YARD-GS]:
|
78
|
-
[PDD]:
|
79
|
-
[RDF.rb]:
|
80
|
-
[N-Triples]:
|
81
|
-
[RDF Normalize]:
|
82
|
-
[Normalize doc]:
|
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.
|
1
|
+
0.5.0
|
data/lib/rdf/normalize/format.rb
CHANGED
@@ -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
|
data/lib/rdf/normalize/writer.rb
CHANGED
@@ -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://
|
7
|
+
# @author [Gregg Kellogg](http://greggkellogg.net/)
|
8
8
|
class Writer < RDF::NQuads::Writer
|
9
9
|
format RDF::Normalize::Format
|
10
10
|
|
11
|
-
# @
|
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
|
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,
|
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]
|
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.
|
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:
|
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
|
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
|
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
|
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
|
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.
|
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.
|
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: '
|
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: '
|
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
|
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
|
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.
|
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.
|
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:
|
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.
|
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
|
-
|
154
|
-
|
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: []
|