ldpath 0.3.1 → 1.0.0
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/.rubocop.yml +5 -4
- data/.rubocop_todo.yml +2 -33
- data/.travis.yml +4 -1
- data/CHANGELOG.md +98 -0
- data/CODE_OF_CONDUCT.md +36 -0
- data/CONTRIBUTING.md +161 -0
- data/Gemfile +6 -2
- data/README.md +31 -7
- data/SUPPORT.md +6 -0
- data/bin/ldpath +20 -12
- data/ldpath.gemspec +9 -4
- data/lib/ldpath/field_mapping.rb +43 -1
- data/lib/ldpath/functions.rb +84 -72
- data/lib/ldpath/parser.rb +31 -36
- data/lib/ldpath/program.rb +7 -62
- data/lib/ldpath/result.rb +83 -0
- data/lib/ldpath/selectors.rb +105 -28
- data/lib/ldpath/tests.rb +11 -13
- data/lib/ldpath/transform.rb +28 -27
- data/lib/ldpath/version.rb +1 -1
- data/lib/ldpath.rb +3 -4
- data/spec/fixtures/bbc_b0081dq5.nt +4 -0
- data/spec/fixtures/loc_n79021164.nt +3 -0
- data/spec/ldpath_parser_spec.rb +19 -1
- data/spec/ldpath_program_spec.rb +87 -32
- data/spec/ldpath_transform_spec.rb +10 -0
- data/spec/lib/functions/list_spec.rb +1 -1
- data/spec/spec_helper.rb +31 -1
- metadata +73 -9
- data/.rubocop_hound.yml +0 -1063
@@ -73,6 +73,16 @@ describe Ldpath::Transform do
|
|
73
73
|
expect(mapping.selector.property).to eq RDF::URI.new("info:a")
|
74
74
|
end
|
75
75
|
|
76
|
+
it "should transform negated property selectors" do
|
77
|
+
actual = subject.apply parser.parse("xyz = !info:a ;\n")
|
78
|
+
|
79
|
+
mapping = actual.first
|
80
|
+
expect(mapping).to be_a_kind_of Ldpath::FieldMapping
|
81
|
+
expect(mapping.name).to eq "xyz"
|
82
|
+
expect(mapping.selector).to be_a_kind_of Ldpath::NegatedPropertySelector
|
83
|
+
expect(mapping.selector.properties).to include RDF::URI.new("info:a")
|
84
|
+
end
|
85
|
+
|
76
86
|
describe "recursive properties" do
|
77
87
|
it "is a zero-or-one matcher" do
|
78
88
|
actual = subject.apply parser.parse("xyz = (info:a)? ;\n")
|
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,37 @@
|
|
1
1
|
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
|
-
require '
|
2
|
+
require 'simplecov'
|
3
|
+
SimpleCov.start
|
3
4
|
|
5
|
+
require 'ldpath'
|
4
6
|
require 'rdf/reasoner'
|
7
|
+
require 'webmock/rspec'
|
8
|
+
|
9
|
+
require 'simplecov'
|
10
|
+
require 'coveralls'
|
11
|
+
require 'byebug' unless ENV['TRAVIS']
|
5
12
|
|
6
13
|
RDF::Reasoner.apply(:rdfs)
|
7
14
|
RDF::Reasoner.apply(:owl)
|
15
|
+
|
16
|
+
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
|
17
|
+
SimpleCov.start('rails') do
|
18
|
+
add_filter '/.internal_test_app'
|
19
|
+
add_filter '/lib/generators'
|
20
|
+
add_filter '/spec'
|
21
|
+
add_filter '/tasks'
|
22
|
+
add_filter '/lib/qa/version.rb'
|
23
|
+
add_filter '/lib/qa/engine.rb'
|
24
|
+
end
|
25
|
+
SimpleCov.command_name 'spec'
|
26
|
+
Coveralls.wear!
|
27
|
+
|
28
|
+
def webmock_fixture(fixture)
|
29
|
+
File.new File.expand_path(File.join("../fixtures", fixture), __FILE__)
|
30
|
+
end
|
31
|
+
|
32
|
+
# returns the file contents
|
33
|
+
def load_fixture_file(fname)
|
34
|
+
File.open(Rails.root.join('spec', 'fixtures', fname)) do |f|
|
35
|
+
return f.read
|
36
|
+
end
|
37
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ldpath
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parslet
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: linkeddata
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '2.0'
|
34
34
|
type: :runtime
|
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: '0'
|
40
|
+
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.5'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: byebug
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rake
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +108,48 @@ dependencies:
|
|
94
108
|
- - ">="
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: simplecov
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: webmock
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
97
153
|
description:
|
98
154
|
email:
|
99
155
|
- cabeer@stanford.edu
|
@@ -105,13 +161,16 @@ files:
|
|
105
161
|
- ".gitignore"
|
106
162
|
- ".rspec"
|
107
163
|
- ".rubocop.yml"
|
108
|
-
- ".rubocop_hound.yml"
|
109
164
|
- ".rubocop_todo.yml"
|
110
165
|
- ".travis.yml"
|
166
|
+
- CHANGELOG.md
|
167
|
+
- CODE_OF_CONDUCT.md
|
168
|
+
- CONTRIBUTING.md
|
111
169
|
- Gemfile
|
112
170
|
- LICENSE.txt
|
113
171
|
- README.md
|
114
172
|
- Rakefile
|
173
|
+
- SUPPORT.md
|
115
174
|
- bin/ldpath
|
116
175
|
- ldpath.gemspec
|
117
176
|
- lib/ldpath.rb
|
@@ -119,11 +178,14 @@ files:
|
|
119
178
|
- lib/ldpath/functions.rb
|
120
179
|
- lib/ldpath/parser.rb
|
121
180
|
- lib/ldpath/program.rb
|
181
|
+
- lib/ldpath/result.rb
|
122
182
|
- lib/ldpath/selectors.rb
|
123
183
|
- lib/ldpath/tests.rb
|
124
184
|
- lib/ldpath/transform.rb
|
125
185
|
- lib/ldpath/version.rb
|
186
|
+
- spec/fixtures/bbc_b0081dq5.nt
|
126
187
|
- spec/fixtures/foaf_example.program
|
188
|
+
- spec/fixtures/loc_n79021164.nt
|
127
189
|
- spec/fixtures/namespaces.ldpath
|
128
190
|
- spec/fixtures/program.ldpath
|
129
191
|
- spec/ldpath_parser_spec.rb
|
@@ -132,7 +194,7 @@ files:
|
|
132
194
|
- spec/ldpath_transform_spec.rb
|
133
195
|
- spec/lib/functions/list_spec.rb
|
134
196
|
- spec/spec_helper.rb
|
135
|
-
homepage: https://github.com/
|
197
|
+
homepage: https://github.com/samvera-labs/ldpath
|
136
198
|
licenses:
|
137
199
|
- Apache 2
|
138
200
|
metadata: {}
|
@@ -152,12 +214,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
214
|
version: '0'
|
153
215
|
requirements: []
|
154
216
|
rubyforge_project:
|
155
|
-
rubygems_version: 2.
|
217
|
+
rubygems_version: 2.6.14
|
156
218
|
signing_key:
|
157
219
|
specification_version: 4
|
158
220
|
summary: Ruby implementation of LDPath
|
159
221
|
test_files:
|
222
|
+
- spec/fixtures/bbc_b0081dq5.nt
|
160
223
|
- spec/fixtures/foaf_example.program
|
224
|
+
- spec/fixtures/loc_n79021164.nt
|
161
225
|
- spec/fixtures/namespaces.ldpath
|
162
226
|
- spec/fixtures/program.ldpath
|
163
227
|
- spec/ldpath_parser_spec.rb
|