iqvoc 3.5.5 → 3.5.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +6 -0
- data/Gemfile +5 -7
- data/Gemfile.lock +52 -56
- data/app/assets/javascripts/iqvoc/iqvoc.js +9 -6
- data/app/controllers/rdf_controller.rb +1 -1
- data/app/helpers/rdf_helper.rb +1 -1
- data/app/models/collection/base.rb +6 -6
- data/app/models/concept/base.rb +15 -9
- data/app/models/concept/relation/base.rb +14 -14
- data/app/models/concept/skos/base.rb +10 -3
- data/app/models/concept/skos/scheme.rb +4 -4
- data/app/models/label/base.rb +27 -25
- data/app/models/labeling/base.rb +12 -12
- data/app/models/labeling/skos/base.rb +2 -2
- data/app/models/note/base.rb +15 -11
- data/app/views/partials/concept/relation/_edit_base.html.erb +2 -1
- data/config/database.yml +1 -4
- data/config/initializers/iqvoc.rb +1 -0
- data/config/initializers/secret_token.rb +1 -1
- data/config/routes.rb +1 -1
- data/lib/iqvoc/controller_extensions.rb +6 -3
- data/lib/iqvoc/environments/development.rb +35 -0
- data/lib/iqvoc/environments/production.rb +20 -0
- data/lib/{maker.rb → iqvoc/maker.rb} +1 -3
- data/lib/iqvoc/origin.rb +148 -0
- data/lib/iqvoc/skos_importer.rb +1 -1
- data/lib/iqvoc/version.rb +1 -1
- data/lib/iqvoc/versioning.rb +51 -53
- data/test/integration/concept_scheme_test.rb +3 -3
- data/test/integration/tree_test.rb +2 -2
- data/test/integration_test_helper.rb +30 -4
- data/test/unit/hygiene_test.rb +25 -0
- data/test/unit/origin_test.rb +75 -0
- metadata +27 -26
- data/app/models/origin_mapping.rb +0 -58
- data/config/deploy.rb +0 -72
- data/test/unit/origin_mapping_test.rb +0 -66
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 3.5.6 (2012-03-07)
|
2
|
+
|
3
|
+
* Refactored origin (URI slug) generation<br>
|
4
|
+
Now supports custom filters to extend generation logic. See more: https://github.com/innoq/iqvoc/blob/master/lib/iqvoc/origin.rb
|
5
|
+
* Bugfixes
|
6
|
+
|
1
7
|
## 3.5.4 (2012-02-08)
|
2
8
|
|
3
9
|
* Top concepts<br>
|
data/Gemfile
CHANGED
@@ -19,7 +19,7 @@ source 'http://rubygems.org'
|
|
19
19
|
# TODO: The following dependencies could be included by the "gemspec" command.
|
20
20
|
# There is only one problem: gemspec puts the dependencies automatically to a
|
21
21
|
# group (:development by default). This is not what we need.
|
22
|
-
gem 'rails', '3.2.
|
22
|
+
gem 'rails', '3.2.2'
|
23
23
|
|
24
24
|
group :assets do
|
25
25
|
gem 'uglifier', '>= 1.0.3'
|
@@ -42,14 +42,10 @@ end
|
|
42
42
|
|
43
43
|
group :development, :test do
|
44
44
|
gem 'awesome_print'
|
45
|
-
|
45
|
+
|
46
46
|
platforms :ruby do
|
47
47
|
gem 'mysql2'
|
48
48
|
gem 'sqlite3'
|
49
|
-
# v0.9 required for spork-testunit
|
50
|
-
gem 'spork', '~> 0.9.0.rc'
|
51
|
-
# head required for Ruby 1.9.3 compatibility; cf. https://github.com/sporkrb/spork-testunit/pull/17
|
52
|
-
gem 'spork-testunit', :git => 'git://github.com/sporkrb/spork-testunit.git'
|
53
49
|
end
|
54
50
|
|
55
51
|
platforms :jruby do
|
@@ -59,12 +55,14 @@ group :development, :test do
|
|
59
55
|
end
|
60
56
|
|
61
57
|
group :test do
|
58
|
+
gem 'test-unit'
|
62
59
|
gem 'nokogiri', '~> 1.5.0'
|
63
60
|
gem 'capybara'
|
64
61
|
gem 'capybara-webkit'
|
65
62
|
gem 'database_cleaner'
|
66
63
|
gem 'factory_girl_rails'
|
67
|
-
gem '
|
64
|
+
gem 'spork'
|
65
|
+
gem 'spork-testunit'
|
68
66
|
end
|
69
67
|
|
70
68
|
group :production do
|
data/Gemfile.lock
CHANGED
@@ -1,19 +1,12 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git://github.com/sporkrb/spork-testunit.git
|
3
|
-
revision: fcf530694dd8c7fed752cf45e0d10db1ea55e3f6
|
4
|
-
specs:
|
5
|
-
spork-testunit (0.0.7)
|
6
|
-
spork (>= 0.6.0)
|
7
|
-
|
8
1
|
GEM
|
9
2
|
remote: http://rubygems.org/
|
10
3
|
specs:
|
11
|
-
actionmailer (3.2.
|
12
|
-
actionpack (= 3.2.
|
4
|
+
actionmailer (3.2.2)
|
5
|
+
actionpack (= 3.2.2)
|
13
6
|
mail (~> 2.4.0)
|
14
|
-
actionpack (3.2.
|
15
|
-
activemodel (= 3.2.
|
16
|
-
activesupport (= 3.2.
|
7
|
+
actionpack (3.2.2)
|
8
|
+
activemodel (= 3.2.2)
|
9
|
+
activesupport (= 3.2.2)
|
17
10
|
builder (~> 3.0.0)
|
18
11
|
erubis (~> 2.7.0)
|
19
12
|
journey (~> 1.0.1)
|
@@ -21,13 +14,13 @@ GEM
|
|
21
14
|
rack-cache (~> 1.1)
|
22
15
|
rack-test (~> 0.6.1)
|
23
16
|
sprockets (~> 2.1.2)
|
24
|
-
activemodel (3.2.
|
25
|
-
activesupport (= 3.2.
|
17
|
+
activemodel (3.2.2)
|
18
|
+
activesupport (= 3.2.2)
|
26
19
|
builder (~> 3.0.0)
|
27
|
-
activerecord (3.2.
|
28
|
-
activemodel (= 3.2.
|
29
|
-
activesupport (= 3.2.
|
30
|
-
arel (~> 3.0.
|
20
|
+
activerecord (3.2.2)
|
21
|
+
activemodel (= 3.2.2)
|
22
|
+
activesupport (= 3.2.2)
|
23
|
+
arel (~> 3.0.2)
|
31
24
|
tzinfo (~> 0.3.29)
|
32
25
|
activerecord-jdbc-adapter (1.2.2)
|
33
26
|
activerecord-jdbcmysql-adapter (1.2.2)
|
@@ -37,14 +30,14 @@ GEM
|
|
37
30
|
activerecord-jdbc-adapter (~> 1.2.2)
|
38
31
|
jdbc-sqlite3 (~> 3.7.2)
|
39
32
|
activerecord-oracle_enhanced-adapter (1.4.1)
|
40
|
-
activeresource (3.2.
|
41
|
-
activemodel (= 3.2.
|
42
|
-
activesupport (= 3.2.
|
43
|
-
activesupport (3.2.
|
33
|
+
activeresource (3.2.2)
|
34
|
+
activemodel (= 3.2.2)
|
35
|
+
activesupport (= 3.2.2)
|
36
|
+
activesupport (3.2.2)
|
44
37
|
i18n (~> 0.6)
|
45
38
|
multi_json (~> 1.0)
|
46
|
-
addressable (2.2.
|
47
|
-
arel (3.0.
|
39
|
+
addressable (2.2.7)
|
40
|
+
arel (3.0.2)
|
48
41
|
authlogic (3.1.0)
|
49
42
|
activerecord (>= 3.0.7)
|
50
43
|
activerecord (>= 3.0.7)
|
@@ -59,40 +52,41 @@ GEM
|
|
59
52
|
rack-test (>= 0.5.4)
|
60
53
|
selenium-webdriver (~> 2.0)
|
61
54
|
xpath (~> 0.1.4)
|
62
|
-
capybara-webkit (0.
|
55
|
+
capybara-webkit (0.10.0)
|
63
56
|
capybara (>= 1.0.0, < 1.2)
|
64
57
|
json
|
65
|
-
childprocess (0.3.
|
58
|
+
childprocess (0.3.1)
|
66
59
|
ffi (~> 1.0.6)
|
67
60
|
database_cleaner (0.7.1)
|
68
61
|
erubis (2.7.0)
|
69
62
|
execjs (1.3.0)
|
70
63
|
multi_json (~> 1.0)
|
71
|
-
factory_girl (2.
|
72
|
-
activesupport
|
73
|
-
factory_girl_rails (1.
|
74
|
-
factory_girl (~> 2.
|
64
|
+
factory_girl (2.6.0)
|
65
|
+
activesupport (>= 2.3.9)
|
66
|
+
factory_girl_rails (1.7.0)
|
67
|
+
factory_girl (~> 2.6.0)
|
75
68
|
railties (>= 3.0.0)
|
76
69
|
fastercsv (1.5.4)
|
77
70
|
ffi (1.0.11)
|
78
71
|
ffi (1.0.11-java)
|
79
|
-
heroku (2.
|
72
|
+
heroku (2.20.1)
|
80
73
|
launchy (>= 0.3.2)
|
81
74
|
rest-client (~> 1.6.1)
|
82
75
|
rubyzip
|
83
76
|
term-ansicolor (~> 1.0.5)
|
84
77
|
hike (1.2.1)
|
85
78
|
i18n (0.6.0)
|
86
|
-
iq_rdf (0.1.
|
79
|
+
iq_rdf (0.1.5)
|
87
80
|
builder
|
88
81
|
bundler
|
89
82
|
jdbc-mysql (5.1.13)
|
90
83
|
jdbc-sqlite3 (3.7.2)
|
91
|
-
journey (1.0.
|
92
|
-
jruby-openssl (0.7.
|
84
|
+
journey (1.0.3)
|
85
|
+
jruby-openssl (0.7.6.1)
|
93
86
|
bouncy-castle-java (>= 1.5.0146.1)
|
94
87
|
json (1.6.5)
|
95
88
|
json (1.6.5-java)
|
89
|
+
json_pure (1.6.5)
|
96
90
|
kaminari (0.13.0)
|
97
91
|
actionpack (>= 3.0.0)
|
98
92
|
activesupport (>= 3.0.0)
|
@@ -109,12 +103,11 @@ GEM
|
|
109
103
|
mime-types (~> 1.16)
|
110
104
|
treetop (~> 1.4.8)
|
111
105
|
mime-types (1.17.2)
|
112
|
-
|
113
|
-
multi_json (1.0.4)
|
106
|
+
multi_json (1.1.0)
|
114
107
|
mysql2 (0.3.11)
|
115
108
|
nokogiri (1.5.0)
|
116
109
|
nokogiri (1.5.0-java)
|
117
|
-
pg (0.
|
110
|
+
pg (0.13.2)
|
118
111
|
polyglot (0.3.3)
|
119
112
|
rack (1.4.1)
|
120
113
|
rack-cache (1.1)
|
@@ -123,19 +116,19 @@ GEM
|
|
123
116
|
rack
|
124
117
|
rack-test (0.6.1)
|
125
118
|
rack (>= 1.0)
|
126
|
-
rails (3.2.
|
127
|
-
actionmailer (= 3.2.
|
128
|
-
actionpack (= 3.2.
|
129
|
-
activerecord (= 3.2.
|
130
|
-
activeresource (= 3.2.
|
131
|
-
activesupport (= 3.2.
|
119
|
+
rails (3.2.2)
|
120
|
+
actionmailer (= 3.2.2)
|
121
|
+
actionpack (= 3.2.2)
|
122
|
+
activerecord (= 3.2.2)
|
123
|
+
activeresource (= 3.2.2)
|
124
|
+
activesupport (= 3.2.2)
|
132
125
|
bundler (~> 1.0)
|
133
|
-
railties (= 3.2.
|
126
|
+
railties (= 3.2.2)
|
134
127
|
rails_autolink (1.0.5)
|
135
128
|
rails (~> 3.1)
|
136
|
-
railties (3.2.
|
137
|
-
actionpack (= 3.2.
|
138
|
-
activesupport (= 3.2.
|
129
|
+
railties (3.2.2)
|
130
|
+
actionpack (= 3.2.2)
|
131
|
+
activesupport (= 3.2.2)
|
139
132
|
rack-ssl (~> 1.3.2)
|
140
133
|
rake (>= 0.8.7)
|
141
134
|
rdoc (~> 3.4)
|
@@ -145,21 +138,24 @@ GEM
|
|
145
138
|
json (~> 1.4)
|
146
139
|
rest-client (1.6.7)
|
147
140
|
mime-types (>= 1.16)
|
148
|
-
rubyzip (0.9.
|
149
|
-
selenium-webdriver (2.
|
150
|
-
childprocess (>= 0.2.
|
141
|
+
rubyzip (0.9.6.1)
|
142
|
+
selenium-webdriver (2.13.0)
|
143
|
+
childprocess (>= 0.2.1)
|
151
144
|
ffi (~> 1.0.9)
|
152
|
-
|
145
|
+
json_pure
|
153
146
|
rubyzip
|
154
147
|
spoon (0.0.1)
|
155
148
|
spork (0.9.0)
|
149
|
+
spork-testunit (0.0.8)
|
150
|
+
spork (>= 0.6.0)
|
156
151
|
sprockets (2.1.2)
|
157
152
|
hike (~> 1.2)
|
158
153
|
rack (~> 1.0)
|
159
154
|
tilt (~> 1.1, != 1.3.0)
|
160
155
|
sqlite3 (1.3.5)
|
161
156
|
term-ansicolor (1.0.7)
|
162
|
-
|
157
|
+
test-unit (2.4.7)
|
158
|
+
therubyracer (0.9.10)
|
163
159
|
libv8 (~> 3.3.10)
|
164
160
|
thor (0.14.6)
|
165
161
|
tilt (1.3.3)
|
@@ -196,15 +192,15 @@ DEPENDENCIES
|
|
196
192
|
jruby-openssl
|
197
193
|
json
|
198
194
|
kaminari
|
199
|
-
minitest
|
200
195
|
mysql2
|
201
196
|
nokogiri (~> 1.5.0)
|
202
197
|
pg
|
203
|
-
rails (= 3.2.
|
198
|
+
rails (= 3.2.2)
|
204
199
|
rails_autolink
|
205
|
-
spork
|
206
|
-
spork-testunit
|
200
|
+
spork
|
201
|
+
spork-testunit
|
207
202
|
sqlite3
|
203
|
+
test-unit
|
208
204
|
therubyracer
|
209
205
|
uglifier (>= 1.0.3)
|
210
206
|
view_marker
|
@@ -59,6 +59,7 @@ var createNote = function(ev) {
|
|
59
59
|
// FIXME: Hardcoded UMT stuff
|
60
60
|
var isUsageNote = source.find("label:first")[0].getAttribute("for");
|
61
61
|
isUsageNote = isUsageNote ? isUsageNote.match(/^concept_note_umt_usage_notes/) : false;
|
62
|
+
var noteSelector = isUsageNote ? "select" : "textarea, input";
|
62
63
|
|
63
64
|
if(source.is(":hidden")) {
|
64
65
|
source.show();
|
@@ -67,7 +68,7 @@ var createNote = function(ev) {
|
|
67
68
|
|
68
69
|
var clone = source.clone();
|
69
70
|
|
70
|
-
var count = source.find(
|
71
|
+
var count = source.find(noteSelector)[0].id
|
71
72
|
.match(/_(\d+)_/)[1];
|
72
73
|
count = String(parseInt(count, 10) + 1);
|
73
74
|
var newIdCount = "_" + count + "_",
|
@@ -83,15 +84,17 @@ var createNote = function(ev) {
|
|
83
84
|
|
84
85
|
var src, el;
|
85
86
|
if(!isUsageNote) {
|
86
|
-
src = source.find(
|
87
|
-
el = clone.find(
|
87
|
+
src = source.find(noteSelector)[0];
|
88
|
+
el = clone.find(noteSelector).val("")[0];
|
88
89
|
el.id = src.id.replace(/_\d+_/, newIdCount);
|
89
90
|
el.name = src.name.replace(/\[\d+\]/, newNameCount);
|
90
91
|
}
|
91
92
|
src = source.find("select")[0];
|
92
|
-
|
93
|
-
|
94
|
-
|
93
|
+
if(src) {
|
94
|
+
el = clone.find("select")[0];
|
95
|
+
el.id = src.id.replace(/_\d+_/, newIdCount);
|
96
|
+
el.name = src.name.replace(/\[\d+\]/, newNameCount);
|
97
|
+
}
|
95
98
|
|
96
99
|
clone.addClass("new");
|
97
100
|
$("ol", container).append(clone);
|
data/app/helpers/rdf_helper.rb
CHANGED
@@ -35,7 +35,7 @@ module RdfHelper
|
|
35
35
|
|
36
36
|
c.Schema::expires(concept.expired_at) if concept.expired_at
|
37
37
|
c.Owl::deprecated(true) if concept.expired_at and concept.expired_at <= Date.new
|
38
|
-
|
38
|
+
|
39
39
|
c.Skos::topConceptOf IqRdf.build_uri(Iqvoc::Concept.root_class.instance.origin) if concept.top_term?
|
40
40
|
|
41
41
|
concept.labelings.each do |labeling|
|
@@ -56,18 +56,18 @@ class Collection::Base < Concept::Base
|
|
56
56
|
|
57
57
|
#********** Scopes
|
58
58
|
|
59
|
-
|
59
|
+
def self.by_origin(origin)
|
60
60
|
where(:origin => origin)
|
61
|
-
|
61
|
+
end
|
62
62
|
|
63
|
-
|
63
|
+
def self.by_label_value(val)
|
64
64
|
includes(:labels).merge(Label::Base.by_query_value(val))
|
65
|
-
|
65
|
+
end
|
66
66
|
|
67
|
-
|
67
|
+
def self.tops
|
68
68
|
includes(:parent_collection_members).
|
69
69
|
where("#{Collection::Member::Collection.table_name}.target_id IS NULL")
|
70
|
-
|
70
|
+
end
|
71
71
|
|
72
72
|
#********** Validations
|
73
73
|
|
data/app/models/concept/base.rb
CHANGED
@@ -233,26 +233,32 @@ class Concept::Base < ActiveRecord::Base
|
|
233
233
|
|
234
234
|
# ********** Scopes
|
235
235
|
|
236
|
-
|
236
|
+
def self.tops
|
237
|
+
where(:top_term => true)
|
238
|
+
end
|
237
239
|
|
238
|
-
|
240
|
+
def self.broader_tops
|
241
|
+
includes(:narrower_relations, :pref_labels).
|
239
242
|
where(:concept_relations => { :id => nil },
|
240
|
-
|
243
|
+
:labelings => { :type => Iqvoc::Concept.pref_labeling_class_name }).
|
241
244
|
order("LOWER(#{Label::Base.table_name}.value)")
|
245
|
+
end
|
242
246
|
|
243
|
-
|
247
|
+
def self.with_associations
|
248
|
+
includes([
|
244
249
|
{ :labelings => :target }, :relations, :matches, :notes
|
245
250
|
])
|
251
|
+
end
|
246
252
|
|
247
|
-
|
253
|
+
def self.with_pref_labels
|
248
254
|
includes(:pref_labels).
|
249
255
|
order("LOWER(#{Label::Base.table_name}.value)").
|
250
256
|
where(:labelings => { :type => Iqvoc::Concept.pref_labeling_class_name }) # This line is just a workaround for a Rails Bug. TODO: Delete it when the Bug is fixed
|
257
|
+
end
|
251
258
|
|
252
|
-
|
253
|
-
unpublished_or_follow_up.
|
254
|
-
|
255
|
-
}
|
259
|
+
def self.for_dashboard
|
260
|
+
unpublished_or_follow_up.includes(:pref_labels, :locking_user)
|
261
|
+
end
|
256
262
|
|
257
263
|
# ********** Class methods
|
258
264
|
|
@@ -41,29 +41,29 @@ class Concept::Relation::Base < ActiveRecord::Base
|
|
41
41
|
|
42
42
|
# ********* Scopes
|
43
43
|
|
44
|
-
|
44
|
+
def self.by_owner(owner_id)
|
45
45
|
where(:owner_id => owner_id)
|
46
|
-
|
46
|
+
end
|
47
47
|
|
48
|
-
|
49
|
-
includes(:owner).merge(Concept::Base.by_origin(
|
50
|
-
|
48
|
+
def self.by_owner_origin(owner_origin)
|
49
|
+
includes(:owner).merge(Concept::Base.by_origin(owner_origin))
|
50
|
+
end
|
51
51
|
|
52
|
-
|
53
|
-
includes(:target).merge(Concept::Base.by_origin(
|
54
|
-
|
52
|
+
def self.by_target_origin(target_origin)
|
53
|
+
includes(:target).merge(Concept::Base.by_origin(target_origin))
|
54
|
+
end
|
55
55
|
|
56
|
-
|
56
|
+
def self.target_editor_selectable
|
57
57
|
includes(:target).merge(Concept::Base.editor_selectable)
|
58
|
-
|
58
|
+
end
|
59
59
|
|
60
|
-
|
60
|
+
def self.published
|
61
61
|
includes(:target).merge(Concept::Base.published)
|
62
|
-
|
62
|
+
end
|
63
63
|
|
64
|
-
|
64
|
+
def self.target_in_edit_mode
|
65
65
|
joins(:target).merge(Concept::Base.in_edit_mode)
|
66
|
-
|
66
|
+
end
|
67
67
|
|
68
68
|
# ********* Methods
|
69
69
|
|
@@ -20,9 +20,16 @@ class Concept::SKOS::Base < Concept::Base
|
|
20
20
|
self.rdf_class = "Concept"
|
21
21
|
|
22
22
|
def build_rdf_subject(document, controller, &block)
|
23
|
-
ns = IqRdf::Namespace.find_namespace_class(self.rdf_namespace
|
24
|
-
raise "Namespace '#{
|
25
|
-
IqRdf.build_uri(self.origin, ns.build_uri(self.rdf_class), &block)
|
23
|
+
ns = IqRdf::Namespace.find_namespace_class(self.rdf_namespace)
|
24
|
+
raise "Namespace '#{base_namespace}' is not defined in IqRdf document." unless ns
|
25
|
+
subject = IqRdf.build_uri(self.origin, ns.build_uri(self.rdf_class), &block)
|
26
|
+
|
27
|
+
# ensure skos:Concept type is present
|
28
|
+
unless self.rdf_namespace == "skos" && self.rdf_class == "Concept"
|
29
|
+
subject.Rdf::type(IqRdf::Skos.build_uri("Concept"))
|
30
|
+
end
|
31
|
+
|
32
|
+
return subject
|
26
33
|
end
|
27
34
|
|
28
35
|
end
|