iqvoc 4.5.2 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/Gemfile +1 -0
  4. data/Gemfile.lock +78 -80
  5. data/app/assets/javascripts/iqvoc/concept_mapper.js +15 -7
  6. data/app/assets/javascripts/iqvoc/entityselect.js.erb +11 -1
  7. data/app/assets/javascripts/iqvoc/federated_concept_mapper.js +13 -6
  8. data/app/assets/stylesheets/iqvoc/components/_components.css.scss +12 -1
  9. data/app/concerns/reverse_match_errors.rb +23 -0
  10. data/app/concerns/versioning.rb +1 -1
  11. data/app/controllers/concepts_controller.rb +26 -3
  12. data/app/controllers/rdf_controller.rb +3 -0
  13. data/app/controllers/reverse_matches_controller.rb +73 -0
  14. data/app/jobs/reverse_match_job.rb +57 -0
  15. data/app/models/abstract_user.rb +51 -0
  16. data/app/models/bot_user.rb +25 -0
  17. data/app/models/concept/base.rb +16 -0
  18. data/app/models/job_relation.rb +26 -0
  19. data/app/models/match/skos/broad_match.rb +4 -0
  20. data/app/models/match/skos/close_match.rb +4 -0
  21. data/app/models/match/skos/exact_match.rb +4 -0
  22. data/app/models/match/skos/narrow_match.rb +4 -0
  23. data/app/models/match/skos/related_match.rb +4 -0
  24. data/app/models/note/base.rb +4 -2
  25. data/app/models/services/reverse_match_service.rb +25 -0
  26. data/app/models/user.rb +3 -46
  27. data/app/views/concepts/_form.html.erb +6 -1
  28. data/app/views/concepts/show_published.html.erb +3 -0
  29. data/app/views/concepts/show_unpublished.html.erb +4 -0
  30. data/app/views/partials/concept/_reverse_match_notice.html.erb +25 -0
  31. data/app/views/partials/concept/relation/_edit_base.html.erb +3 -1
  32. data/app/views/partials/concept/relation/_edit_ranked.html.erb +3 -1
  33. data/app/views/partials/note/_search_result.html.erb +1 -1
  34. data/config/locales/de.yml +8 -0
  35. data/config/locales/en.yml +8 -0
  36. data/config/routes.rb +4 -1
  37. data/db/migrate/20140730132113_add_type_to_users.rb +5 -0
  38. data/db/migrate/20140807072457_create_job_relations.rb +11 -0
  39. data/db/migrate/20140807123413_add_response_error_to_job_relation.rb +5 -0
  40. data/iqvoc.gemspec +1 -0
  41. data/lib/iqvoc/ability.rb +8 -0
  42. data/lib/iqvoc/configuration/concept.rb +7 -0
  43. data/lib/iqvoc/version.rb +1 -1
  44. data/lib/tasks/matches.rake +51 -0
  45. data/test/controllers/concept_movement_test.rb +1 -1
  46. data/test/controllers/reverse_match_test.rb +146 -0
  47. data/test/integration/create_concept_test.rb +48 -0
  48. data/test/integration/reverse_match_job_test.rb +111 -0
  49. metadata +33 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 569a8652741d4a11f2df0ef4fe6dabb2c76a2ad7
4
- data.tar.gz: f19d3d903c0e86c6159ab22abd3839402d271fdb
3
+ metadata.gz: 5e268fe56c175a3458dac065834dd636bf052d8d
4
+ data.tar.gz: 2a5ca97086c34db6276438289449944b8d14b74a
5
5
  SHA512:
6
- metadata.gz: 75190fbfccdf51804212b097546544701fa7d4b9d3db32a75b32fb9a45130a44631c5331fb83f55e34f3d6c94cb07fd8d997a275127b3f097fb8213569ea4090
7
- data.tar.gz: 980f75345702dba667cee813517af867b294a96454a977bc37c256e14d6484c42d04eee8336740f056b74b208184ff4eea807715b384558d49a38fb40e330aa0
6
+ metadata.gz: 6cd9c600d8a7239a853edcb2289c6b5eae38c7abce5eea6be58ab7eab964c2d67594f1b09a5416d75fb95b760d8d9f2eaf9582607830971fec3d371c5479bbab
7
+ data.tar.gz: 9b78e701c581c5e483620338e2faf769702b351ed881455663d90b4a08e04496b130259c4289fa4ac05893818d57963fcf550f591b47691f02205c43308da023
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [4.6.0]
2
+
3
+ * [Reverse matches](https://github.com/innoq/iqvoc/wiki/Interconnecting-iQvoc#reverse-matches)
4
+ * Bugfixes
5
+
1
6
  ## [4.5.2]
2
7
 
3
8
  Another patch release before 4.6.0.
data/Gemfile CHANGED
@@ -30,6 +30,7 @@ gem 'json'
30
30
  gem 'rails_autolink'
31
31
  gem 'jruby-openssl', platforms: :jruby
32
32
  gem 'faraday'
33
+ gem 'faraday_middleware'
33
34
  gem 'nokogiri', '~> 1.6.0'
34
35
  gem 'linkeddata'
35
36
  gem 'uglifier'
data/Gemfile.lock CHANGED
@@ -21,13 +21,13 @@ GEM
21
21
  activemodel (= 4.1.3)
22
22
  activesupport (= 4.1.3)
23
23
  arel (~> 5.0.0)
24
- activerecord-jdbc-adapter (1.3.7)
24
+ activerecord-jdbc-adapter (1.3.9)
25
25
  activerecord (>= 2.2)
26
- activerecord-jdbcmysql-adapter (1.3.7)
27
- activerecord-jdbc-adapter (~> 1.3.7)
26
+ activerecord-jdbcmysql-adapter (1.3.9)
27
+ activerecord-jdbc-adapter (~> 1.3.9)
28
28
  jdbc-mysql (>= 5.1.22)
29
- activerecord-jdbcsqlite3-adapter (1.3.7)
30
- activerecord-jdbc-adapter (~> 1.3.7)
29
+ activerecord-jdbcsqlite3-adapter (1.3.9)
30
+ activerecord-jdbc-adapter (~> 1.3.9)
31
31
  jdbc-sqlite3 (~> 3.7.2)
32
32
  activesupport (4.1.3)
33
33
  i18n (~> 0.6, >= 0.6.9)
@@ -36,9 +36,8 @@ GEM
36
36
  thread_safe (~> 0.1)
37
37
  tzinfo (~> 1.1)
38
38
  addressable (2.3.6)
39
- apipie-rails (0.1.3)
39
+ apipie-rails (0.2.2)
40
40
  json
41
- rails (>= 3.0.10)
42
41
  arel (5.0.1.20140414130214)
43
42
  authlogic (3.4.2)
44
43
  activerecord (>= 3.2)
@@ -50,16 +49,15 @@ GEM
50
49
  erubis (>= 2.6.6)
51
50
  binding_of_caller (0.7.2)
52
51
  debug_inspector (>= 0.0.1)
53
- bootstrap-sass (3.1.1.0)
52
+ bootstrap-sass (3.1.1.1)
54
53
  sass (~> 3.2)
55
54
  bootstrap_form (2.1.1)
56
- bouncy-castle-java (1.5.0147)
57
55
  builder (3.2.2)
58
56
  byebug (1.8.2)
59
57
  columnize (~> 0.3.6)
60
58
  debugger-linecache (~> 1.2.0)
61
- cancancan (1.8.2)
62
- cane (2.6.1)
59
+ cancancan (1.9.1)
60
+ cane (2.6.2)
63
61
  parallel
64
62
  capybara (2.2.1)
65
63
  mime-types (>= 1.16)
@@ -77,48 +75,50 @@ GEM
77
75
  columnize (0.3.6)
78
76
  crack (0.4.2)
79
77
  safe_yaml (~> 1.0.0)
80
- database_cleaner (1.2.0)
78
+ database_cleaner (1.3.0)
81
79
  debug_inspector (0.0.2)
82
80
  debugger-linecache (1.2.0)
83
- delayed_job (4.0.1)
81
+ delayed_job (4.0.2)
84
82
  activesupport (>= 3.0, < 4.2)
85
83
  delayed_job_active_record (4.0.1)
86
84
  activerecord (>= 3.0, < 4.2)
87
85
  delayed_job (>= 3.0, < 4.1)
88
- ebnf (0.3.5)
89
- rdf
90
- sxp
91
- equivalent-xml (0.4.2)
86
+ ebnf (0.3.6)
87
+ haml (~> 4.0)
88
+ rdf (~> 1.1)
89
+ sxp (~> 0.1, >= 0.1.3)
90
+ equivalent-xml (0.5.1)
92
91
  nokogiri (>= 1.4.3)
93
92
  erubis (2.7.0)
94
- execjs (2.0.2)
93
+ execjs (2.2.1)
95
94
  faraday (0.9.0)
96
95
  multipart-post (>= 1.2, < 3)
97
- font-awesome-rails (4.0.3.1)
96
+ faraday_middleware (0.9.1)
97
+ faraday (>= 0.7.4, < 0.10)
98
+ font-awesome-rails (4.1.0.0)
98
99
  railties (>= 3.2, < 5.0)
99
100
  haml (4.0.5)
100
101
  tilt
101
102
  hike (1.2.3)
102
- hirb (0.7.1)
103
+ hirb (0.7.2)
103
104
  hirb-unicode (0.0.5)
104
105
  hirb (~> 0.5)
105
106
  unicode-display_width (~> 0.1.1)
106
- htmlentities (4.3.1)
107
+ htmlentities (4.3.2)
107
108
  i18n (0.6.11)
108
109
  iq_rdf (0.1.15)
109
110
  activesupport
110
111
  builder
111
112
  bundler
112
113
  iq_triplestorage (0.2.2)
113
- jdbc-mysql (5.1.30)
114
+ jdbc-mysql (5.1.31)
114
115
  jdbc-sqlite3 (3.7.2.1)
115
- jruby-openssl (0.9.4)
116
- bouncy-castle-java (>= 1.5.0147)
116
+ jruby-openssl (0.9.5-java)
117
117
  json (1.8.1)
118
118
  json (1.8.1-java)
119
- json-ld (1.1.2)
120
- rdf (~> 1.1)
121
- kaminari (0.15.1)
119
+ json-ld (1.1.6)
120
+ rdf (~> 1.1, >= 1.1.4)
121
+ kaminari (0.16.1)
122
122
  actionpack (>= 3.0.0)
123
123
  activesupport (>= 3.0.0)
124
124
  kaminari-bootstrap (3.0.1)
@@ -144,22 +144,21 @@ GEM
144
144
  mail (2.5.4)
145
145
  mime-types (~> 1.16)
146
146
  treetop (~> 1.4.8)
147
- maruku (0.7.1)
147
+ maruku (0.7.2)
148
148
  method_source (0.8.2)
149
149
  mime-types (1.25.1)
150
- mini_portile (0.5.3)
150
+ mini_portile (0.6.0)
151
151
  minitest (5.4.0)
152
152
  multi_json (1.10.1)
153
153
  multipart-post (2.0.0)
154
154
  mysql2 (0.3.13)
155
- net-http-persistent (2.9.4)
156
- nokogiri (1.6.1)
157
- mini_portile (~> 0.5.0)
158
- nokogiri (1.6.1-java)
159
- mini_portile (~> 0.5.0)
160
- parallel (1.0.0)
155
+ net-http-persistent (1.9)
156
+ nokogiri (1.6.3.1)
157
+ mini_portile (= 0.6.0)
158
+ nokogiri (1.6.3.1-java)
159
+ parallel (1.1.2)
161
160
  pg (0.17.1)
162
- poltergeist (1.5.0)
161
+ poltergeist (1.5.1)
163
162
  capybara (~> 2.1)
164
163
  cliver (~> 0.3.1)
165
164
  multi_json (~> 1.0)
@@ -174,7 +173,7 @@ GEM
174
173
  pry (~> 0.9.12)
175
174
  pry-rails (0.3.2)
176
175
  pry (>= 0.9.10)
177
- quiet_assets (1.0.2)
176
+ quiet_assets (1.0.3)
178
177
  railties (>= 3.1, < 5.0)
179
178
  rack (1.5.2)
180
179
  rack-test (0.6.2)
@@ -192,7 +191,7 @@ GEM
192
191
  rails_12factor (0.0.2)
193
192
  rails_serve_static_assets
194
193
  rails_stdout_logging
195
- rails_autolink (1.1.5)
194
+ rails_autolink (1.1.6)
196
195
  rails (> 3.1)
197
196
  rails_serve_static_assets (0.0.2)
198
197
  rails_stdout_logging (0.0.3)
@@ -202,63 +201,61 @@ GEM
202
201
  rake (>= 0.8.7)
203
202
  thor (>= 0.18.1, < 2.0)
204
203
  rake (10.3.2)
205
- rdf (1.1.3)
204
+ rdf (1.1.4.2)
206
205
  rdf-aggregate-repo (1.1.0)
207
206
  rdf (>= 1.1)
208
207
  rdf-isomorphic (1.1.0)
209
208
  rdf (>= 1.1)
210
209
  rdf-json (1.1.0)
211
210
  rdf (>= 1.1.0)
212
- rdf-microdata (1.1.1)
213
- htmlentities (>= 4.3.0)
214
- nokogiri (>= 1.6.1)
215
- rdf (>= 1.1.0)
216
- rdf-xsd (>= 1.1.0)
217
- rdf-n3 (1.1.0)
218
- rdf (>= 1.1)
219
- rdf-rdfa (1.1.3)
211
+ rdf-microdata (1.1.1.3)
212
+ htmlentities (~> 4.3)
213
+ nokogiri (~> 1.6)
214
+ rdf (~> 1.1)
215
+ rdf-xsd (~> 1.1)
216
+ rdf-n3 (1.1.1)
217
+ rdf (~> 1.1, >= 1.1.4)
218
+ rdf-rdfa (1.1.3.2)
220
219
  haml (~> 4.0)
221
220
  htmlentities (~> 4.3)
222
221
  rdf (~> 1.1)
223
222
  rdf-xsd (~> 1.1)
224
- rdf-rdfxml (1.1.0)
225
- rdf (>= 1.1)
226
- rdf-rdfa (>= 1.1)
227
- rdf-xsd (>= 1.1)
228
- rdf-trig (1.1.3)
229
- ebnf (>= 0.3.5)
223
+ rdf-rdfxml (1.1.0.1)
224
+ rdf (~> 1.1)
225
+ rdf-rdfa (~> 1.1)
226
+ rdf-xsd (~> 1.1)
227
+ rdf-trig (1.1.3.1)
228
+ ebnf (~> 0.3, >= 0.3.5)
230
229
  rdf (~> 1.1, >= 1.1.2.1)
231
230
  rdf-turtle (~> 1.1, >= 1.1.3)
232
231
  rdf-trix (1.1.0)
233
232
  rdf (>= 1.1)
234
- rdf-turtle (1.1.3)
235
- ebnf (>= 0.3.5)
236
- rdf (~> 1.1, >= 1.1.2.1)
237
- rdf-xsd (1.1.0)
238
- rdf (>= 1.1)
239
- request_store (1.0.5)
240
- safe_yaml (1.0.2)
233
+ rdf-turtle (1.1.4)
234
+ ebnf (~> 0.3, >= 0.3.6)
235
+ rdf (~> 1.1, >= 1.1.4)
236
+ rdf-xsd (1.1.1)
237
+ rdf (~> 1.1)
238
+ request_store (1.0.7)
239
+ safe_yaml (1.0.3)
241
240
  sass (3.2.19)
242
241
  sass-rails (4.0.3)
243
242
  railties (>= 4.0.0, < 5.0)
244
243
  sass (~> 3.2.0)
245
244
  sprockets (~> 2.8, <= 2.11.0)
246
245
  sprockets-rails (~> 2.0)
247
- slop (3.5.0)
248
- sparql (1.1.2.1)
249
- builder (>= 3.0)
250
- ebnf (>= 0.3.2)
251
- json (>= 1.7)
252
- rdf (>= 1.1.0)
253
- rdf-aggregate-repo (>= 1.1.0)
254
- rdf-xsd (>= 1.0.2)
255
- sparql-client (>= 1.1)
256
- sxp (>= 0.1.3)
257
- sparql-client (1.1.1)
258
- json (>= 1.8)
259
- net-http-persistent (>= 1.4)
260
- rdf (>= 1.1)
261
- spring (1.1.2)
246
+ slop (3.6.0)
247
+ sparql (1.1.4)
248
+ builder (~> 3.0)
249
+ ebnf (~> 0.3, >= 0.3.5)
250
+ rdf (~> 1.1, >= 1.1.4)
251
+ rdf-aggregate-repo (~> 1.1, >= 1.1.0)
252
+ rdf-xsd (~> 1.1)
253
+ sparql-client (~> 1.1)
254
+ sxp (~> 0.1)
255
+ sparql-client (1.1.2)
256
+ net-http-persistent (~> 1.4)
257
+ rdf (~> 1.1)
258
+ spring (1.1.3)
262
259
  sprockets (2.11.0)
263
260
  hike (~> 1.2)
264
261
  multi_json (~> 1.0)
@@ -279,17 +276,17 @@ GEM
279
276
  polyglot (>= 0.3.1)
280
277
  tzinfo (1.2.1)
281
278
  thread_safe (~> 0.1)
282
- uglifier (2.5.0)
279
+ uglifier (2.5.3)
283
280
  execjs (>= 0.3.0)
284
281
  json (>= 1.8.0)
285
282
  unicode-display_width (0.1.1)
286
283
  view_marker (1.0.0)
287
284
  rails
288
- webmock (1.17.4)
289
- addressable (>= 2.2.7)
285
+ webmock (1.18.0)
286
+ addressable (>= 2.3.6)
290
287
  crack (>= 0.3.2)
291
- websocket-driver (0.3.2)
292
- websocket-driver (0.3.2-java)
288
+ websocket-driver (0.3.4)
289
+ websocket-driver (0.3.4-java)
293
290
  xpath (2.0.0)
294
291
  nokogiri (~> 1.3)
295
292
 
@@ -314,6 +311,7 @@ DEPENDENCIES
314
311
  database_cleaner
315
312
  delayed_job_active_record (~> 4.0.1)
316
313
  faraday
314
+ faraday_middleware
317
315
  font-awesome-rails
318
316
  hirb-unicode
319
317
  iq_rdf (>= 0.1.15)
@@ -22,14 +22,22 @@ function ConceptMapper(selector) {
22
22
 
23
23
  this.container = $("<div />").addClass("concept-mapper control-group");
24
24
 
25
- this.input = $("<input />").attr("type", "text").addClass("form-control").
26
- prependTo(this.container);
25
+ this.bootstrapInputGroup = $('<div class="input-group" />');
26
+ this.indicatorWrapper = $('<span class="input-group-addon" />');
27
+
28
+ this.input = this.bootstrapInputGroup
29
+ .append($("<input />").attr("type", "text").addClass("form-control"))
30
+ .append(this.indicatorWrapper)
31
+ .prependTo(this.container);
32
+
27
33
  $("<button />").addClass("btn btn-default fa fa-plus").
28
34
  insertAfter(this.input).click($.proxy(this, "onConfirm"));
29
- this.matchType = $("<select />").addClass("form-control").
30
- append(matchOptions).insertAfter(this.input);
31
35
 
32
- this.container.prependTo(this.root);
36
+ this.matchType = $("<select />").addClass("form-control")
37
+ .append(matchOptions)
38
+ .insertAfter(this.input);
39
+
40
+ this.container.appendTo(this.root);
33
41
  }
34
42
  ConceptMapper.prototype.delimiter = ", ";
35
43
  ConceptMapper.prototype.onConfirm = function(ev) {
@@ -39,11 +47,11 @@ ConceptMapper.prototype.onConfirm = function(ev) {
39
47
  var textArea = document.getElementsByName(textAreaName)[0];
40
48
  textArea = $(textArea);
41
49
 
42
- var newURI = this.input.val();
50
+ var newURI = this.input.find('input').val();
43
51
  var newValue = $.trim(textArea.val() + this.delimiter + newURI);
44
52
 
45
53
  textArea.val(newValue);
46
- this.input.val("");
54
+ this.input.find('input').val("");
47
55
  this.root.trigger("concept-mapped", {
48
56
  uri: newURI,
49
57
  matchType: this.matchTypes[textAreaName]
@@ -21,6 +21,11 @@ var EntitySelector = function(node) {
21
21
  this.entities = this.getSelection();
22
22
  this.uriTemplate = this.el.data("entity-uri");
23
23
 
24
+ this.noResultsMsg = {
25
+ label: this.el.data("no-results-msg"),
26
+ value: ''
27
+ };
28
+
24
29
  var self = this;
25
30
 
26
31
  this.indicator.css("visibility", "hidden");
@@ -35,7 +40,12 @@ var EntitySelector = function(node) {
35
40
  source: $.proxy(this, "onInput"), // XXX: discards original `this` context
36
41
  search: function(ev, ui) { self.indicator.css("visibility", "visible"); },
37
42
  focus: function(ev, ui) { return false; },
38
- select: this.onSelect
43
+ select: this.onSelect,
44
+ response: function(ev, ui) {
45
+ if (!ui.content.length) {
46
+ ui.content.push(self.noResultsMsg);
47
+ }
48
+ }
39
49
  });
40
50
 
41
51
  // jQuery UI does not add a type attribute
@@ -11,6 +11,11 @@ var baseClass = IQVOC.ConceptMapper;
11
11
  function FederatedConceptMapper(selector) {
12
12
  baseClass.apply(this, arguments);
13
13
 
14
+ this.noResultsMsg = {
15
+ label: this.root.data("no-results-msg"),
16
+ value: ''
17
+ };
18
+
14
19
  var sources = this.root.data("datasets");
15
20
  if(!sources) { // fall back to non-federated base class only
16
21
  return;
@@ -23,22 +28,24 @@ function FederatedConceptMapper(selector) {
23
28
  this.source = $("<select />").addClass("form-control").append(sources).
24
29
  insertBefore(this.input);
25
30
 
26
- this.indicator = $("<i />").
27
- addClass("concept-mapper-indicator hidden fa fa-refresh fa-spin").
28
- insertAfter(this.input);
31
+ this.indicator = $("<i />").addClass("spinner fa fa-refresh fa-spin").css("visibility", "hidden");
32
+ this.indicatorWrapper.append(this.indicator);
29
33
 
30
34
  var self = this;
31
- this.input.autocomplete({ // TODO: extract autocomplete extension into subclass
35
+ this.input.find('input').autocomplete({ // TODO: extract autocomplete extension into subclass
32
36
  source: $.proxy(this, "onChange"),
33
37
  search: function(ev, ui) {
34
38
  if(self.source.val() === "_custom") {
35
39
  return false;
36
40
  } else {
37
- self.indicator.removeClass("hidden");
41
+ self.indicator.css("visibility", "visible");
38
42
  }
39
43
  },
40
44
  response: function(ev, ui) {
41
- self.indicator.addClass("hidden");
45
+ if (!ui.content.length) {
46
+ ui.content.push(self.noResultsMsg);
47
+ }
48
+ self.indicator.css("visibility", "hidden");
42
49
  },
43
50
  minLength: 2
44
51
  });
@@ -183,9 +183,20 @@ tr.highlightable {
183
183
  }
184
184
 
185
185
  .concept-mapper {
186
- margin-bottom: 25px;
186
+ margin: 25px 0;
187
187
  > * { margin-right: 10px; }
188
188
 
189
+ .input-group {
190
+ display: inline-table;
191
+ vertical-align: middle;
192
+
193
+ .input-group-addon,
194
+ .input-group-btn,
195
+ .form-control {
196
+ width: auto !important;
197
+ }
198
+ }
199
+
189
200
  .form-control {
190
201
  width: auto;
191
202
  display: inline-block;