rdf-edtf 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.travis.yml +17 -0
- data/Gemfile +3 -0
- data/README.md +0 -8
- data/lib/rdf/edtf/version.rb +1 -1
- data/rdf-edtf.gemspec +4 -4
- data/spec/edtf_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- metadata +16 -11
- data/spec/support/shared_examples/literal.rb +0 -123
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 570882065ce26c6c0e5a70752f0a229903e89b2a
|
4
|
+
data.tar.gz: 217a59395f8c109e766ad5c72c459f61b25eea75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2560fdc0066b271b4e1472652bf9ed6e31d20a04b69a8919e5a893281830534a1e622df2fc23c44822f1c017d5b55835330077718df3504488527a0af29abbcb
|
7
|
+
data.tar.gz: 1919c2332cb35b0da4968dcc5301b24595fb7ff40c8fa444392771131924aa62f6845337cb16c2bcffa7116ff09f73c7c5f0ca3ff2ff782f93d7a57de7d166c8
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
anguage: ruby
|
2
|
+
bundler_args: --without debug
|
3
|
+
script: "bundle exec rspec spec"
|
4
|
+
sudo: false
|
5
|
+
cache: bundler
|
6
|
+
rvm:
|
7
|
+
- 2.0.0
|
8
|
+
- 2.1.0
|
9
|
+
- 2.1.1
|
10
|
+
- 2.2.1
|
11
|
+
- ruby-head
|
12
|
+
- jruby
|
13
|
+
- rbx-2
|
14
|
+
matrix:
|
15
|
+
allow_failures:
|
16
|
+
- rvm: jruby
|
17
|
+
- rvm: rbx-2
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -19,14 +19,6 @@ RDF::EDTF::Literal.new('1076?')
|
|
19
19
|
RDF::Literal('1076?', datatype: RDF::EDTF::Literal::DATATYPE)
|
20
20
|
```
|
21
21
|
|
22
|
-
Known Issues
|
23
|
-
------------
|
24
|
-
|
25
|
-
- Datetimes without a zone offset will be parsed and reserialized as UTC with
|
26
|
-
`+00:00`. See: https://github.com/inukshuk/edtf-ruby/issues/14
|
27
|
-
- Sets will be reserialized with spaces in their separators. See:
|
28
|
-
https://github.com/inukshuk/edtf-ruby/issues/15
|
29
|
-
|
30
22
|
Contribution Guidelines
|
31
23
|
-----------------------
|
32
24
|
|
data/lib/rdf/edtf/version.rb
CHANGED
data/rdf-edtf.gemspec
CHANGED
@@ -7,15 +7,15 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = RDF::EDTF::VERSION
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ['Tom Johnson']
|
10
|
-
s.homepage = 'https://github.com/
|
11
|
-
s.email = 'tom@
|
10
|
+
s.homepage = 'https://github.com/no-reply/rdf-edtf'
|
11
|
+
s.email = 'tom@curationexperts.com'
|
12
12
|
s.summary = %q{An `RDF::Literal` implementation around Extended Date Time Format.}
|
13
13
|
s.description = %q{Supports serializing and parsing EDTF (all levels) as typed literals in RDF.}
|
14
14
|
s.license = 'UNLICENSE'
|
15
15
|
s.required_ruby_version = '>= 2.0.0'
|
16
16
|
|
17
|
-
s.add_dependency('rdf', '
|
18
|
-
s.add_dependency('edtf', '~>2.
|
17
|
+
s.add_dependency('rdf', '>= 1.1', '< 3.0')
|
18
|
+
s.add_dependency('edtf', '~>2.2.0')
|
19
19
|
|
20
20
|
s.add_development_dependency('pry')
|
21
21
|
s.add_development_dependency('rspec')
|
data/spec/edtf_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-edtf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-11-17 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
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.1'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '3.0'
|
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
29
|
version: '1.1'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: edtf
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.
|
39
|
+
version: 2.2.0
|
34
40
|
type: :runtime
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
44
|
- - "~>"
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.
|
46
|
+
version: 2.2.0
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: pry
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,7 +88,7 @@ dependencies:
|
|
82
88
|
version: '0'
|
83
89
|
description: Supports serializing and parsing EDTF (all levels) as typed literals
|
84
90
|
in RDF.
|
85
|
-
email: tom@
|
91
|
+
email: tom@curationexperts.com
|
86
92
|
executables: []
|
87
93
|
extensions: []
|
88
94
|
extra_rdoc_files:
|
@@ -90,6 +96,7 @@ extra_rdoc_files:
|
|
90
96
|
- README.md
|
91
97
|
files:
|
92
98
|
- ".gitignore"
|
99
|
+
- ".travis.yml"
|
93
100
|
- CHANGELOG.md
|
94
101
|
- Gemfile
|
95
102
|
- README.md
|
@@ -101,8 +108,7 @@ files:
|
|
101
108
|
- rdf-edtf.gemspec
|
102
109
|
- spec/edtf_spec.rb
|
103
110
|
- spec/spec_helper.rb
|
104
|
-
|
105
|
-
homepage: https://github.com/dpla/rdf-edtf
|
111
|
+
homepage: https://github.com/no-reply/rdf-edtf
|
106
112
|
licenses:
|
107
113
|
- UNLICENSE
|
108
114
|
metadata: {}
|
@@ -122,9 +128,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
128
|
version: '0'
|
123
129
|
requirements: []
|
124
130
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.
|
131
|
+
rubygems_version: 2.6.13
|
126
132
|
signing_key:
|
127
133
|
specification_version: 4
|
128
134
|
summary: An `RDF::Literal` implementation around Extended Date Time Format.
|
129
135
|
test_files: []
|
130
|
-
has_rdoc:
|
@@ -1,123 +0,0 @@
|
|
1
|
-
|
2
|
-
shared_examples 'RDF::Literal with datatype' do |value, datatype_uri|
|
3
|
-
subject { described_class.new(value) }
|
4
|
-
|
5
|
-
it 'has a DATATYPE' do
|
6
|
-
expect(described_class::DATATYPE).to be_a RDF::URI
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'has a GRAMMAR' do
|
10
|
-
expect(described_class::GRAMMAR).to respond_to :=~
|
11
|
-
end
|
12
|
-
|
13
|
-
it { is_expected.to be_literal }
|
14
|
-
it { is_expected.to be_typed }
|
15
|
-
it { is_expected.not_to be_plain }
|
16
|
-
it { is_expected.not_to be_anonymous }
|
17
|
-
|
18
|
-
it 'has correct datatype' do
|
19
|
-
expect(subject.datatype).to eq datatype_uri
|
20
|
-
end
|
21
|
-
|
22
|
-
describe '#==' do
|
23
|
-
it { is_expected.to eq subject }
|
24
|
-
it { expect(subject.object).to eq value }
|
25
|
-
it { is_expected.not_to eq described_class.new('OTHER') }
|
26
|
-
it { is_expected.not_to eq nil }
|
27
|
-
end
|
28
|
-
|
29
|
-
describe '#humanize' do
|
30
|
-
it 'gives a string representation' do
|
31
|
-
expect(subject.humanize).to be_a String
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe '#to_s' do
|
36
|
-
it 'gives a string representation' do
|
37
|
-
expect(subject.to_s).to be_a String
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
describe '#object' do
|
42
|
-
it 'is the given value' do
|
43
|
-
expect(subject.humanize).to be_a String
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
shared_examples 'RDF::Literal lookup' do |uri_hash|
|
49
|
-
uri_hash.each do |uri, klass|
|
50
|
-
it "finds #{klass} for #{uri}" do
|
51
|
-
expect(RDF::Literal("0", :datatype => uri).class).to eq klass
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
shared_examples 'RDF::Literal canonicalization' do |datatype, pairs|
|
57
|
-
pairs.each do |value, str|
|
58
|
-
|
59
|
-
klass = RDF::Literal.datatyped_class(datatype.to_s)
|
60
|
-
|
61
|
-
it "does not normalize '#{value}' by default" do
|
62
|
-
expect(RDF::Literal.new(value,
|
63
|
-
datatype: datatype ,
|
64
|
-
canonicalize: false).to_s)
|
65
|
-
.to eq value
|
66
|
-
end
|
67
|
-
|
68
|
-
it "normalizes double '#{value}' to '#{str}'" do
|
69
|
-
expect(RDF::Literal.new(value,
|
70
|
-
datatype: datatype,
|
71
|
-
canonicalize: true).to_s)
|
72
|
-
.to eq str
|
73
|
-
end
|
74
|
-
|
75
|
-
it "humanizes double '#{value}' to '#{str}'" do
|
76
|
-
expect(RDF::Literal.new(value,
|
77
|
-
datatype: datatype,
|
78
|
-
canonicalize: false).humanize)
|
79
|
-
.to eq value
|
80
|
-
end
|
81
|
-
|
82
|
-
it "instantiates '#{value}' as #{klass}" do
|
83
|
-
expect(RDF::Literal.new(value,
|
84
|
-
datatype: datatype,
|
85
|
-
canonicalize: true))
|
86
|
-
.to be_a(klass)
|
87
|
-
end
|
88
|
-
|
89
|
-
it "causes normalized '#{value}' to be == '#{str}'" do
|
90
|
-
expect(RDF::Literal.new(value,
|
91
|
-
datatype: datatype,
|
92
|
-
canonicalize: true))
|
93
|
-
.to eq RDF::Literal.new(str, datatype: datatype, canonicalize: false)
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
shared_examples 'RDF::Literal validation' do |datatype,
|
99
|
-
valid_values,
|
100
|
-
invalid_values|
|
101
|
-
|
102
|
-
klass = RDF::Literal.datatyped_class(datatype.to_s)
|
103
|
-
|
104
|
-
valid_values.each do |value|
|
105
|
-
it "validates #{klass} '#{value}'" do
|
106
|
-
expect(RDF::Literal.new(value, datatype: datatype)).to be_valid
|
107
|
-
end
|
108
|
-
|
109
|
-
it "does not invalidate #{klass} '#{value}'" do
|
110
|
-
expect(RDF::Literal.new(value, datatype: datatype)).not_to be_invalid
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
invalid_values.each do |value|
|
115
|
-
it "invalidates #{klass} '#{value}'" do
|
116
|
-
expect(RDF::Literal.new(value, datatype: datatype)).to be_invalid
|
117
|
-
end
|
118
|
-
|
119
|
-
it "does not validate #{klass} '#{value}'" do
|
120
|
-
expect(RDF::Literal.new(value, datatype: datatype)).not_to be_valid
|
121
|
-
end
|
122
|
-
end
|
123
|
-
end
|