iqvoc_skosxl 2.8.1 → 2.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +176 -194
- data/app/controllers/labels_controller.rb +15 -1
- data/app/helpers/labels_helper.rb +1 -1
- data/app/models/label/relation/base.rb +1 -1
- data/app/models/label/relation/bidirectional_relation_extension.rb +47 -0
- data/app/models/label/skosxl/base.rb +27 -7
- data/app/models/label/skosxl/validations.rb +21 -2
- data/app/models/labeling/skosxl/base.rb +4 -0
- data/app/views/labels/_form.html.erb +4 -2
- data/app/views/partials/label/relation/_edit_base.html.erb +7 -9
- data/app/views/partials/labeling/skosxl/_edit_base.html.erb +1 -0
- data/config/locales/de.yml +1 -0
- data/config/locales/en.yml +1 -0
- data/db/schema.rb +5 -5
- data/iqvoc_skosxl.gemspec +2 -2
- data/lib/iqvoc/skosxl/version.rb +1 -1
- data/test/integration/label_creation_test.rb +16 -0
- data/test/integration/label_relation_test.rb +135 -0
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f38c524d54db4e897d951d428cadfd2fb4ebc87b
|
4
|
+
data.tar.gz: b3e1925374f843c2b089ef228ff41504d2285442
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc57417b3ee637a83d3723732761a58b23d90e949b5c6834d51aec39e5488a9756c5814a0ecfd60b958e9621667ae7aa092af98c01e1a06ffc72b8d2e5636b63
|
7
|
+
data.tar.gz: 9f7d8c3048efcf4d053d105ea51065e8933b2de52376598c1db7a0b43feabcb0158415bd2fa153c4e3f80734dcd94894fcff3308eeb4d9901e39cc703bbedee1
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
GIT
|
2
2
|
remote: git://github.com/innoq/iqvoc.git
|
3
|
-
revision:
|
3
|
+
revision: 0b0a87123de77cc94dbf0049c0270f5948651a44
|
4
4
|
branch: master
|
5
5
|
specs:
|
6
|
-
iqvoc (4.
|
6
|
+
iqvoc (4.11.1)
|
7
7
|
apipie-rails (~> 0.3.5)
|
8
8
|
authlogic (~> 3.4.2)
|
9
|
-
autoprefixer-rails (~> 5.1.
|
9
|
+
autoprefixer-rails (~> 6.5.1.1)
|
10
10
|
bootstrap-sass (~> 3.3.1.0)
|
11
11
|
bootstrap_form (~> 2.2.0)
|
12
12
|
bundler
|
13
13
|
cancancan
|
14
14
|
carrierwave
|
15
15
|
database_cleaner
|
16
|
-
delayed_job_active_record (~> 4.
|
16
|
+
delayed_job_active_record (~> 4.1.1)
|
17
17
|
faraday (= 0.9.0)
|
18
18
|
faraday_middleware
|
19
19
|
font-awesome-rails (~> 4.2.0)
|
@@ -22,10 +22,10 @@ GIT
|
|
22
22
|
json
|
23
23
|
kaminari
|
24
24
|
kaminari-bootstrap (~> 3.0.1)
|
25
|
-
linkeddata
|
25
|
+
linkeddata (~> 1.1.2)
|
26
26
|
maruku
|
27
|
-
nokogiri
|
28
|
-
rails (
|
27
|
+
nokogiri (~> 1.6.0)
|
28
|
+
rails (>= 4.2.8, < 5.0)
|
29
29
|
rails_autolink
|
30
30
|
sass-rails (~> 5.0.0)
|
31
31
|
uglifier (>= 1.3.0)
|
@@ -33,246 +33,235 @@ GIT
|
|
33
33
|
GEM
|
34
34
|
remote: https://rubygems.org/
|
35
35
|
specs:
|
36
|
-
actionmailer (4.2.
|
37
|
-
actionpack (= 4.2.
|
38
|
-
actionview (= 4.2.
|
39
|
-
activejob (= 4.2.
|
36
|
+
actionmailer (4.2.8)
|
37
|
+
actionpack (= 4.2.8)
|
38
|
+
actionview (= 4.2.8)
|
39
|
+
activejob (= 4.2.8)
|
40
40
|
mail (~> 2.5, >= 2.5.4)
|
41
41
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
42
|
-
actionpack (4.2.
|
43
|
-
actionview (= 4.2.
|
44
|
-
activesupport (= 4.2.
|
42
|
+
actionpack (4.2.8)
|
43
|
+
actionview (= 4.2.8)
|
44
|
+
activesupport (= 4.2.8)
|
45
45
|
rack (~> 1.6)
|
46
46
|
rack-test (~> 0.6.2)
|
47
47
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
48
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
49
|
-
actionview (4.2.
|
50
|
-
activesupport (= 4.2.
|
48
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
49
|
+
actionview (4.2.8)
|
50
|
+
activesupport (= 4.2.8)
|
51
51
|
builder (~> 3.1)
|
52
52
|
erubis (~> 2.7.0)
|
53
53
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
54
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
55
|
-
activejob (4.2.
|
56
|
-
activesupport (= 4.2.
|
54
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
55
|
+
activejob (4.2.8)
|
56
|
+
activesupport (= 4.2.8)
|
57
57
|
globalid (>= 0.3.0)
|
58
|
-
activemodel (4.2.
|
59
|
-
activesupport (= 4.2.
|
58
|
+
activemodel (4.2.8)
|
59
|
+
activesupport (= 4.2.8)
|
60
60
|
builder (~> 3.1)
|
61
|
-
activerecord (4.2.
|
62
|
-
activemodel (= 4.2.
|
63
|
-
activesupport (= 4.2.
|
61
|
+
activerecord (4.2.8)
|
62
|
+
activemodel (= 4.2.8)
|
63
|
+
activesupport (= 4.2.8)
|
64
64
|
arel (~> 6.0)
|
65
|
-
|
66
|
-
activerecord (>= 2.2)
|
67
|
-
activerecord-jdbcmysql-adapter (1.3.14)
|
68
|
-
activerecord-jdbc-adapter (~> 1.3.14)
|
69
|
-
jdbc-mysql (>= 5.1.22)
|
70
|
-
activerecord-jdbcpostgresql-adapter (1.3.14)
|
71
|
-
activerecord-jdbc-adapter (~> 1.3.14)
|
72
|
-
jdbc-postgres (>= 9.1)
|
73
|
-
activerecord-jdbcsqlite3-adapter (1.3.14)
|
74
|
-
activerecord-jdbc-adapter (~> 1.3.14)
|
75
|
-
jdbc-sqlite3 (>= 3.7.2, < 3.9)
|
76
|
-
activesupport (4.2.1)
|
65
|
+
activesupport (4.2.8)
|
77
66
|
i18n (~> 0.7)
|
78
|
-
json (~> 1.7, >= 1.7.7)
|
79
67
|
minitest (~> 5.1)
|
80
68
|
thread_safe (~> 0.3, >= 0.3.4)
|
81
69
|
tzinfo (~> 1.1)
|
82
|
-
addressable (2.
|
83
|
-
|
70
|
+
addressable (2.5.0)
|
71
|
+
public_suffix (~> 2.0, >= 2.0.2)
|
72
|
+
apipie-rails (0.3.7)
|
84
73
|
json
|
85
|
-
arel (6.0.
|
74
|
+
arel (6.0.4)
|
86
75
|
authlogic (3.4.6)
|
87
76
|
activerecord (>= 3.2)
|
88
77
|
activesupport (>= 3.2)
|
89
78
|
request_store (~> 1.0)
|
90
79
|
scrypt (>= 1.2, < 3.0)
|
91
|
-
autoprefixer-rails (5.1.
|
80
|
+
autoprefixer-rails (6.5.1.1)
|
92
81
|
execjs
|
93
|
-
|
94
|
-
awesome_print (1.6.1)
|
82
|
+
awesome_print (1.7.0)
|
95
83
|
bcp47 (0.3.3)
|
96
84
|
i18n
|
97
85
|
bootstrap-sass (3.3.1.0)
|
98
86
|
sass (~> 3.2)
|
99
87
|
bootstrap_form (2.2.0)
|
100
|
-
builder (3.2.
|
101
|
-
cancancan (
|
102
|
-
capybara (2.
|
88
|
+
builder (3.2.3)
|
89
|
+
cancancan (2.0.0)
|
90
|
+
capybara (2.10.1)
|
91
|
+
addressable
|
103
92
|
mime-types (>= 1.16)
|
104
93
|
nokogiri (>= 1.3.3)
|
105
94
|
rack (>= 1.0.0)
|
106
95
|
rack-test (>= 0.5.4)
|
107
96
|
xpath (~> 2.0)
|
108
|
-
carrierwave (
|
109
|
-
activemodel (>=
|
110
|
-
activesupport (>=
|
111
|
-
json (>= 1.7)
|
97
|
+
carrierwave (1.1.0)
|
98
|
+
activemodel (>= 4.0.0)
|
99
|
+
activesupport (>= 4.0.0)
|
112
100
|
mime-types (>= 1.16)
|
113
101
|
cliver (0.3.2)
|
114
|
-
coderay (1.1.
|
115
|
-
concurrent-ruby (1.0.
|
116
|
-
database_cleaner (1.
|
117
|
-
delayed_job (4.
|
118
|
-
activesupport (>= 3.0, < 5.
|
119
|
-
delayed_job_active_record (4.
|
120
|
-
activerecord (>= 3.0, < 5.
|
121
|
-
delayed_job (>= 3.0, <
|
122
|
-
ebnf (
|
102
|
+
coderay (1.1.1)
|
103
|
+
concurrent-ruby (1.0.5)
|
104
|
+
database_cleaner (1.6.1)
|
105
|
+
delayed_job (4.1.2)
|
106
|
+
activesupport (>= 3.0, < 5.1)
|
107
|
+
delayed_job_active_record (4.1.1)
|
108
|
+
activerecord (>= 3.0, < 5.1)
|
109
|
+
delayed_job (>= 3.0, < 5)
|
110
|
+
ebnf (0.3.9)
|
123
111
|
rdf (~> 1.1)
|
124
112
|
sxp (~> 0.1, >= 0.1.3)
|
125
113
|
equivalent-xml (0.6.0)
|
126
114
|
nokogiri (>= 1.4.3)
|
127
115
|
erubis (2.7.0)
|
128
|
-
execjs (2.
|
116
|
+
execjs (2.7.0)
|
129
117
|
faraday (0.9.0)
|
130
118
|
multipart-post (>= 1.2, < 3)
|
131
|
-
faraday_middleware (0.
|
132
|
-
faraday (>= 0.7.4, < 0
|
133
|
-
ffi (1.9.
|
134
|
-
ffi (1.
|
135
|
-
ffi-compiler (0.1.3)
|
119
|
+
faraday_middleware (0.11.0.1)
|
120
|
+
faraday (>= 0.7.4, < 1.0)
|
121
|
+
ffi (1.9.18)
|
122
|
+
ffi-compiler (1.0.1)
|
136
123
|
ffi (>= 1.0.0)
|
137
124
|
rake
|
138
125
|
font-awesome-rails (4.2.0.0)
|
139
126
|
railties (>= 3.2, < 5.0)
|
140
|
-
globalid (0.
|
141
|
-
activesupport (>= 4.
|
127
|
+
globalid (0.4.0)
|
128
|
+
activesupport (>= 4.2.0)
|
142
129
|
haml (4.0.7)
|
143
130
|
tilt
|
144
131
|
htmlentities (4.3.4)
|
145
|
-
i18n (0.
|
132
|
+
i18n (0.8.1)
|
146
133
|
iq_rdf (0.1.15)
|
147
134
|
activesupport
|
148
135
|
builder
|
149
136
|
bundler
|
150
137
|
iq_triplestorage (0.2.2)
|
151
|
-
|
152
|
-
|
153
|
-
jdbc-sqlite3 (3.8.7)
|
154
|
-
json (1.8.2)
|
155
|
-
json (1.8.2-java)
|
156
|
-
json-ld (1.99.0)
|
138
|
+
json (2.1.0)
|
139
|
+
json-ld (1.1.11.1)
|
157
140
|
multi_json (~> 1.11)
|
158
|
-
rdf (~> 1.99)
|
159
|
-
kaminari (0.
|
160
|
-
|
161
|
-
|
141
|
+
rdf (~> 1.1, >= 1.1.17, < 1.99)
|
142
|
+
kaminari (1.0.1)
|
143
|
+
activesupport (>= 4.1.0)
|
144
|
+
kaminari-actionview (= 1.0.1)
|
145
|
+
kaminari-activerecord (= 1.0.1)
|
146
|
+
kaminari-core (= 1.0.1)
|
147
|
+
kaminari-actionview (1.0.1)
|
148
|
+
actionview
|
149
|
+
kaminari-core (= 1.0.1)
|
150
|
+
kaminari-activerecord (1.0.1)
|
151
|
+
activerecord
|
152
|
+
kaminari-core (= 1.0.1)
|
162
153
|
kaminari-bootstrap (3.0.1)
|
163
154
|
kaminari (>= 0.13.0)
|
164
155
|
rails
|
156
|
+
kaminari-core (1.0.1)
|
165
157
|
link_header (0.0.8)
|
166
|
-
linkeddata (1.
|
167
|
-
equivalent-xml (~> 0.
|
168
|
-
json-ld (~> 1.99)
|
158
|
+
linkeddata (1.1.11.2)
|
159
|
+
equivalent-xml (~> 0.5)
|
160
|
+
json-ld (~> 1.1, >= 1.1.8, < 1.99)
|
169
161
|
nokogiri (~> 1.6)
|
170
|
-
rdf (~> 1.99)
|
171
|
-
rdf-aggregate-repo (~> 1.99)
|
172
|
-
rdf-isomorphic (~> 1.99)
|
173
|
-
rdf-json (~> 1.1, >= 1.1.2)
|
174
|
-
rdf-microdata (~> 2.0, >= 2.0.
|
175
|
-
rdf-n3 (~> 1.99)
|
176
|
-
rdf-rdfa (~> 1.99)
|
177
|
-
rdf-rdfxml (~> 1.1, >= 1.1.
|
178
|
-
rdf-reasoner (~> 0.
|
179
|
-
rdf-tabular (~> 0.
|
180
|
-
rdf-trig (~> 1.
|
181
|
-
rdf-trix (~> 1.99)
|
182
|
-
rdf-turtle (~> 1.99)
|
183
|
-
rdf-vocab (~> 0.8
|
184
|
-
rdf-xsd (~> 1.1, >= 1.1.
|
185
|
-
sparql (~> 1.99)
|
186
|
-
sparql-client (~> 1.99)
|
162
|
+
rdf (~> 1.1, >= 1.1.11, < 1.99)
|
163
|
+
rdf-aggregate-repo (~> 1.1, < 1.99)
|
164
|
+
rdf-isomorphic (~> 1.1, < 1.99)
|
165
|
+
rdf-json (~> 1.1, >= 1.1.2, < 1.99)
|
166
|
+
rdf-microdata (~> 2.0, >= 2.0.1)
|
167
|
+
rdf-n3 (~> 1.1, >= 1.1.3, < 1.99)
|
168
|
+
rdf-rdfa (~> 1.1, >= 1.1.6, < 1.99)
|
169
|
+
rdf-rdfxml (~> 1.1, >= 1.1.4, < 1.99)
|
170
|
+
rdf-reasoner (~> 0.2, >= 0.2.1, < 1.99)
|
171
|
+
rdf-tabular (~> 0.1, >= 0.1.2)
|
172
|
+
rdf-trig (~> 1.1, >= 1.1.4, < 1.99)
|
173
|
+
rdf-trix (~> 1.1, < 1.99)
|
174
|
+
rdf-turtle (~> 1.1, >= 1.1.6, < 1.99)
|
175
|
+
rdf-vocab (~> 0.8)
|
176
|
+
rdf-xsd (~> 1.1, >= 1.1.3, < 1.99)
|
177
|
+
sparql (~> 1.1, >= 1.1.5, < 1.99)
|
178
|
+
sparql-client (~> 1.1, >= 1.1.3, < 1.99)
|
187
179
|
loofah (2.0.3)
|
188
180
|
nokogiri (>= 1.5.9)
|
189
|
-
mail (2.6.
|
190
|
-
mime-types (>= 1.16, <
|
191
|
-
maruku (0.7.
|
181
|
+
mail (2.6.5)
|
182
|
+
mime-types (>= 1.16, < 4)
|
183
|
+
maruku (0.7.3)
|
192
184
|
method_source (0.8.2)
|
193
|
-
mime-types (
|
194
|
-
|
195
|
-
|
196
|
-
|
185
|
+
mime-types (3.1)
|
186
|
+
mime-types-data (~> 3.2015)
|
187
|
+
mime-types-data (3.2016.0521)
|
188
|
+
mini_portile2 (2.1.0)
|
189
|
+
minitest (5.10.2)
|
190
|
+
multi_json (1.12.1)
|
197
191
|
multipart-post (2.0.0)
|
198
|
-
mysql2 (0.
|
192
|
+
mysql2 (0.4.5)
|
199
193
|
net-http-persistent (2.9.4)
|
200
|
-
nokogiri (1.6.
|
201
|
-
|
202
|
-
|
203
|
-
pg (0.18.1)
|
194
|
+
nokogiri (1.6.8.1)
|
195
|
+
mini_portile2 (~> 2.1.0)
|
196
|
+
pg (0.20.0)
|
204
197
|
poltergeist (1.5.1)
|
205
198
|
capybara (~> 2.1)
|
206
199
|
cliver (~> 0.3.1)
|
207
200
|
multi_json (~> 1.0)
|
208
201
|
websocket-driver (>= 0.2.0)
|
209
|
-
pry (0.10.
|
210
|
-
coderay (~> 1.1.0)
|
211
|
-
method_source (~> 0.8.1)
|
212
|
-
slop (~> 3.4)
|
213
|
-
pry (0.10.1-java)
|
202
|
+
pry (0.10.4)
|
214
203
|
coderay (~> 1.1.0)
|
215
204
|
method_source (~> 0.8.1)
|
216
205
|
slop (~> 3.4)
|
217
|
-
|
218
|
-
pry-rails (0.3.3)
|
206
|
+
pry-rails (0.3.4)
|
219
207
|
pry (>= 0.9.10)
|
220
|
-
|
208
|
+
public_suffix (2.0.4)
|
209
|
+
rack (1.6.4)
|
221
210
|
rack-test (0.6.3)
|
222
211
|
rack (>= 1.0)
|
223
|
-
rails (4.2.
|
224
|
-
actionmailer (= 4.2.
|
225
|
-
actionpack (= 4.2.
|
226
|
-
actionview (= 4.2.
|
227
|
-
activejob (= 4.2.
|
228
|
-
activemodel (= 4.2.
|
229
|
-
activerecord (= 4.2.
|
230
|
-
activesupport (= 4.2.
|
212
|
+
rails (4.2.8)
|
213
|
+
actionmailer (= 4.2.8)
|
214
|
+
actionpack (= 4.2.8)
|
215
|
+
actionview (= 4.2.8)
|
216
|
+
activejob (= 4.2.8)
|
217
|
+
activemodel (= 4.2.8)
|
218
|
+
activerecord (= 4.2.8)
|
219
|
+
activesupport (= 4.2.8)
|
231
220
|
bundler (>= 1.3.0, < 2.0)
|
232
|
-
railties (= 4.2.
|
221
|
+
railties (= 4.2.8)
|
233
222
|
sprockets-rails
|
234
223
|
rails-deprecated_sanitizer (1.0.3)
|
235
224
|
activesupport (>= 4.2.0.alpha)
|
236
|
-
rails-dom-testing (1.0.
|
225
|
+
rails-dom-testing (1.0.8)
|
237
226
|
activesupport (>= 4.2.0.beta, < 5.0)
|
238
|
-
nokogiri (~> 1.6
|
227
|
+
nokogiri (~> 1.6)
|
239
228
|
rails-deprecated_sanitizer (>= 1.0.1)
|
240
229
|
rails-html-sanitizer (1.0.3)
|
241
230
|
loofah (~> 2.0)
|
242
231
|
rails_autolink (1.1.6)
|
243
232
|
rails (> 3.1)
|
244
|
-
railties (4.2.
|
245
|
-
actionpack (= 4.2.
|
246
|
-
activesupport (= 4.2.
|
233
|
+
railties (4.2.8)
|
234
|
+
actionpack (= 4.2.8)
|
235
|
+
activesupport (= 4.2.8)
|
247
236
|
rake (>= 0.8.7)
|
248
237
|
thor (>= 0.18.1, < 2.0)
|
249
|
-
rake (
|
250
|
-
rdf (1.
|
238
|
+
rake (12.0.0)
|
239
|
+
rdf (1.1.17.1)
|
251
240
|
link_header (~> 0.0, >= 0.0.8)
|
252
|
-
rdf-aggregate-repo (1.
|
253
|
-
rdf (~> 1.99)
|
254
|
-
rdf-isomorphic (1.
|
255
|
-
rdf (~> 1.99)
|
256
|
-
rdf-json (1.
|
257
|
-
rdf (~> 1.99)
|
241
|
+
rdf-aggregate-repo (1.1.0.1)
|
242
|
+
rdf (~> 1.1, < 1.99)
|
243
|
+
rdf-isomorphic (1.1.0.2)
|
244
|
+
rdf (~> 1.1, >= 1.1.17, < 1.99)
|
245
|
+
rdf-json (1.1.2.1)
|
246
|
+
rdf (~> 1.1, < 1.99)
|
258
247
|
rdf-microdata (2.0.2)
|
259
248
|
htmlentities (~> 4.3)
|
260
249
|
nokogiri (~> 1.6)
|
261
250
|
rdf (~> 1.1)
|
262
251
|
rdf-xsd (~> 1.1)
|
263
|
-
rdf-n3 (1.
|
264
|
-
rdf (~> 1.99)
|
265
|
-
rdf-rdfa (1.
|
252
|
+
rdf-n3 (1.1.3.1)
|
253
|
+
rdf (~> 1.1, >= 1.1.17, < 1.99)
|
254
|
+
rdf-rdfa (1.1.6.1)
|
266
255
|
haml (~> 4.0)
|
267
256
|
htmlentities (~> 4.3)
|
268
|
-
rdf (~> 1.99)
|
269
|
-
rdf-aggregate-repo (~> 1.1)
|
270
|
-
rdf-xsd (~> 1.1)
|
271
|
-
rdf-rdfxml (1.
|
257
|
+
rdf (~> 1.1, >= 1.1.6, < 1.99)
|
258
|
+
rdf-aggregate-repo (~> 1.1, < 1.99)
|
259
|
+
rdf-xsd (~> 1.1, < 1.99)
|
260
|
+
rdf-rdfxml (1.1.5.1)
|
272
261
|
htmlentities (~> 4.3)
|
273
|
-
rdf (~> 1.99)
|
274
|
-
rdf-rdfa (~> 1.99)
|
275
|
-
rdf-xsd (~> 1.99)
|
262
|
+
rdf (~> 1.1, >= 1.1.6, < 1.99)
|
263
|
+
rdf-rdfa (~> 1.1, >= 1.1.4.1, < 1.99)
|
264
|
+
rdf-xsd (~> 1.1, < 1.99)
|
276
265
|
rdf-reasoner (0.3.0)
|
277
266
|
rdf (~> 1.1, >= 1.1.4.2)
|
278
267
|
rdf-turtle (~> 1.1)
|
@@ -285,72 +274,65 @@ GEM
|
|
285
274
|
rdf (~> 1.1, >= 1.1.7)
|
286
275
|
rdf-vocab (~> 0.8)
|
287
276
|
rdf-xsd (~> 1.1)
|
288
|
-
rdf-trig (1.
|
289
|
-
ebnf (~>
|
290
|
-
rdf (~> 1.99)
|
291
|
-
rdf-turtle (~> 1.99)
|
292
|
-
rdf-trix (1.
|
293
|
-
rdf (~> 1.1)
|
294
|
-
rdf-turtle (1.
|
295
|
-
ebnf (~>
|
296
|
-
rdf (~> 1.99)
|
297
|
-
rdf-vocab (0.8.7.1)
|
277
|
+
rdf-trig (1.1.5.1)
|
278
|
+
ebnf (~> 0.3, >= 0.3.7)
|
279
|
+
rdf (~> 1.1, >= 1.1.11, < 1.99)
|
280
|
+
rdf-turtle (~> 1.1, >= 1.1.7, < 1.99)
|
281
|
+
rdf-trix (1.1.0.1)
|
282
|
+
rdf (~> 1.1, < 1.99)
|
283
|
+
rdf-turtle (1.1.8)
|
284
|
+
ebnf (~> 0.3, >= 0.3.6)
|
298
285
|
rdf (~> 1.1, >= 1.1.10)
|
299
|
-
rdf-
|
300
|
-
rdf (~> 1.
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
286
|
+
rdf-vocab (0.8.8)
|
287
|
+
rdf (~> 1.1, >= 1.1.10)
|
288
|
+
rdf-xsd (1.1.5.1)
|
289
|
+
rdf (~> 1.1, >= 1.1.9, < 1.99)
|
290
|
+
request_store (1.3.2)
|
291
|
+
sass (3.4.24)
|
292
|
+
sass-rails (5.0.6)
|
293
|
+
railties (>= 4.0.0, < 6)
|
305
294
|
sass (~> 3.1)
|
306
295
|
sprockets (>= 2.8, < 4.0)
|
307
296
|
sprockets-rails (>= 2.0, < 4.0)
|
308
297
|
tilt (>= 1.1, < 3)
|
309
|
-
scrypt (2.
|
298
|
+
scrypt (2.1.1)
|
310
299
|
ffi-compiler (>= 0.0.2)
|
311
300
|
rake
|
312
301
|
slop (3.6.0)
|
313
|
-
sparql (1.
|
302
|
+
sparql (1.1.9)
|
314
303
|
builder (~> 3.2)
|
315
|
-
ebnf (~>
|
316
|
-
rdf (~> 1.
|
317
|
-
rdf-aggregate-repo (~> 1.
|
304
|
+
ebnf (~> 0.3, >= 0.3.9)
|
305
|
+
rdf (~> 1.1, >= 1.1.13)
|
306
|
+
rdf-aggregate-repo (~> 1.1, >= 1.1.0)
|
318
307
|
rdf-xsd (~> 1.1)
|
319
308
|
sparql-client (~> 1.1)
|
320
309
|
sxp (~> 0.1)
|
321
|
-
sparql-client (1.
|
310
|
+
sparql-client (1.1.6.1)
|
322
311
|
net-http-persistent (~> 2.9)
|
323
|
-
rdf (~> 1.1)
|
324
|
-
|
325
|
-
ffi
|
326
|
-
sprockets (3.5.2)
|
312
|
+
rdf (~> 1.1, < 1.99)
|
313
|
+
sprockets (3.7.1)
|
327
314
|
concurrent-ruby (~> 1.0)
|
328
315
|
rack (> 1, < 3)
|
329
|
-
sprockets-rails (3.0
|
316
|
+
sprockets-rails (3.2.0)
|
330
317
|
actionpack (>= 4.0)
|
331
318
|
activesupport (>= 4.0)
|
332
319
|
sprockets (>= 3.0.0)
|
333
|
-
sqlite3 (1.3.
|
320
|
+
sqlite3 (1.3.13)
|
334
321
|
sxp (0.1.5)
|
335
|
-
thor (0.19.
|
336
|
-
thread_safe (0.3.
|
337
|
-
|
338
|
-
|
339
|
-
tzinfo (1.2.2)
|
322
|
+
thor (0.19.4)
|
323
|
+
thread_safe (0.3.6)
|
324
|
+
tilt (2.0.7)
|
325
|
+
tzinfo (1.2.3)
|
340
326
|
thread_safe (~> 0.1)
|
341
|
-
uglifier (2.
|
342
|
-
execjs (>= 0.3.0)
|
343
|
-
|
344
|
-
websocket-driver (0.5.1)
|
345
|
-
websocket-extensions (>= 0.1.0)
|
346
|
-
websocket-driver (0.5.1-java)
|
327
|
+
uglifier (3.2.0)
|
328
|
+
execjs (>= 0.3.0, < 3)
|
329
|
+
websocket-driver (0.6.4)
|
347
330
|
websocket-extensions (>= 0.1.0)
|
348
|
-
websocket-extensions (0.1.
|
331
|
+
websocket-extensions (0.1.2)
|
349
332
|
xpath (2.0.0)
|
350
333
|
nokogiri (~> 1.3)
|
351
334
|
|
352
335
|
PLATFORMS
|
353
|
-
java
|
354
336
|
ruby
|
355
337
|
|
356
338
|
DEPENDENCIES
|
@@ -359,7 +341,7 @@ DEPENDENCIES
|
|
359
341
|
activerecord-jdbcsqlite3-adapter
|
360
342
|
awesome_print
|
361
343
|
capybara
|
362
|
-
iqvoc (~> 4.
|
344
|
+
iqvoc (~> 4.11.0)!
|
363
345
|
mysql2
|
364
346
|
pg
|
365
347
|
poltergeist (~> 1.5.0)
|
@@ -367,4 +349,4 @@ DEPENDENCIES
|
|
367
349
|
sqlite3
|
368
350
|
|
369
351
|
BUNDLED WITH
|
370
|
-
1.
|
352
|
+
1.15.0
|
@@ -4,7 +4,7 @@ class LabelsController < ApplicationController
|
|
4
4
|
def index
|
5
5
|
authorize! :read, Iqvoc::XLLabel.base_class
|
6
6
|
|
7
|
-
scope = Iqvoc::XLLabel.base_class.by_query_value("
|
7
|
+
scope = Iqvoc::XLLabel.base_class.by_query_value("%#{params[:query]}%")
|
8
8
|
if params[:language] # NB: this is not the same as :lang, which is supplied via route
|
9
9
|
scope = scope.by_language(params[:language])
|
10
10
|
end
|
@@ -53,6 +53,20 @@ class LabelsController < ApplicationController
|
|
53
53
|
def new
|
54
54
|
authorize! :create, Iqvoc::XLLabel.base_class
|
55
55
|
@label = Iqvoc::XLLabel.base_class.new
|
56
|
+
|
57
|
+
# initial created-ChangeNote creation
|
58
|
+
@label.send(Iqvoc::change_note_class_name.to_relation_name).new do |change_note|
|
59
|
+
change_note.value = I18n.t('txt.views.versioning.initial_version')
|
60
|
+
change_note.language = I18n.locale.to_s
|
61
|
+
change_note.annotations_attributes = [
|
62
|
+
{ namespace: 'dct', predicate: 'creator', value: current_user.name },
|
63
|
+
{ namespace: 'dct', predicate: 'created', value: DateTime.now.to_s }
|
64
|
+
]
|
65
|
+
end
|
66
|
+
|
67
|
+
Iqvoc::XLLabel.note_class_names.each do |note_class_name|
|
68
|
+
@label.send(note_class_name.to_relation_name).build if @label.send(note_class_name.to_relation_name).empty?
|
69
|
+
end
|
56
70
|
end
|
57
71
|
|
58
72
|
def create
|
@@ -2,7 +2,7 @@ module LabelsHelper
|
|
2
2
|
def render_label_rdf(document, label)
|
3
3
|
document << label.build_rdf_subject do |c|
|
4
4
|
|
5
|
-
c.Schema::expires(label.expired_at) if label.expired_at
|
5
|
+
c.Schema::expires(label.expired_at.to_s) if label.expired_at
|
6
6
|
|
7
7
|
c.Owl::deprecated(true) if label.expired_at and label.expired_at <= Date.new
|
8
8
|
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
# Copyright 2011-2016 innoQ Deutschland GmbH
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
module Label
|
18
|
+
module Relation
|
19
|
+
module BidirectionalRelationExtension
|
20
|
+
def create_with_bidirectional_relation(target_label, attributes = {})
|
21
|
+
relation_class = proxy_association.reflection.class_name.constantize
|
22
|
+
ActiveRecord::Base.transaction do
|
23
|
+
# The one direction
|
24
|
+
scope = relation_class.where(domain_id: proxy_association.owner.id, range_id: target_label.id)
|
25
|
+
scope.any? || scope.create!(attributes)
|
26
|
+
|
27
|
+
# The bidirectional direction
|
28
|
+
scope = relation_class.where(domain_id: target_label.id, range_id: proxy_association.owner.id)
|
29
|
+
scope.any? || scope.create!(attributes)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def destroy_with_bidirectional_relation(target_label)
|
34
|
+
relation_class = proxy_association.reflection.class_name.constantize
|
35
|
+
ActiveRecord::Base.transaction do
|
36
|
+
relation_class.where(domain_id: proxy_association.owner.id, range_id: target_label.id).load.each do |relation|
|
37
|
+
relation.destroy
|
38
|
+
end
|
39
|
+
|
40
|
+
relation_class.where(domain_id: target_label.id, range_id: proxy_association.owner.id).load.each do |relation|
|
41
|
+
relation.destroy
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -19,13 +19,25 @@ class Label::SKOSXL::Base < Label::Base
|
|
19
19
|
|
20
20
|
after_save do |label|
|
21
21
|
# Handle save or destruction of inline relations for use with widgets
|
22
|
-
(@inline_assigned_relations ||= {}).each do |relation_class_name,
|
23
|
-
# Remove all associated labelings of the given type
|
24
|
-
label.send(relation_class_name.to_relation_name).
|
22
|
+
(@inline_assigned_relations ||= {}).each do |relation_class_name, new_origins|
|
23
|
+
# Remove all existing associated labelings of the given type
|
24
|
+
existing_origins = label.send(relation_class_name.to_relation_name).map { |r| r.range.origin }.uniq
|
25
|
+
Iqvoc::XLLabel.base_class.by_origin(existing_origins).each do |l|
|
26
|
+
if relation_class_name.constantize.bidirectional?
|
27
|
+
label.send(relation_class_name.to_relation_name).destroy_with_bidirectional_relation(l)
|
28
|
+
else
|
29
|
+
relation = label.send(relation_class_name.to_relation_name).find_by(range: l)
|
30
|
+
relation.destroy if relation
|
31
|
+
end
|
32
|
+
end
|
25
33
|
|
26
34
|
# Recreate relations reflecting the widget's parameters
|
27
|
-
Iqvoc::XLLabel.base_class.by_origin(
|
28
|
-
|
35
|
+
Iqvoc::XLLabel.base_class.by_origin(new_origins).each do |l|
|
36
|
+
if relation_class_name.constantize.bidirectional?
|
37
|
+
label.send(relation_class_name.to_relation_name).create_with_bidirectional_relation(l)
|
38
|
+
else
|
39
|
+
label.send(relation_class_name.to_relation_name).create(range: l)
|
40
|
+
end
|
29
41
|
end
|
30
42
|
end
|
31
43
|
end
|
@@ -58,6 +70,12 @@ class Label::SKOSXL::Base < Label::Base
|
|
58
70
|
has_many relation_class_name.to_relation_name,
|
59
71
|
foreign_key: 'domain_id',
|
60
72
|
class_name: relation_class_name,
|
73
|
+
extend: Label::Relation::BidirectionalRelationExtension,
|
74
|
+
dependent: :destroy
|
75
|
+
|
76
|
+
has_many "#{relation_class_name.to_relation_name}_of".to_sym,
|
77
|
+
foreign_key: 'range_id',
|
78
|
+
class_name: relation_class_name,
|
61
79
|
dependent: :destroy
|
62
80
|
|
63
81
|
# Serialized setters and getters (\r\n or , separated)
|
@@ -164,9 +182,11 @@ class Label::SKOSXL::Base < Label::Base
|
|
164
182
|
labelings.select{ |l| l.class.name == labeling_class.to_s }.map(&:owner)
|
165
183
|
end
|
166
184
|
|
167
|
-
def related_labels_for_relation_class(relation_class)
|
185
|
+
def related_labels_for_relation_class(relation_class, only_published = true)
|
168
186
|
relation_class = relation_class.name if relation_class < ActiveRecord::Base # Use the class name string
|
169
|
-
relations.select{ |rel| rel.class.name == relation_class }
|
187
|
+
relations.select { |rel| rel.class.name == relation_class }
|
188
|
+
.map(&:range)
|
189
|
+
.select { |l| l.published? || !only_published }
|
170
190
|
end
|
171
191
|
|
172
192
|
def notes_for_class(note_class)
|
@@ -8,8 +8,10 @@ module Label
|
|
8
8
|
validates :origin, uniqueness: { scope: :rev }
|
9
9
|
validate :origin_has_to_be_escaped
|
10
10
|
|
11
|
-
|
11
|
+
# publishing validations
|
12
12
|
validates :value, presence: true, if: :validatable_for_publishing?
|
13
|
+
validate :pref_label_language, if: :validatable_for_publishing?
|
14
|
+
validate :referenced_published_concepts_have_main_language_pref_label, if: :validatable_for_publishing?
|
13
15
|
end
|
14
16
|
|
15
17
|
def origin_has_to_be_escaped
|
@@ -19,11 +21,28 @@ module Label
|
|
19
21
|
end
|
20
22
|
|
21
23
|
def pref_label_language
|
22
|
-
|
24
|
+
invalid_pref_label_language = ::Iqvoc::Concept.pref_labeling_languages.exclude?(language)
|
25
|
+
has_pref_labeled_concepts = concepts_for_labeling_class(::Iqvoc::Concept.pref_labeling_class).any?
|
26
|
+
|
27
|
+
if invalid_pref_label_language && has_pref_labeled_concepts
|
23
28
|
errors.add :base, I18n.t('txt.models.label.pref_label_language')
|
24
29
|
end
|
25
30
|
end
|
26
31
|
|
32
|
+
def referenced_published_concepts_have_main_language_pref_label
|
33
|
+
published_label = self.published_version
|
34
|
+
|
35
|
+
# check published concepts which use the current label as a pref label
|
36
|
+
concepts.published.each do |concept|
|
37
|
+
# pref labels without the current published one
|
38
|
+
pref_labels = concept.pref_labels.reject { |l| l == published_label }
|
39
|
+
|
40
|
+
unless pref_labels.map(&:language).map(&:to_s).include?(::Iqvoc::Concept.pref_labeling_languages.first.to_s)
|
41
|
+
errors.add :base, I18n.t('txt.models.label.referenced_concepts_invalid')
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
27
46
|
end
|
28
47
|
end
|
29
48
|
end
|
@@ -77,6 +77,10 @@ class Labeling::SKOSXL::Base < Labeling::Base
|
|
77
77
|
'partials/labeling/skosxl/edit_base'
|
78
78
|
end
|
79
79
|
|
80
|
+
def self.only_one_allowed?
|
81
|
+
false
|
82
|
+
end
|
83
|
+
|
80
84
|
def self.build_from_rdf(rdf_subject, rdf_predicate, rdf_object)
|
81
85
|
unless rdf_subject.is_a?(Concept::Base)
|
82
86
|
raise "#{self.name}#build_from_rdf: Subject (#{rdf_subject}) must be a Concept."
|
@@ -17,12 +17,14 @@
|
|
17
17
|
<%= f.text_field :expired_at, :class => 'datepicker' %>
|
18
18
|
</fieldset>
|
19
19
|
|
20
|
+
<% if Iqvoc::XLLabel.relation_classes.any? %>
|
20
21
|
<fieldset>
|
21
22
|
<legend><%= Label::Relation::SKOSXL::Base.model_name.human(:count => 2) %></legend>
|
22
23
|
<% Iqvoc::XLLabel.relation_classes.each do |relation_class| %>
|
23
24
|
<%= render relation_class.edit_partial_name(label), :f => f, :label => label, :klass => relation_class %>
|
24
25
|
<% end %>
|
25
26
|
</fieldset>
|
27
|
+
<% end %>
|
26
28
|
|
27
29
|
<% Iqvoc::XLLabel.additional_association_classes.keys.each do |association_class| %>
|
28
30
|
<fieldset>
|
@@ -32,8 +34,8 @@
|
|
32
34
|
<% end %>
|
33
35
|
|
34
36
|
|
35
|
-
<%
|
36
|
-
<%
|
37
|
+
<% Iqvoc::XLLabel.note_classes.each do |note_class| %>
|
38
|
+
<% unless note_class.edit_partial_name(label).nil? %>
|
37
39
|
<%= render note_class.edit_partial_name(label), :owner_klass => label, :assoc_klass => note_class, :f => f %>
|
38
40
|
<% end %>
|
39
41
|
<% end %>
|
@@ -4,13 +4,11 @@
|
|
4
4
|
%>
|
5
5
|
|
6
6
|
<%= f.text_field "inline_#{klass.name.to_relation_name}",
|
7
|
-
label
|
8
|
-
value
|
9
|
-
id
|
10
|
-
class
|
11
|
-
data:
|
12
|
-
|
13
|
-
|
14
|
-
'entities': data_entities
|
15
|
-
}
|
7
|
+
:label => klass.model_name.human(:count => 2),
|
8
|
+
:value => label.send("inline_#{klass.name.to_relation_name}").join(','),
|
9
|
+
:id => klass.name.to_relation_name,
|
10
|
+
:class => 'entity_select',
|
11
|
+
:'data-query-url' => labels_path(:format => :json),
|
12
|
+
:'data-entity-uri' => label_path("{id}"),
|
13
|
+
:'data-entities' => data_entities
|
16
14
|
%>
|
@@ -10,6 +10,7 @@
|
|
10
10
|
:"data-language" => language,
|
11
11
|
:"data-query-url" => labels_path(:format => :json, :language => language),
|
12
12
|
:"data-entity-uri" => label_path("{id}"),
|
13
|
+
:"data-singular" => klass.only_one_allowed? ? true : false,
|
13
14
|
:"data-entities" => Iqvoc::XLLabel.base_class.editor_selectable.
|
14
15
|
by_language(language).by_origin(concept.labelings_by_id(
|
15
16
|
klass.name.to_relation_name, language).
|
data/config/locales/de.yml
CHANGED
@@ -12,3 +12,4 @@ de:
|
|
12
12
|
uri: Label-URI
|
13
13
|
origin_invalid: enthält ungültige Zeichen.
|
14
14
|
pref_label_language: "Es muss ein bevorzugtes Label in der Hauptsprache des Thesaurus vorliegen."
|
15
|
+
referenced_concepts_invalid: Referenzierte Konzepte werden durch diese Änderung invalide. Bitte Labelzuordnung am Konzept aufheben.
|
data/config/locales/en.yml
CHANGED
@@ -12,3 +12,4 @@ en:
|
|
12
12
|
uri: Label URI
|
13
13
|
origin_invalid: Origin contains invalid characters.
|
14
14
|
pref_label_language: There must be a prefered label in thesaurus main language.
|
15
|
+
referenced_concepts_invalid: Some referenced concepts become invalid. Please remove label from referenced concepts first.
|
data/db/schema.rb
CHANGED
@@ -20,7 +20,7 @@ ActiveRecord::Schema.define(version: 20150414083600) do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
add_index "collection_members", ["collection_id", "target_id", "type"], name: "ix_collections_fk_type", using: :btree
|
23
|
-
add_index "collection_members", ["target_id"], name: "
|
23
|
+
add_index "collection_members", ["target_id"], name: "fk_rails_2a51b48094", using: :btree
|
24
24
|
|
25
25
|
create_table "concept_relations", force: :cascade do |t|
|
26
26
|
t.string "type", limit: 255
|
@@ -32,7 +32,7 @@ ActiveRecord::Schema.define(version: 20150414083600) do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
add_index "concept_relations", ["owner_id", "target_id"], name: "ix_concept_relations_fk", using: :btree
|
35
|
-
add_index "concept_relations", ["target_id"], name: "
|
35
|
+
add_index "concept_relations", ["target_id"], name: "fk_rails_fd6c6e6fd7", using: :btree
|
36
36
|
|
37
37
|
create_table "concepts", force: :cascade do |t|
|
38
38
|
t.string "type", limit: 255
|
@@ -50,7 +50,7 @@ ActiveRecord::Schema.define(version: 20150414083600) do
|
|
50
50
|
t.boolean "top_term", limit: 1, default: false
|
51
51
|
end
|
52
52
|
|
53
|
-
add_index "concepts", ["locked_by"], name: "
|
53
|
+
add_index "concepts", ["locked_by"], name: "fk_rails_69655c7fd3", using: :btree
|
54
54
|
add_index "concepts", ["origin"], name: "ix_concepts_on_origin", length: {"origin"=>255}, using: :btree
|
55
55
|
add_index "concepts", ["published_version_id"], name: "ix_concepts_publ_version_id", using: :btree
|
56
56
|
|
@@ -120,7 +120,7 @@ ActiveRecord::Schema.define(version: 20150414083600) do
|
|
120
120
|
end
|
121
121
|
|
122
122
|
add_index "label_relations", ["domain_id", "range_id", "type"], name: "ix_label_rel_dom_rng_type", using: :btree
|
123
|
-
add_index "label_relations", ["range_id"], name: "
|
123
|
+
add_index "label_relations", ["range_id"], name: "fk_rails_a56a2bdf28", using: :btree
|
124
124
|
add_index "label_relations", ["type"], name: "ix_label_relations_on_type", using: :btree
|
125
125
|
|
126
126
|
create_table "labelings", force: :cascade do |t|
|
@@ -132,7 +132,7 @@ ActiveRecord::Schema.define(version: 20150414083600) do
|
|
132
132
|
end
|
133
133
|
|
134
134
|
add_index "labelings", ["owner_id", "target_id", "type"], name: "ix_labelings_fk_type", using: :btree
|
135
|
-
add_index "labelings", ["target_id"], name: "
|
135
|
+
add_index "labelings", ["target_id"], name: "fk_rails_5897707e64", using: :btree
|
136
136
|
add_index "labelings", ["type"], name: "ix_labelings_on_type", using: :btree
|
137
137
|
|
138
138
|
create_table "labels", force: :cascade do |t|
|
data/iqvoc_skosxl.gemspec
CHANGED
@@ -13,11 +13,11 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.license = 'Apache License 2.0'
|
14
14
|
s.description = 'iQvoc - a SKOS(-XL) vocabulary management system built on the Semantic Web'
|
15
15
|
|
16
|
-
s.add_dependency 'iqvoc', '~> 4.
|
16
|
+
s.add_dependency 'iqvoc', '~> 4.11.0'
|
17
17
|
s.add_development_dependency 'bundler', '~> 1.6'
|
18
18
|
|
19
19
|
s.files = %w(README.md Gemfile Gemfile.lock Rakefile iqvoc_skosxl.gemspec) +
|
20
|
-
|
20
|
+
Dir.glob('{app,config,db,public,lib,test}/**/*')
|
21
21
|
s.test_files = s.files.grep(%r{^test/})
|
22
22
|
s.require_paths = ['lib']
|
23
23
|
end
|
data/lib/iqvoc/skosxl/version.rb
CHANGED
@@ -33,6 +33,14 @@ class LabelCreationTest < ActionDispatch::IntegrationTest
|
|
33
33
|
assert page.has_content? 'Instanz wurde erfolgreich veröffentlicht.'
|
34
34
|
assert page.has_content? 'Testlabel'
|
35
35
|
|
36
|
+
# check initial created-ChangeNote
|
37
|
+
change_note_relation_name = Iqvoc::change_note_class_name.to_relation_name
|
38
|
+
within("\##{change_note_relation_name}") do
|
39
|
+
assert page.has_css?('.translation', count: 1)
|
40
|
+
assert page.has_content? 'Initiale Version'
|
41
|
+
assert page.has_content? 'dct:created'
|
42
|
+
end
|
43
|
+
|
36
44
|
# modify created version
|
37
45
|
click_link_or_button 'Neue Version erstellen'
|
38
46
|
fill_in 'Vorlageform', with: 'Testlabel_modified'
|
@@ -41,6 +49,14 @@ class LabelCreationTest < ActionDispatch::IntegrationTest
|
|
41
49
|
assert page.has_content? 'Testlabel_modified'
|
42
50
|
click_link_or_button 'Veröffentlichen'
|
43
51
|
assert page.has_content? 'Instanz wurde erfolgreich veröffentlicht.'
|
52
|
+
|
53
|
+
# check ChangeNote (initial+modified)
|
54
|
+
within("\##{change_note_relation_name}") do
|
55
|
+
assert page.has_css?('.translation', count: 2)
|
56
|
+
assert page.has_content? 'Initiale Version'
|
57
|
+
assert page.has_content? 'dct:created'
|
58
|
+
assert page.has_content? 'dct:modified'
|
59
|
+
end
|
44
60
|
end
|
45
61
|
|
46
62
|
test 'inconsistent label creation' do
|
@@ -0,0 +1,135 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
# Copyright 2011-2016 innoQ Deutschland GmbH
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), '../integration_test_helper')
|
18
|
+
|
19
|
+
class LabelsRelationTest < ActionDispatch::IntegrationTest
|
20
|
+
|
21
|
+
# sample bidirectional relation
|
22
|
+
module Label::Relation::SKOSXL
|
23
|
+
class Translation < Label::Relation::SKOSXL::Base
|
24
|
+
def self.bidirectional?
|
25
|
+
true
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
class UnidirectionalRelation < Label::Relation::SKOSXL::Base
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# add label relation to iqvoc initializer
|
34
|
+
Iqvoc::XLLabel.relation_class_names = [
|
35
|
+
'Label::Relation::SKOSXL::Translation',
|
36
|
+
'Label::Relation::SKOSXL::UnidirectionalRelation'
|
37
|
+
]
|
38
|
+
|
39
|
+
setup do
|
40
|
+
@dog_en = Iqvoc::XLLabel.base_class.create!(
|
41
|
+
language: 'en',
|
42
|
+
value: 'Dog',
|
43
|
+
origin: 'dog_en',
|
44
|
+
published_at: Time.now
|
45
|
+
)
|
46
|
+
|
47
|
+
@dog_de = Iqvoc::XLLabel.base_class.create!(
|
48
|
+
language: 'de',
|
49
|
+
value: 'Hund',
|
50
|
+
origin: 'dog_de',
|
51
|
+
published_at: Time.now
|
52
|
+
)
|
53
|
+
|
54
|
+
login('administrator')
|
55
|
+
end
|
56
|
+
|
57
|
+
test 'bidirectional label relation assignment' do
|
58
|
+
assert @dog_en.label_relation_skosxl_translations.empty?
|
59
|
+
assert @dog_de.label_relation_skosxl_translations.empty?
|
60
|
+
|
61
|
+
visit label_path(@dog_en, lang: 'en', format: 'html')
|
62
|
+
click_link_or_button('Create new version')
|
63
|
+
assert_equal edit_label_path(@dog_en, lang: 'en', format: 'html'), current_path
|
64
|
+
assert page.has_content? 'Instance copy has been created and locked.'
|
65
|
+
|
66
|
+
# add translation dog_en => dog_de
|
67
|
+
fill_in 'label_relation_skosxl_translations', with: 'dog_de'
|
68
|
+
click_link_or_button('Save')
|
69
|
+
|
70
|
+
assert page.has_content? 'Label has been successfully modified.'
|
71
|
+
click_link_or_button('Publish')
|
72
|
+
|
73
|
+
# check db relations
|
74
|
+
dog_en_with_translation = Iqvoc::XLLabel.base_class.find_by(origin: 'dog_en')
|
75
|
+
assert_equal 1, dog_en_with_translation.label_relation_skosxl_translations.size
|
76
|
+
assert_equal 'dog_de', dog_en_with_translation.label_relation_skosxl_translations.first.range.origin
|
77
|
+
|
78
|
+
dog_de_with_translation = Iqvoc::XLLabel.base_class.find_by(origin: 'dog_de')
|
79
|
+
assert_equal 1, dog_de_with_translation.label_relation_skosxl_translations.size
|
80
|
+
assert_equal 'dog_en', dog_de_with_translation.label_relation_skosxl_translations.first.range.origin
|
81
|
+
|
82
|
+
# remove previously added translation
|
83
|
+
click_link_or_button('Create new version')
|
84
|
+
fill_in 'label_relation_skosxl_translations', with: ''
|
85
|
+
click_link_or_button('Save')
|
86
|
+
assert page.has_content? 'Label has been successfully modified.'
|
87
|
+
click_link_or_button('Publish')
|
88
|
+
|
89
|
+
# check if relations are destroyed
|
90
|
+
dog_en_without_translation = Iqvoc::XLLabel.base_class.find_by(origin: 'dog_en')
|
91
|
+
assert dog_en_without_translation.label_relation_skosxl_translations.empty?
|
92
|
+
|
93
|
+
dog_de_without_translation = Iqvoc::XLLabel.base_class.find_by(origin: 'dog_de')
|
94
|
+
assert dog_de_without_translation.label_relation_skosxl_translations.empty?
|
95
|
+
end
|
96
|
+
|
97
|
+
test 'unidirectional label relation assignment' do
|
98
|
+
assert @dog_en.label_relation_skosxl_unidirectional_relations.empty?
|
99
|
+
assert @dog_de.label_relation_skosxl_unidirectional_relations.empty?
|
100
|
+
|
101
|
+
visit label_path(@dog_en, lang: 'en', format: 'html')
|
102
|
+
click_link_or_button('Create new version')
|
103
|
+
assert_equal edit_label_path(@dog_en, lang: 'en', format: 'html'), current_path
|
104
|
+
assert page.has_content? 'Instance copy has been created and locked.'
|
105
|
+
|
106
|
+
# add translation dog_en => dog_de
|
107
|
+
fill_in 'label_relation_skosxl_unidirectional_relations', with: 'dog_de'
|
108
|
+
click_link_or_button('Save')
|
109
|
+
|
110
|
+
assert page.has_content? 'Label has been successfully modified.'
|
111
|
+
click_link_or_button('Publish')
|
112
|
+
|
113
|
+
# check db relations
|
114
|
+
dog_en_with_unidirectional_relalation = Iqvoc::XLLabel.base_class.find_by(origin: 'dog_en')
|
115
|
+
assert_equal 1, dog_en_with_unidirectional_relalation.label_relation_skosxl_unidirectional_relations.size
|
116
|
+
assert_equal 'dog_de', dog_en_with_unidirectional_relalation.label_relation_skosxl_unidirectional_relations.first.range.origin
|
117
|
+
|
118
|
+
old_dog_de = Iqvoc::XLLabel.base_class.find_by(origin: 'dog_de')
|
119
|
+
assert old_dog_de.label_relation_skosxl_unidirectional_relations.empty?
|
120
|
+
|
121
|
+
# remove previously added unidirectional relation
|
122
|
+
click_link_or_button('Create new version')
|
123
|
+
fill_in 'label_relation_skosxl_unidirectional_relations', with: ''
|
124
|
+
click_link_or_button('Save')
|
125
|
+
assert page.has_content? 'Label has been successfully modified.'
|
126
|
+
click_link_or_button('Publish')
|
127
|
+
|
128
|
+
# check if relations are destroyed
|
129
|
+
dog_en_without_relations = Iqvoc::XLLabel.base_class.find_by(origin: 'dog_en')
|
130
|
+
assert dog_en_without_relations.label_relation_skosxl_unidirectional_relations.empty?
|
131
|
+
|
132
|
+
dog_de_without_translation = Iqvoc::XLLabel.base_class.find_by(origin: 'dog_de')
|
133
|
+
assert dog_de_without_translation.label_relation_skosxl_unidirectional_relations.empty?
|
134
|
+
end
|
135
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iqvoc_skosxl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Glaser
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2017-05-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: iqvoc
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 4.
|
21
|
+
version: 4.11.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 4.
|
28
|
+
version: 4.11.0
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: bundler
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- app/helpers/labels_helper.rb
|
64
64
|
- app/models/concept/skosxl/extension.rb
|
65
65
|
- app/models/label/relation/base.rb
|
66
|
+
- app/models/label/relation/bidirectional_relation_extension.rb
|
66
67
|
- app/models/label/relation/skosxl/base.rb
|
67
68
|
- app/models/label/skosxl/base.rb
|
68
69
|
- app/models/label/skosxl/properties/literal_form.rb
|
@@ -134,6 +135,7 @@ files:
|
|
134
135
|
- test/integration/dashboard_test.rb
|
135
136
|
- test/integration/edit_labels_test.rb
|
136
137
|
- test/integration/label_creation_test.rb
|
138
|
+
- test/integration/label_relation_test.rb
|
137
139
|
- test/integration/labels_order_test.rb
|
138
140
|
- test/integration_test_helper.rb
|
139
141
|
- test/models/concept_test.rb
|
@@ -160,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
162
|
version: '0'
|
161
163
|
requirements: []
|
162
164
|
rubyforge_project:
|
163
|
-
rubygems_version: 2.4.5
|
165
|
+
rubygems_version: 2.4.5
|
164
166
|
signing_key:
|
165
167
|
specification_version: 4
|
166
168
|
summary: iQvoc SKOS-XL extension
|
@@ -171,6 +173,7 @@ test_files:
|
|
171
173
|
- test/integration/dashboard_test.rb
|
172
174
|
- test/integration/edit_labels_test.rb
|
173
175
|
- test/integration/label_creation_test.rb
|
176
|
+
- test/integration/label_relation_test.rb
|
174
177
|
- test/integration/labels_order_test.rb
|
175
178
|
- test/integration_test_helper.rb
|
176
179
|
- test/models/concept_test.rb
|