iqvoc 4.0.1 → 4.0.2
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.
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/app/assets/stylesheets/iqvoc/components.css.scss +6 -0
- data/app/controllers/concepts_controller.rb +8 -5
- data/app/helpers/concepts_helper.rb +5 -1
- data/app/helpers/dashboard_helper.rb +2 -2
- data/app/helpers/navigation_helper.rb +10 -0
- data/app/models/collection/member/base.rb +5 -0
- data/app/models/collection/member/skos/base.rb +37 -0
- data/app/models/collection/skos/base.rb +35 -0
- data/app/models/collection/unordered.rb +1 -1
- data/app/views/collections/_form.html.erb +3 -1
- data/app/views/concepts/_form.html.erb +3 -1
- data/app/views/concepts/sidebars/_singular.html.erb +1 -0
- data/app/views/dashboard/index.html.erb +2 -2
- data/app/views/errors/not_found.html.erb +2 -5
- data/app/views/layouts/_navigation.html.erb +1 -1
- data/config/locales/de.yml +4 -3
- data/config/locales/en.yml +3 -2
- data/db/schema.rb +1 -10
- data/lib/iqvoc/configuration/collection.rb +7 -1
- data/lib/iqvoc/skos_importer.rb +7 -2
- data/lib/iqvoc/version.rb +1 -1
- data/test/unit/hygiene_test.rb +1 -1
- data/test/unit/skos_import_test.rb +67 -0
- metadata +26 -145
- data/public/assets/ajax-loader-dada1fbb71d7fb80d8dde7a031ae6cd0.gif +0 -0
- data/public/assets/ajax-loader.gif +0 -0
- data/public/assets/arrow_down-07c5dea12928d65fcc31c08279366170.gif +0 -0
- data/public/assets/arrow_down.gif +0 -0
- data/public/assets/arrow_up-51ede92c113b9a870e7a306907360ba8.gif +0 -0
- data/public/assets/arrow_up.gif +0 -0
- data/public/assets/bootstrap/bootstrap-2012a68e8267282c0a2c177d7005ae6d.css +0 -9
- data/public/assets/bootstrap/bootstrap-2012a68e8267282c0a2c177d7005ae6d.css.gz +0 -0
- data/public/assets/bootstrap/bootstrap-2c6144df0bc0f1c9958a69dd77b4f2c2.js +0 -19
- data/public/assets/bootstrap/bootstrap-2c6144df0bc0f1c9958a69dd77b4f2c2.js.gz +0 -0
- data/public/assets/bootstrap/bootstrap-responsive-609b376f4bb032588c054b563d4bca1f.css +0 -9
- data/public/assets/bootstrap/bootstrap-responsive-609b376f4bb032588c054b563d4bca1f.css.gz +0 -0
- data/public/assets/bootstrap/bootstrap-responsive.css +0 -9
- data/public/assets/bootstrap/bootstrap-responsive.css.gz +0 -0
- data/public/assets/bootstrap/bootstrap.css +0 -9
- data/public/assets/bootstrap/bootstrap.css.gz +0 -0
- data/public/assets/bootstrap/bootstrap.js +0 -19
- data/public/assets/bootstrap/bootstrap.js.gz +0 -0
- data/public/assets/bootstrap/glyphicons-halflings-0e7ff93d8f48fe1f5f762e4312e78da7.png +0 -0
- data/public/assets/bootstrap/glyphicons-halflings-white-ef3d5b8d6a297804352b4a46fdb5466d.png +0 -0
- data/public/assets/bootstrap/glyphicons-halflings-white.png +0 -0
- data/public/assets/bootstrap/glyphicons-halflings.png +0 -0
- data/public/assets/excanvas-41add5296511313d9ceaddebef8ca888.js +0 -14
- data/public/assets/excanvas-41add5296511313d9ceaddebef8ca888.js.gz +0 -0
- data/public/assets/excanvas.js +0 -14
- data/public/assets/excanvas.js.gz +0 -0
- data/public/assets/file-58ce0b58f19dfe871b25270e98cff66c.gif +0 -0
- data/public/assets/file.gif +0 -0
- data/public/assets/folder-5c5b1fd2f1ece710f9159f05cc2aaaa8.gif +0 -0
- data/public/assets/folder-closed-8b61fc55011d534f0216c1150994f229.gif +0 -0
- data/public/assets/folder-closed.gif +0 -0
- data/public/assets/folder.gif +0 -0
- data/public/assets/html5-e59131c9bbee37c5d248ab5563f80112.js +0 -3
- data/public/assets/html5-e59131c9bbee37c5d248ab5563f80112.js.gz +0 -0
- data/public/assets/html5.js +0 -3
- data/public/assets/html5.js.gz +0 -0
- data/public/assets/iqvoc/ie_fixes-6a106c21d979ccdd1f6bf1cb129a0e69.css +0 -1
- data/public/assets/iqvoc/ie_fixes-6a106c21d979ccdd1f6bf1cb129a0e69.css.gz +0 -0
- data/public/assets/iqvoc/ie_fixes.css +0 -1
- data/public/assets/iqvoc/ie_fixes.css.gz +0 -0
- data/public/assets/iqvoc/visualization-85d0de8ba646bf7ba8c05255f38e19e6.js +0 -4
- data/public/assets/iqvoc/visualization-85d0de8ba646bf7ba8c05255f38e19e6.js.gz +0 -0
- data/public/assets/iqvoc/visualization.js +0 -4
- data/public/assets/iqvoc/visualization.js.gz +0 -0
- data/public/assets/iqvoc_logo-316859a511c646918fe75e92fa0bf6ac.png +0 -0
- data/public/assets/iqvoc_logo.png +0 -0
- data/public/assets/jit_rgraph-887e8bf5872bfb759cec78efe5e6c62e.js +0 -25
- data/public/assets/jit_rgraph-887e8bf5872bfb759cec78efe5e6c62e.js.gz +0 -0
- data/public/assets/jit_rgraph.js +0 -25
- data/public/assets/jit_rgraph.js.gz +0 -0
- data/public/assets/jquery-ui/ui-bg_flat_0_aaaaaa_40x100-a1eb3e0764573ed4b261ca742ed96ac3.png +0 -0
- data/public/assets/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/assets/jquery-ui/ui-bg_flat_55_fbec88_40x100-439ee8e6c8ce855f43ed4d7b90684720.png +0 -0
- data/public/assets/jquery-ui/ui-bg_flat_55_fbec88_40x100.png +0 -0
- data/public/assets/jquery-ui/ui-bg_glass_75_d0e5f5_1x400-9357836db77954d0d8c5feb259635223.png +0 -0
- data/public/assets/jquery-ui/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
- data/public/assets/jquery-ui/ui-bg_glass_85_dfeffc_1x400-7beb11d1590fb2fb1ef5c754100a078a.png +0 -0
- data/public/assets/jquery-ui/ui-bg_glass_85_dfeffc_1x400.png +0 -0
- data/public/assets/jquery-ui/ui-bg_glass_95_fef1ec_1x400-c723e9a2b50006c6054836a10b76bb84.png +0 -0
- data/public/assets/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/assets/jquery-ui/ui-bg_gloss-wave_55_5c9ccc_500x100-cb26f48ac4912c23ce301c69c474d306.png +0 -0
- data/public/assets/jquery-ui/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
- data/public/assets/jquery-ui/ui-bg_inset-hard_100_f5f8f9_1x100-519299e2aa31bffdd4fed34b4fac603d.png +0 -0
- data/public/assets/jquery-ui/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
- data/public/assets/jquery-ui/ui-bg_inset-hard_100_fcfdfd_1x100-27e08524d3d56bb59e354435b663c3ac.png +0 -0
- data/public/assets/jquery-ui/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
- data/public/assets/jquery-ui/ui-icons_217bc0_256x240-ed26778199d8722ae064038a1e841bc8.png +0 -0
- data/public/assets/jquery-ui/ui-icons_217bc0_256x240.png +0 -0
- data/public/assets/jquery-ui/ui-icons_2e83ff_256x240-94086d0ce953eb0887ab1b8140903af9.png +0 -0
- data/public/assets/jquery-ui/ui-icons_2e83ff_256x240.png +0 -0
- data/public/assets/jquery-ui/ui-icons_469bdd_256x240-188717a27b4d5504885a03e4ad8e34d1.png +0 -0
- data/public/assets/jquery-ui/ui-icons_469bdd_256x240.png +0 -0
- data/public/assets/jquery-ui/ui-icons_6da8d5_256x240-8f5b417c5604f1b7b5965c98754c33b9.png +0 -0
- data/public/assets/jquery-ui/ui-icons_6da8d5_256x240.png +0 -0
- data/public/assets/jquery-ui/ui-icons_cd0a0a_256x240-8b44e266bdc1f57f1393579591f89222.png +0 -0
- data/public/assets/jquery-ui/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/assets/jquery-ui/ui-icons_d8e7f3_256x240-1b415e411069df902e6f417cc014172c.png +0 -0
- data/public/assets/jquery-ui/ui-icons_d8e7f3_256x240.png +0 -0
- data/public/assets/jquery-ui/ui-icons_f9bd01_256x240-4553d0576c0498ca4c776aa77aa80833.png +0 -0
- data/public/assets/jquery-ui/ui-icons_f9bd01_256x240.png +0 -0
- data/public/assets/json2-fedf627b8fba2c78ab3d5cae6e76914d.js +0 -157
- data/public/assets/json2-fedf627b8fba2c78ab3d5cae6e76914d.js.gz +0 -0
- data/public/assets/json2.js +0 -157
- data/public/assets/json2.js.gz +0 -0
- data/public/assets/manifest-c97d5faf4a7e78bd05753f8155b4995d.css +0 -51
- data/public/assets/manifest-c97d5faf4a7e78bd05753f8155b4995d.css.gz +0 -0
- data/public/assets/manifest-cd131c4bf01ad6a09c034157c8cba00a.js +0 -21
- data/public/assets/manifest-cd131c4bf01ad6a09c034157c8cba00a.js.gz +0 -0
- data/public/assets/manifest.css +0 -51
- data/public/assets/manifest.css.gz +0 -0
- data/public/assets/manifest.js +0 -21
- data/public/assets/manifest.js.gz +0 -0
- data/public/assets/manifest.yml +0 -59
- data/public/assets/minus-1d0fae0720bab52bd98598218e8345c0.gif +0 -0
- data/public/assets/minus.gif +0 -0
- data/public/assets/plus-1a29e46532f839ed9c977ef4613d079f.gif +0 -0
- data/public/assets/plus.gif +0 -0
- data/public/assets/spinner_16x16-17dcf941457ae4e702f4600e714b21c1.gif +0 -0
- data/public/assets/spinner_16x16.gif +0 -0
- data/public/assets/spinner_24x24-78c707c1921b93962ea5edd7f4a74134.gif +0 -0
- data/public/assets/spinner_24x24.gif +0 -0
- data/public/assets/treeview-black-c46d96020e5d79c652af0fb0c6656384.gif +0 -0
- data/public/assets/treeview-black-line-0903c58efd34c3203d132e6f873049f6.gif +0 -0
- data/public/assets/treeview-black-line.gif +0 -0
- data/public/assets/treeview-black.gif +0 -0
- data/public/assets/treeview-default-ee6298d311205d21dc57c01c0696df70.gif +0 -0
- data/public/assets/treeview-default-line-2c4106cfd4d322c6e6565f80702c27cb.gif +0 -0
- data/public/assets/treeview-default-line.gif +0 -0
- data/public/assets/treeview-default.gif +0 -0
- data/public/assets/treeview-famfamfam-20dfef13cd5fd1e08fb61ee68eb9d3fa.gif +0 -0
- data/public/assets/treeview-famfamfam-line-a02cce2b80977e066df83137aae71fa8.gif +0 -0
- data/public/assets/treeview-famfamfam-line.gif +0 -0
- data/public/assets/treeview-famfamfam.gif +0 -0
- data/public/assets/treeview-gray-01bfdcd116e081e23daf13024fd3e4e0.gif +0 -0
- data/public/assets/treeview-gray-line-029b3a7b92ed10ea6c4b6289cb9fa0e3.gif +0 -0
- data/public/assets/treeview-gray-line.gif +0 -0
- data/public/assets/treeview-gray.gif +0 -0
- data/public/assets/treeview-red-2a5abbce598d05c864d845998381eef6.gif +0 -0
- data/public/assets/treeview-red-line-f51e6c30aa3b0ff856900ba85d769f1c.gif +0 -0
- data/public/assets/treeview-red-line.gif +0 -0
- data/public/assets/treeview-red.gif +0 -0
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -48,7 +48,7 @@ in the Gemfile and Cedar does not support a custom `BUNDLE_WITHOUT` config like
|
|
|
48
48
|
|
|
49
49
|
### Custom
|
|
50
50
|
|
|
51
|
-
We recommend running [iQvoc as a Rails engine](https://github.com/innoq/iqvoc/wiki/iQvoc-as-a-Rails-Engine).
|
|
51
|
+
We recommend running [iQvoc as a Rails engine](https://github.com/innoq/iqvoc/wiki/iQvoc-as-a-Rails-Engine).
|
|
52
52
|
Running the cloned source code is possible but any modifications would require a fork.
|
|
53
53
|
|
|
54
54
|
1. Configure your database via `config/database.template.yml`. Don't forget to rename it to `database.yml`
|
|
@@ -64,19 +64,22 @@ class ConceptsController < ApplicationController
|
|
|
64
64
|
format.json do
|
|
65
65
|
# When in single query mode, AR handles ALL includes to be loaded by that
|
|
66
66
|
# one query. We don't want that! So let's do it manually :-)
|
|
67
|
-
ActiveRecord::Associations::Preloader.new(@concept,
|
|
68
|
-
|
|
69
|
-
{ :relations => { :target => [:labelings, :relations] } }]).run
|
|
67
|
+
ActiveRecord::Associations::Preloader.new(@concept, [:labels,
|
|
68
|
+
{ :relations => { :target => [:labelings, :relations] } }]).run
|
|
70
69
|
|
|
70
|
+
published_relations = lambda { |concept|
|
|
71
|
+
return concept.relations.includes(:target).
|
|
72
|
+
merge(Iqvoc::Concept.base_class.published)
|
|
73
|
+
}
|
|
71
74
|
concept_data = {
|
|
72
75
|
:origin => @concept.origin,
|
|
73
76
|
:labels => @concept.labelings.map { |ln| labeling_as_json(ln) },
|
|
74
|
-
:relations => @concept.
|
|
77
|
+
:relations => published_relations.call(@concept).map { |relation|
|
|
75
78
|
concept = relation.target
|
|
76
79
|
{
|
|
77
80
|
:origin => concept.origin,
|
|
78
81
|
:labels => concept.labelings.map { |ln| labeling_as_json(ln) },
|
|
79
|
-
:relations => concept.
|
|
82
|
+
:relations => published_relations.call(concept).count
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
85
|
}
|
|
@@ -84,7 +84,11 @@ module ConceptsHelper
|
|
|
84
84
|
# Renders a partial taken from the .partial_name method of the objects
|
|
85
85
|
# associated to the concept.
|
|
86
86
|
def render_concept_association(hash, concept, association_class, further_options = {})
|
|
87
|
-
html =
|
|
87
|
+
html = if association_class.respond_to?(:hidden?) && association_class.hidden?(concept)
|
|
88
|
+
""
|
|
89
|
+
else
|
|
90
|
+
render(association_class.partial_name(concept), further_options.merge(:concept => concept, :klass => association_class))
|
|
91
|
+
end
|
|
88
92
|
# Convert the already safely buffered string back to a regular one
|
|
89
93
|
# in order to be able to modify it with squish
|
|
90
94
|
if String.new(html).squish.present?
|
|
@@ -18,9 +18,9 @@ module DashboardHelper
|
|
|
18
18
|
|
|
19
19
|
def sorting_controls_for(name)
|
|
20
20
|
content_tag :span, :class => "sorting-controls" do
|
|
21
|
-
link_to(image_tag("
|
|
21
|
+
link_to(image_tag("arrow_up.gif", :class => "arrow_up"),
|
|
22
22
|
dashboard_path(:order => "asc", :by => name.to_s)) +
|
|
23
|
-
link_to(image_tag("
|
|
23
|
+
link_to(image_tag("arrow_down.gif", :class => "arrow_down"),
|
|
24
24
|
dashboard_path(:order => "desc", :by => name.to_s))
|
|
25
25
|
end
|
|
26
26
|
end
|
|
@@ -55,4 +55,14 @@ module NavigationHelper
|
|
|
55
55
|
content_tag :li, content, :class => css_class
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
def quick_search_class
|
|
59
|
+
klass = if Labeling.const_defined?(:SKOSXL)
|
|
60
|
+
Labeling::SKOSXL::Base
|
|
61
|
+
else
|
|
62
|
+
Labeling::SKOS::Base
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
klass.name.parameterize
|
|
66
|
+
end
|
|
67
|
+
|
|
58
68
|
end
|
|
@@ -18,6 +18,11 @@ class Collection::Member::Base < ActiveRecord::Base
|
|
|
18
18
|
|
|
19
19
|
self.table_name = 'collection_members'
|
|
20
20
|
|
|
21
|
+
class_attribute :rdf_namespace, :rdf_predicate
|
|
22
|
+
self.rdf_namespace = nil
|
|
23
|
+
self.rdf_predicate = nil
|
|
24
|
+
|
|
21
25
|
belongs_to :collection, :class_name => 'Collection::Base'
|
|
26
|
+
belongs_to :target, :class_name => 'Concept::Base'
|
|
22
27
|
|
|
23
28
|
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
# Copyright 2012 Hola, S.L.
|
|
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
|
+
class Collection::Member::SKOS::Base < Collection::Member::Base
|
|
18
|
+
|
|
19
|
+
self.rdf_namespace = "skos"
|
|
20
|
+
self.rdf_predicate = "member"
|
|
21
|
+
|
|
22
|
+
def self.build_from_rdf(subject, predicate, object)
|
|
23
|
+
raise "Labeling::SKOS::Base#build_from_rdf: Subject (#{subject}) must be a Collection." unless subject.is_a?(Collection::Base)
|
|
24
|
+
raise "Labeling::SKOS::Base#build_from_rdf: Object (#{object}) must be a Collection or Concept." unless object.is_a?(Collection::Base) or object.is_a?(Concept::Base)
|
|
25
|
+
|
|
26
|
+
if subject.send(:members).select{|rel| rel.collection_id == subject.id || rel.target == object}.empty?
|
|
27
|
+
subject.send(:members) << self.new(:target => object)
|
|
28
|
+
if object.is_a?(Collection::Base)
|
|
29
|
+
subject.send(:subcollections) << object
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
if object.send(:collections).select{|coll| coll.id == subject.id}.empty?
|
|
34
|
+
object.send(:collections) << subject
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
# Copyright 2012 Hola, S.L.
|
|
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
|
+
class Collection::SKOS::Base < Collection::Base
|
|
18
|
+
|
|
19
|
+
self.rdf_namespace = "skos"
|
|
20
|
+
self.rdf_class = "Collection"
|
|
21
|
+
|
|
22
|
+
def build_rdf_subject(document, controller, &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:Collection type is present
|
|
28
|
+
unless self.rdf_namespace == "skos" && self.rdf_class == "Collection"
|
|
29
|
+
subject.Rdf.build_predicate("type", IqRdf::Skos.build_uri("Collection"))
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
return subject
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
<%= simple_form_for collection, :as => :concept, :url => collection.new_record? ? collections_path : collection_path(collection), :html => { :class => 'form-horizontal' } do |f| %>
|
|
8
8
|
<fieldset>
|
|
9
9
|
<legend><%= t 'txt.views.layouts.sections.labels' %></legend>
|
|
10
|
-
|
|
10
|
+
<% if not Iqvoc.const_defined?(:SKOSXL) %>
|
|
11
|
+
<p><%= t 'txt.common.hint_csv_input' %></p>
|
|
12
|
+
<% end %>
|
|
11
13
|
<%- Iqvoc::Concept.labeling_classes.each do |labeling_class, languages| -%>
|
|
12
14
|
<%- languages.each do |language| -%>
|
|
13
15
|
<%= render labeling_class.edit_partial_name(@collection), :f => f,
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
<!-- Labelings -->
|
|
19
19
|
<fieldset>
|
|
20
20
|
<legend><%= Labeling::Base.model_name.human(:count => 2) %></legend>
|
|
21
|
-
|
|
21
|
+
<% if not Iqvoc.const_defined?(:SKOSXL) %>
|
|
22
|
+
<p><%= t 'txt.common.hint_csv_input' %></p>
|
|
23
|
+
<% end %>
|
|
22
24
|
<%- Iqvoc::Concept.labeling_classes.each do |labeling_class, languages| -%>
|
|
23
25
|
<%- languages.each do |language| -%>
|
|
24
26
|
<%= render labeling_class.edit_partial_name(concept), :f => f,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<%- published_param = concept.published? ? nil : "0" -%>
|
|
2
2
|
|
|
3
3
|
<%= sidebar do %>
|
|
4
|
+
<%= sidebar_item :icon => 'share', :text => t('txt.models.concept.uri'), :path => concept_url(concept.origin, :format => nil, :published => published_param, :lang => nil) %>
|
|
4
5
|
<%= sidebar_header t('txt.common.representations') %>
|
|
5
6
|
<%= sidebar_item :icon => 'share', :text => 'HTML', :path => rdf_url(concept.origin, :format => :html, :published => published_param, :lang => nil) %>
|
|
6
7
|
<%= sidebar_item :icon => 'share', :text => 'RDF/XML', :path => rdf_url(concept.origin, :format => :rdf, :published => published_param, :lang => nil), :id => 'rdf_link_xml' %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<%= page_header :title => 'Dashboard' %>
|
|
2
2
|
|
|
3
|
-
<table class="table">
|
|
3
|
+
<table class="table dashboard">
|
|
4
4
|
<thead>
|
|
5
5
|
<tr>
|
|
6
6
|
<th><%= t("txt.views.dashboard.type") %><%= sorting_controls_for(:class) %></th>
|
|
@@ -38,4 +38,4 @@
|
|
|
38
38
|
</table>
|
|
39
39
|
|
|
40
40
|
<%= paginate @items %>
|
|
41
|
-
<%= render 'sidebar' %>
|
|
41
|
+
<%= render 'dashboard/sidebar' %>
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
<
|
|
1
|
+
<h1><%= t("txt.views.errors.not_found.header") %></h1>
|
|
2
2
|
|
|
3
3
|
<p><em><%= @exception.message %></em></p>
|
|
4
4
|
|
|
5
|
-
<p><%= t("txt.views.errors.not_found.tip") %></p>
|
|
6
|
-
<div class="embedded_form">
|
|
7
|
-
<%= render :file => 'search_results/index' %>
|
|
8
|
-
</div>
|
|
5
|
+
<p><%= raw t("txt.views.errors.not_found.tip", :link => link_to(t("txt.views.navigation.search"), search_path)) %></p>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<%= render 'layouts/controls' %>
|
|
18
18
|
|
|
19
19
|
<%= form_tag search_path, :method => :get, :class => "navbar-search pull-right" do %>
|
|
20
|
-
<input type="hidden" name="t" value="
|
|
20
|
+
<input type="hidden" name="t" value="<%= quick_search_class %>">
|
|
21
21
|
<input type="hidden" name="qt" value="exact">
|
|
22
22
|
<input type="hidden" name="for" value="all">
|
|
23
23
|
<input type="hidden" name="l[]" value="<%= I18n.locale %>">
|
data/config/locales/de.yml
CHANGED
|
@@ -93,7 +93,7 @@ de:
|
|
|
93
93
|
unavailable: "Fehlende Übersetzungen für die Hauptsprache nicht verfügbar."
|
|
94
94
|
hierarchical_concepts:
|
|
95
95
|
concepts:
|
|
96
|
-
expired_at: "
|
|
96
|
+
expired_at: "abgelaufen am %{date}"
|
|
97
97
|
select: "Bitte wählen Sie ein %{concept_class_name} aus der unten aufgeführten Liste."
|
|
98
98
|
new: "Neues %{concept_class_name}"
|
|
99
99
|
pref_label: "Bevorzugtes Label"
|
|
@@ -108,7 +108,7 @@ de:
|
|
|
108
108
|
versionview: "Versionsansicht für Label"
|
|
109
109
|
follow_up: "Wiedervorlage"
|
|
110
110
|
endings: "Endungen"
|
|
111
|
-
expired_at: "
|
|
111
|
+
expired_at: "abgelaufen am"
|
|
112
112
|
label_already_exists: "Es gibt bereits ein Label mit der eingegebenen Vorlageform"
|
|
113
113
|
edit:
|
|
114
114
|
header: "Bearbeitung von Label"
|
|
@@ -197,7 +197,7 @@ de:
|
|
|
197
197
|
message: "Ihr Benutzerkonto besitzt keine ausreichenden Rechte, um diese Seite anzuzeigen."
|
|
198
198
|
not_found:
|
|
199
199
|
header: "Nicht gefunden"
|
|
200
|
-
tip: "Nutzen Sie die
|
|
200
|
+
tip: "Nutzen Sie die %{link}, um Inhalte zu finden."
|
|
201
201
|
versioning:
|
|
202
202
|
edit_mode: "Bearbeitung fortsetzen"
|
|
203
203
|
to_edit_mode: "In Bearbeitung versetzen"
|
|
@@ -326,6 +326,7 @@ de:
|
|
|
326
326
|
version_error: "Es existieren schon zwei Versionen dieses Labels"
|
|
327
327
|
value_error: "Die Vorlageform muss ausgefüllt sein!"
|
|
328
328
|
concept:
|
|
329
|
+
uri: "Konzept-URI"
|
|
329
330
|
origin_error: "Origin ungültig!"
|
|
330
331
|
version_error: "Es existieren schon zwei Versionen dieses Konzepts"
|
|
331
332
|
no_pref_label_error: "Es muss mindestens ein bevorzugtes Label angegeben werden."
|
data/config/locales/en.yml
CHANGED
|
@@ -116,7 +116,7 @@ en:
|
|
|
116
116
|
versionview: "Version display of Label"
|
|
117
117
|
follow_up: "Follow up"
|
|
118
118
|
endings: "Endings"
|
|
119
|
-
expired_at: "
|
|
119
|
+
expired_at: "expired at"
|
|
120
120
|
label_already_exists: "There already exists a label with the value"
|
|
121
121
|
edit:
|
|
122
122
|
header: "Editing of label"
|
|
@@ -205,7 +205,7 @@ en:
|
|
|
205
205
|
message: "Your user account has insufficient permissions to display this page."
|
|
206
206
|
not_found:
|
|
207
207
|
header: "Not found"
|
|
208
|
-
tip: "You may want to use
|
|
208
|
+
tip: "You may want to use %{link} to find content."
|
|
209
209
|
versioning:
|
|
210
210
|
edit_mode: "Continue editing"
|
|
211
211
|
to_edit_mode: "Start editing"
|
|
@@ -333,6 +333,7 @@ en:
|
|
|
333
333
|
version_error: "New Label version already exists."
|
|
334
334
|
value_error: "Literal form must be given."
|
|
335
335
|
concept:
|
|
336
|
+
uri: "Concept URI"
|
|
336
337
|
origin_error: "Invalid origin."
|
|
337
338
|
version_error: "New Concept version already exists."
|
|
338
339
|
no_pref_label_error: "At least one preferred label must be specified."
|
data/db/schema.rb
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# It's strongly recommended to check this file into your version control system.
|
|
13
13
|
|
|
14
|
-
ActiveRecord::Schema.define(:version =>
|
|
14
|
+
ActiveRecord::Schema.define(:version => 20120326102037) do
|
|
15
15
|
|
|
16
16
|
create_table "collection_members", :force => true do |t|
|
|
17
17
|
t.integer "collection_id"
|
|
@@ -117,15 +117,6 @@ ActiveRecord::Schema.define(:version => 20120601094501) do
|
|
|
117
117
|
add_index "notes", ["owner_id", "owner_type", "type"], :name => "ix_notes_fk_type"
|
|
118
118
|
add_index "notes", ["type"], :name => "ix_notes_on_type"
|
|
119
119
|
|
|
120
|
-
create_table "page_requests", :force => true do |t|
|
|
121
|
-
t.string "path"
|
|
122
|
-
t.float "page_duration"
|
|
123
|
-
t.float "view_duration"
|
|
124
|
-
t.float "db_duration"
|
|
125
|
-
t.datetime "created_at", :null => false
|
|
126
|
-
t.datetime "updated_at", :null => false
|
|
127
|
-
end
|
|
128
|
-
|
|
129
120
|
create_table "users", :force => true do |t|
|
|
130
121
|
t.string "forename"
|
|
131
122
|
t.string "surname"
|
|
@@ -6,15 +6,21 @@ module Iqvoc
|
|
|
6
6
|
extend ActiveSupport::Concern
|
|
7
7
|
|
|
8
8
|
included do
|
|
9
|
-
mattr_accessor :base_class_name
|
|
9
|
+
mattr_accessor :base_class_name, :member_class_names
|
|
10
10
|
|
|
11
11
|
self.base_class_name = 'Collection::Unordered'
|
|
12
|
+
|
|
13
|
+
self.member_class_names = ['Collection::Member::SKOS::Base']
|
|
12
14
|
end
|
|
13
15
|
|
|
14
16
|
module ClassMethods
|
|
15
17
|
def base_class
|
|
16
18
|
base_class_name.constantize
|
|
17
19
|
end
|
|
20
|
+
|
|
21
|
+
def member_classes
|
|
22
|
+
member_class_names.map(&:constantize)
|
|
23
|
+
end
|
|
18
24
|
end
|
|
19
25
|
|
|
20
26
|
end
|
data/lib/iqvoc/skos_importer.rb
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
module Iqvoc
|
|
2
2
|
class SkosImporter
|
|
3
3
|
|
|
4
|
-
FIRST_LEVEL_OBJECT_CLASSES = [Iqvoc::Concept.base_class]
|
|
4
|
+
FIRST_LEVEL_OBJECT_CLASSES = [Iqvoc::Concept.base_class, Iqvoc::Collection.base_class]
|
|
5
5
|
SECOND_LEVEL_OBJECT_CLASSES = Iqvoc::Concept.labeling_classes.keys +
|
|
6
6
|
Iqvoc::Concept.note_classes +
|
|
7
7
|
Iqvoc::Concept.relation_classes +
|
|
8
|
-
Iqvoc::Concept.match_classes
|
|
8
|
+
Iqvoc::Concept.match_classes +
|
|
9
|
+
Iqvoc::Collection.member_classes
|
|
9
10
|
|
|
10
11
|
def initialize(file, default_namespace_url, logger = Rails.logger)
|
|
11
12
|
|
|
@@ -72,6 +73,9 @@ module Iqvoc
|
|
|
72
73
|
end
|
|
73
74
|
|
|
74
75
|
def import_first_level_objects(types, subject, predicate, object)
|
|
76
|
+
@logger.debug "types: #{types}"
|
|
77
|
+
@logger.debug "predicate: #{predicate}"
|
|
78
|
+
@logger.debug "subject: #{subject}"
|
|
75
79
|
if (predicate == "rdf:type" && types[object] && subject =~ /^:(.+)$/)
|
|
76
80
|
# We've found a subject definition with a class we know and which is in our responsibility (":")
|
|
77
81
|
origin = $1
|
|
@@ -86,6 +90,7 @@ module Iqvoc
|
|
|
86
90
|
@seen_first_level_objects[origin] = types[object].create!(:origin => origin)
|
|
87
91
|
end
|
|
88
92
|
end
|
|
93
|
+
|
|
89
94
|
end
|
|
90
95
|
|
|
91
96
|
def import_second_level_objects(types, subject, predicate, object)
|
data/lib/iqvoc/version.rb
CHANGED
data/test/unit/hygiene_test.rb
CHANGED
|
@@ -97,5 +97,72 @@ class SkosImportTest < ActiveSupport::TestCase
|
|
|
97
97
|
assert_nil Iqvoc::Concept.base_class.by_origin("1").last
|
|
98
98
|
assert_not_nil Iqvoc::Concept.base_class.by_origin("_1").last
|
|
99
99
|
end
|
|
100
|
+
end
|
|
100
101
|
|
|
102
|
+
class SkosCollectionImportTest < ActiveSupport::TestCase
|
|
103
|
+
setup do
|
|
104
|
+
Iqvoc::Concept.pref_labeling_class_name = 'Labeling::SKOS::PrefLabel'
|
|
105
|
+
|
|
106
|
+
Iqvoc.config.register_setting("languages.pref_labeling", ["de", "en"])
|
|
107
|
+
Iqvoc.config.register_setting("languages.further_labelings.Labeling::SKOS::AltLabel", ["de", "en"])
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
TEST_DATA = (<<-DATA
|
|
111
|
+
<http://www.example.com/land-animal> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2008/05/skos#Collection> .
|
|
112
|
+
<http://www.example.com/land-animal> <http://www.w3.org/2008/05/skos#prefLabel> "Landtier"@de .
|
|
113
|
+
<http://www.example.com/land-animal> <http://www.w3.org/2008/05/skos#prefLabel> "Land animal"@en .
|
|
114
|
+
<http://www.example.com/legged-animal> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2008/05/skos#Collection> .
|
|
115
|
+
<http://www.example.com/legged-animal> <http://www.w3.org/2008/05/skos#prefLabel> "Vierbeinige Tier"@de .
|
|
116
|
+
<http://www.example.com/legged-animal> <http://www.w3.org/2008/05/skos#prefLabel> "Four legged animal"@en .
|
|
117
|
+
<http://www.example.com/cow> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2008/05/skos#Concept> .
|
|
118
|
+
<http://www.example.com/cow> <http://www.w3.org/2008/05/skos#prefLabel> "Kuh"@de .
|
|
119
|
+
<http://www.example.com/cow> <http://www.w3.org/2008/05/skos#prefLabel> "Cow"@en .
|
|
120
|
+
<http://www.example.com/snake> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2008/05/skos#Concept> .
|
|
121
|
+
<http://www.example.com/snake> <http://www.w3.org/2008/05/skos#prefLabel> "Schlange"@de .
|
|
122
|
+
<http://www.example.com/snake> <http://www.w3.org/2008/05/skos#prefLabel> "Snake"@en .
|
|
123
|
+
<http://www.example.com/donkey> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2008/05/skos#Concept> .
|
|
124
|
+
<http://www.example.com/donkey> <http://www.w3.org/2008/05/skos#prefLabel> "Esel"@de .
|
|
125
|
+
<http://www.example.com/donkey> <http://www.w3.org/2008/05/skos#prefLabel> "Donkey"@en .
|
|
126
|
+
<http://www.example.com/legged-animal> <http://www.w3.org/2004/02/skos/core#member> <http://www.example.com/cow> .
|
|
127
|
+
<http://www.example.com/legged-animal> <http://www.w3.org/2004/02/skos/core#member> <http://www.example.com/donkey> .
|
|
128
|
+
<http://www.example.com/land-animal> <http://www.w3.org/2004/02/skos/core#member> <http://www.example.com/legged-animal> .
|
|
129
|
+
<http://www.example.com/land-animal> <http://www.w3.org/2004/02/skos/core#member> <http://www.example.com/snake> .
|
|
130
|
+
DATA
|
|
131
|
+
).split("\n")
|
|
132
|
+
|
|
133
|
+
test "basic importer functionality" do
|
|
134
|
+
assert_difference('Collection::Base.count', 2) do
|
|
135
|
+
Iqvoc::SkosImporter.new(TEST_DATA, "http://www.example.com/")
|
|
136
|
+
end
|
|
137
|
+
concepts = {}
|
|
138
|
+
["cow", "donkey", "snake"].each do |origin|
|
|
139
|
+
concepts[origin] = Iqvoc::Concept.base_class.by_origin(origin).last
|
|
140
|
+
assert_not_nil(concepts[origin], "Couldn't find concept '#{origin}'.")
|
|
141
|
+
assert concepts[origin].published?, "Concept '#{origin}' wasn't published."
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
collections = {}
|
|
145
|
+
["land-animal", "legged-animal"].each do |origin|
|
|
146
|
+
collections[origin] = Iqvoc::Collection.base_class.by_origin(origin).last
|
|
147
|
+
assert_not_nil(collections[origin], "Couldn't find collections '#{origin}'.")
|
|
148
|
+
assert collections[origin].published?, "collections '#{origin}' wasn't published."
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
collection_with_member = concepts["cow"].collections.first
|
|
152
|
+
assert_not_nil collection_with_member
|
|
153
|
+
|
|
154
|
+
concept_member = collections["land-animal"].members.first
|
|
155
|
+
assert_not_nil concept_member
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
test "subcollections importer functionality" do
|
|
159
|
+
assert_difference('Collection::Base.count', 2) do
|
|
160
|
+
Iqvoc::SkosImporter.new(TEST_DATA, "http://www.example.com/")
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
collection_with_subcollections = Iqvoc::Collection.base_class.by_origin("land-animal").last
|
|
164
|
+
assert_not_nil collection_with_subcollections
|
|
165
|
+
assert_not_nil collection_with_subcollections.subcollections.first
|
|
166
|
+
end
|
|
101
167
|
end
|
|
168
|
+
|