iqvoc 4.0.2 → 4.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +43 -47
- data/app/assets/javascripts/framework.js +1 -1
- data/app/assets/javascripts/iqvoc/extract_concepts.js +19 -0
- data/app/assets/javascripts/iqvoc/iqvoc.js +8 -12
- data/app/assets/javascripts/iqvoc/manifest.js +3 -0
- data/app/assets/javascripts/iqvoc/onebox.js +44 -0
- data/app/assets/javascripts/iqvoc/quicksearch.js +41 -0
- data/app/assets/stylesheets/framework.css +1 -1
- data/app/assets/stylesheets/iqvoc/bootstrap_extensions.css.scss +0 -7
- data/app/assets/stylesheets/iqvoc/components.css.scss +27 -1
- data/app/assets/stylesheets/iqvoc/manifest.css +0 -1
- data/app/controllers/application_controller.rb +1 -1
- data/app/controllers/concepts/alphabetical_controller.rb +5 -1
- data/app/controllers/concepts/untranslated_controller.rb +1 -1
- data/app/controllers/concepts_controller.rb +2 -0
- data/app/controllers/frontpage_controller.rb +23 -0
- data/app/controllers/instance_configuration_controller.rb +10 -2
- data/app/controllers/pages_controller.rb +21 -0
- data/app/controllers/rdf_controller.rb +0 -21
- data/app/helpers/concepts_helper.rb +1 -1
- data/app/helpers/navigation_helper.rb +0 -10
- data/app/helpers/rdf_helper.rb +1 -1
- data/app/models/concept/base.rb +2 -2
- data/app/models/concept/skos/base.rb +1 -1
- data/app/models/label/base.rb +5 -2
- data/app/models/labeling/base.rb +2 -2
- data/app/models/labeling/skos/base.rb +1 -1
- data/app/models/note/base.rb +0 -6
- data/app/models/note/skos/base.rb +20 -8
- data/app/views/concepts/alphabetical/index.html.erb +2 -2
- data/app/views/{rdf/show_concept.iqrdf → concepts/show.iqrdf} +1 -1
- data/app/views/concepts/show_published.html.erb +0 -1
- data/app/views/concepts/show_unpublished.html.erb +0 -1
- data/app/views/concepts/sidebars/_plural.html.erb +3 -3
- data/app/views/concepts/sidebars/_singular.html.erb +4 -5
- data/app/views/concepts/untranslated/index.html.erb +1 -1
- data/app/views/frontpage/index.html.erb +8 -0
- data/app/views/instance_configuration/index.html.erb +8 -5
- data/app/views/layouts/_navigation.html.erb +10 -8
- data/app/views/layouts/application.html.erb +3 -1
- data/app/views/pages/help.html.erb +75 -0
- data/app/views/partials/labeling/skos/_base.html.erb +2 -1
- data/config/initializers/language.rb +1 -1
- data/config/locales/de.yml +8 -0
- data/config/locales/en.yml +8 -0
- data/config/routes.rb +8 -6
- data/lib/generators/app/template.rb +1 -1
- data/lib/iqvoc/ability.rb +3 -0
- data/lib/iqvoc/configuration/collection.rb +2 -2
- data/lib/iqvoc/configuration/concept.rb +1 -1
- data/lib/iqvoc/configuration/core.rb +6 -4
- data/lib/iqvoc/configuration/label.rb +2 -2
- data/lib/iqvoc/controller_extensions.rb +1 -1
- data/lib/iqvoc/environments/development.rb +6 -0
- data/lib/iqvoc/environments/production.rb +6 -0
- data/lib/iqvoc/environments/test.rb +6 -0
- data/lib/iqvoc/instance_configuration.rb +3 -2
- data/lib/iqvoc/skos_importer.rb +23 -0
- data/lib/iqvoc/version.rb +1 -1
- data/lib/tasks/importer.rake +2 -2
- data/test/integration/alphabetical_test.rb +2 -2
- data/test/integration/browse_concepts_and_labels_test.rb +4 -4
- data/test/integration/untranslated_test.rb +3 -3
- data/test/unit/hygiene_test.rb +4 -0
- data/test/unit/instance_configuration_test.rb +17 -1
- data/test/unit/skos_import_test.rb +19 -0
- data/vendor/assets/images/jquery-ui/ui-icons_469bdd_256x240.png +0 -0
- data/vendor/assets/javascripts/{jquery-ui-1.8.20.custom.js → jquery-ui-1.8.23.custom.js} +124 -69
- data/vendor/assets/stylesheets/{jquery-ui-1.8.20.custom.css → jquery-ui-1.8.23.custom.css} +5 -7
- metadata +34 -31
- data/app/assets/javascripts/iqvoc/visualization.js +0 -321
- data/app/views/concepts/_visualization.html.erb +0 -11
- data/vendor/assets/javascripts/excanvas.js +0 -35
- data/vendor/assets/javascripts/jit_rgraph.js +0 -153
data/app/models/note/base.rb
CHANGED
@@ -72,12 +72,6 @@ class Note::Base < ActiveRecord::Base
|
|
72
72
|
|
73
73
|
# ********** Methods
|
74
74
|
|
75
|
-
# TODO: This should move to umt because it highly proprietary
|
76
|
-
def self.from_rdf(str)
|
77
|
-
h = Iqvoc::RdfHelper.split_literal(str)
|
78
|
-
self.new(:value => h[:value], :language => h[:language])
|
79
|
-
end
|
80
|
-
|
81
75
|
def <=>(other)
|
82
76
|
self.to_s.downcase <=> other.to_s.downcase
|
83
77
|
end
|
@@ -20,16 +20,28 @@ class Note::SKOS::Base < Note::Base
|
|
20
20
|
|
21
21
|
def self.build_from_rdf(subject, predicate, object)
|
22
22
|
unless subject.class.reflections.include?(self.name.to_relation_name)
|
23
|
-
raise "Note::SKOS::Base#build_from_rdf: Subject (#{subject}) must be able to
|
23
|
+
raise "Note::SKOS::Base#build_from_rdf: Subject (#{subject}) must be able to receive this kind of note (#{self.class.name} => #{self.class.name.to_relation_name})."
|
24
24
|
end
|
25
|
-
unless object =~ /^"(.+)"(@(.+))$/
|
26
|
-
raise "Note::SKOS::Base#build_from_rdf: Object (#{object}) must be a string literal"
|
27
|
-
end
|
28
|
-
|
29
|
-
lang = $3
|
30
|
-
value = JSON.parse(%Q{["#{$1}"]})[0].gsub("\\n", "\n") # Trick to decode \uHHHHH chars
|
31
25
|
|
32
|
-
|
26
|
+
case object
|
27
|
+
when String # Literal
|
28
|
+
unless object =~ /^"(.*)"(@(.+))$/
|
29
|
+
raise "Note::SKOS::Base#build_from_rdf: Object (#{object}) must be a string literal"
|
30
|
+
end
|
31
|
+
lang = $3
|
32
|
+
value = JSON.parse(%Q{["#{$1}"]})[0].gsub("\\n", "\n") # Trick to decode \uHHHHH chars
|
33
|
+
subject.send(self.name.to_relation_name) << self.new(:value => value, :language => lang)
|
34
|
+
when Array # Blank node
|
35
|
+
note = self.create!(:owner => subject)
|
36
|
+
object.each do |annotation|
|
37
|
+
ns, pred = *annotation.first.split(":", 2)
|
38
|
+
note.annotations.create! do |a|
|
39
|
+
a.namespace = ns
|
40
|
+
a.predicate = pred
|
41
|
+
a.value = annotation.last.match(/^"(.+)"$/)[1]
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
33
45
|
end
|
34
46
|
|
35
47
|
def build_rdf(document, subject)
|
@@ -5,10 +5,10 @@
|
|
5
5
|
<div class="panel">
|
6
6
|
<div class="panel-header centered">
|
7
7
|
<%= letter_selector do |letter| %>
|
8
|
-
<% alphabetical_concepts_path(:
|
8
|
+
<% alphabetical_concepts_path(:prefix => letter.to_s.downcase) %>
|
9
9
|
<% end %>
|
10
10
|
</div>
|
11
|
-
<ul>
|
11
|
+
<ul class="concepts">
|
12
12
|
<%= render :partial => 'pref_labeling', :collection => @pref_labelings %>
|
13
13
|
</ul>
|
14
14
|
</div>
|
@@ -6,13 +6,13 @@
|
|
6
6
|
:active => params[:controller] == 'concepts/hierarchical' %>
|
7
7
|
<%= sidebar_item :text => t("txt.views.navigation.alphabetical"),
|
8
8
|
:icon => 'list-alt',
|
9
|
-
:path => alphabetical_concepts_path(:
|
9
|
+
:path => alphabetical_concepts_path(:prefix => 'a'),
|
10
10
|
:active => params[:controller] == 'concepts/alphabetical' %>
|
11
11
|
<% if I18n.locale.to_s != Iqvoc::Concept.pref_labeling_languages.first %>
|
12
12
|
<%= sidebar_item :icon => 'list-alt',
|
13
13
|
:text => t("txt.views.untranslated_concepts.caption"),
|
14
|
-
:path => untranslated_concepts_path(:
|
14
|
+
:path => untranslated_concepts_path(:prefix => params[:prefix] || 'a'),
|
15
15
|
:active => params[:controller] == 'concepts/untranslated',
|
16
16
|
:id => 'untranslated' %>
|
17
17
|
<% end %>
|
18
|
-
<% end %>
|
18
|
+
<% end %>
|
@@ -1,13 +1,12 @@
|
|
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 =>
|
4
|
+
<%= sidebar_item :icon => 'share', :text => t('txt.models.concept.uri'), :path => rdf_url(concept.origin, :format => nil, :published => published_param, :lang => nil) %>
|
5
5
|
<%= sidebar_header t('txt.common.representations') %>
|
6
|
-
<%= sidebar_item :icon => 'share', :text => 'HTML', :path =>
|
7
|
-
<%= sidebar_item :icon => 'share', :text => 'RDF/XML', :path =>
|
8
|
-
<%= sidebar_item :icon => 'share', :text => 'RDF/Turtle', :path =>
|
6
|
+
<%= sidebar_item :icon => 'share', :text => 'HTML', :path => concept_path(:id => concept, :format => :html, :published => published_param) %>
|
7
|
+
<%= sidebar_item :icon => 'share', :text => 'RDF/XML', :path => concept_path(:id => concept, :format => :rdf, :published => published_param), :id => 'rdf_link_xml' %>
|
8
|
+
<%= sidebar_item :icon => 'share', :text => 'RDF/Turtle', :path => concept_path(:id => concept, :format => :ttl, :published => published_param), :id => 'rdf_link_ttl' %>
|
9
9
|
<%= sidebar_header 'Links' %>
|
10
|
-
<%#= sidebar_item :icon => 'zoom-in', :text => 'Visualization', :path => '#visualization', :'data-toggle' => 'modal' %>
|
11
10
|
<%= sidebar_item :icon => :edit, :text => t('txt.views.concepts.new', :concept_class_name => Iqvoc::Concept.base_class.model_name.human), :path => new_concept_path,
|
12
11
|
:perms => [:create, Iqvoc::Concept.base_class], :active => params[:action] == 'new' %>
|
13
12
|
<% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<div class="onebox">
|
2
|
+
<%= form_tag alphabetical_concepts_path(:prefix => nil), :method => :get do %>
|
3
|
+
<%= search_field_tag "prefix", nil, :id => nil,
|
4
|
+
:class => "onebox-input",
|
5
|
+
:autofocus => true,
|
6
|
+
:placeholder => t("txt.views.frontpage.type_to_browse") %>
|
7
|
+
<% end %>
|
8
|
+
</div>
|
@@ -1,11 +1,14 @@
|
|
1
1
|
<%= page_header :title => t("txt.views.instance_configuration.caption").titleize %>
|
2
2
|
|
3
3
|
<%= form_tag(instance_configuration_path, :method => :put, :class => "") do %>
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
<% @settings.each do |key, value| %>
|
5
|
+
<label>
|
6
|
+
<%= t("txt.views.instance_configuration.settings.#{key.gsub(".", "_")}") %>
|
7
|
+
(<code><%= key %></code>)
|
8
|
+
</label>
|
9
|
+
<%= text_field_tag "config[#{key}]", value %>
|
10
|
+
<% end %>
|
8
11
|
<div class="form-actions">
|
9
|
-
<%= submit_tag t("txt.common.save"), :class =>
|
12
|
+
<%= submit_tag t("txt.common.save"), :class => "btn btn-primary" %>
|
10
13
|
</div>
|
11
14
|
<% end %>
|
@@ -7,21 +7,23 @@
|
|
7
7
|
<span class="icon-bar"></span>
|
8
8
|
<span class="icon-bar"></span>
|
9
9
|
</a>
|
10
|
-
<%= link_to Iqvoc.config[
|
10
|
+
<%= link_to Iqvoc.config["title"], root_path, :class => "brand" %></a>
|
11
11
|
|
12
12
|
<div class="nav-collapse">
|
13
13
|
<ul class="nav">
|
14
14
|
<%= nav_items Iqvoc.navigation_items %>
|
15
15
|
</ul>
|
16
16
|
|
17
|
-
<%= render
|
17
|
+
<%= render "layouts/controls" %>
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
<% unless @suppress_quicksearch %>
|
20
|
+
<%= form_tag alphabetical_concepts_path(:prefix => nil), :method => :get,
|
21
|
+
:class => "navbar-search pull-right" do %>
|
22
|
+
<%= search_field_tag "prefix", nil, :id => nil,
|
23
|
+
:class => "quicksearch search-query span2",
|
24
|
+
:autofocus => (autofocus rescue nil),
|
25
|
+
:placeholder => t("txt.views.navigation.quick_search") %>
|
26
|
+
<% end %>
|
25
27
|
<% end %>
|
26
28
|
</div>
|
27
29
|
|
@@ -19,16 +19,18 @@
|
|
19
19
|
|
20
20
|
<div class="container">
|
21
21
|
<div class="row">
|
22
|
-
<div class="span9" id="content">
|
22
|
+
<div class="<%= content_for?(:sidebar) ? "span9" : "span12" %>" id="content">
|
23
23
|
<%= yield :page_header %>
|
24
24
|
<% flash.each do |type, msg| %>
|
25
25
|
<%= alert(type) { msg } %>
|
26
26
|
<% end %>
|
27
27
|
<%= yield %>
|
28
28
|
</div>
|
29
|
+
<% if content_for?(:sidebar) %>
|
29
30
|
<div class="span3" id="sidebar">
|
30
31
|
<%= yield :sidebar %>
|
31
32
|
</div>
|
33
|
+
<% end %>
|
32
34
|
</div>
|
33
35
|
</div>
|
34
36
|
<script>
|
@@ -0,0 +1,75 @@
|
|
1
|
+
<h1>The Structure of Domain Terminologies in iQvoc</h1>
|
2
|
+
|
3
|
+
<p>Domain terminologies are implemented based on the
|
4
|
+
<a href="http://www.w3.org/TR/skos-reference/">Simple Knowledge Organisation System</a>
|
5
|
+
(SKOS), a W3C recommendation.
|
6
|
+
|
7
|
+
<p>SKOS distinguishes concepts from lexical labels. A <strong>concept</strong>
|
8
|
+
is "an idea or notion; a unit of thought", represented by a globally unique
|
9
|
+
identifier (an HTTP URI). A <strong>label</strong> is a term which is used to
|
10
|
+
refer to a concept, technically "a string of UNICODE characters, such as
|
11
|
+
'romantic love' or 'れんあい', in a given natural language, such as English or
|
12
|
+
Japanese". In most cases there are multiple labels denoting the same concept in
|
13
|
+
the same language. One of them is the preferred label, while the others are
|
14
|
+
alternative labels. If you have heard about "symmetrical vs. non-symmetrical
|
15
|
+
multilingualism" (IFLA Guidelines for Multilingual Thesauri), the basic use case
|
16
|
+
described by SKOS is symmetrical (each concept has a preferred label in each
|
17
|
+
supported language), but the non-symmetrical approach (there is one concept per
|
18
|
+
language with only one preferred label in this language) can be expressed as
|
19
|
+
well.</p>
|
20
|
+
|
21
|
+
<p>There may also be a formal <strong>notation</strong> identifying a concept in
|
22
|
+
some classification system such as the Dewey Decimal Classification. While a
|
23
|
+
notation is a string of UNICODE characters just like a label, obviously a
|
24
|
+
notation has no specific language. It has been taken from a specific
|
25
|
+
classification system instead. There may be multiple notations from different
|
26
|
+
systems for a single concept, just like labels from different languages.</p>
|
27
|
+
|
28
|
+
<p>Usually concepts will have a lexical <strong>definition</strong>, but this is
|
29
|
+
not mandatory. There may also be several annotations, such as a general
|
30
|
+
<strong>note</strong>, a change note, editorial note, history note, scope note,
|
31
|
+
or an example. Technically, a lexical definition is just one kind of a
|
32
|
+
note.</p>
|
33
|
+
|
34
|
+
<p>A more structural definition of a concept is given by its <strong>semantic
|
35
|
+
relations</strong> to other concepts. Basically, we have only two types of
|
36
|
+
relations in SKOS: hierarchical (<strong>broader<strong>,
|
37
|
+
</strong>narrower</strong>) and non-hierarchical (<strong>related</strong>)
|
38
|
+
relations. Both types are strictly disjoint: you will have to decide whether a
|
39
|
+
relation is hierarchical or not, there must not be both relation types between
|
40
|
+
the same two concepts. Some thesauri distinguish different types of hierarchy
|
41
|
+
(as defined by Z39-19-2005): generic (a cat is a mammal), instance (Mimi is a
|
42
|
+
cat), and whole-part (a cat has claws). SKOS does not follow this distinction,
|
43
|
+
"broader" is defined as "more general in meaning", narrower as "more specific".
|
44
|
+
Likewise there is no built-in assumption about transitivity of hierarchical
|
45
|
+
relations. Both broader and narrower are not defined to be transitive, but the
|
46
|
+
technical vocabulary provides means "to draw inferences about the transitive
|
47
|
+
closure of the hierarchical relation".</p>
|
48
|
+
|
49
|
+
<p>The non-hierarchical relation is not further specified. This is due to the
|
50
|
+
design goal of a simple knowledge organisation system. Any not-so-simple
|
51
|
+
application may specialize different types of non-hierarchical relations, such
|
52
|
+
as is-caused-by, in-contradiction-to, has-impact-on, or anything else. Doing so
|
53
|
+
would exceed the limitations of a simple domain terminology and proceed to a
|
54
|
+
more complex ontology. This may be a valid approach, but it is out of scope
|
55
|
+
here.</p>
|
56
|
+
|
57
|
+
<p>Any set of semantically related concepts as described before can make a
|
58
|
+
<strong>concept scheme</strong>. Examples are "thesauri, classification schemes,
|
59
|
+
subject heading lists, taxonomies, 'folksonomies', and other types of controlled
|
60
|
+
vocabulary", such as different domain terminologies.</p>
|
61
|
+
|
62
|
+
<p>Concepts from different concept schemes may have semantic relations as well,
|
63
|
+
but these are called <strong>mapping relations</strong>. There are hierarchical
|
64
|
+
(<strong>narrowerMatch</strong>, <strong>broaderMatch</strong>) and related
|
65
|
+
(<strong>relatedMatch</strong>) mappings just like inside a single concept
|
66
|
+
scheme, but there may as well be some equivalence (<strong>exactMatch</strong>)
|
67
|
+
or similarity (<strong>closeMatch</strong>).</p>
|
68
|
+
|
69
|
+
<p>Finally SKOS defines a second pattern of describing sets of concepts: the
|
70
|
+
<strong>collection</strong>. There may be any kind of use case "where a group of
|
71
|
+
concepts shares something in common, and it is convenient to group them under a
|
72
|
+
common label", but you do not want them to make a concept scheme. In fact a
|
73
|
+
collection may even comprise concepts from different concept schemes, and
|
74
|
+
collections may be nested, mixing collections and concepts on each level just
|
75
|
+
like a file system.</p>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<%= content_tag :div, :class => "relation translation panel", :lang => (defined?(concept) ? lang || nil : nil) do %>
|
2
2
|
<% if defined?(concept) %>
|
3
|
-
|
3
|
+
<% lang_translation = lang.nil? ? t("languages.none") : t("languages.#{lang}") %>
|
4
|
+
<h2><%= klass.model_name.human(:count => 2) %> <small><%= lang_translation %></small></h2>
|
4
5
|
<div class="relation-body">
|
5
6
|
<%= item_listing(concept.labels_for_labeling_class_and_language(klass, lang)) do |label|
|
6
7
|
label.value
|
@@ -2,5 +2,5 @@
|
|
2
2
|
# Rails.application.config.i18n.default_locale = Iqvoc::Concept.pref_labeling_languages.first ? Iqvoc::Concept.pref_labeling_languages.first : ""
|
3
3
|
|
4
4
|
# # Turn on i18n fallback feature
|
5
|
-
# require
|
5
|
+
# require 'i18n/backend/fallbacks'
|
6
6
|
# I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
|
data/config/locales/de.yml
CHANGED
@@ -87,6 +87,11 @@ de:
|
|
87
87
|
logout: "Abmelden"
|
88
88
|
instance_configuration:
|
89
89
|
caption: "Instanzkonfiguration"
|
90
|
+
settings:
|
91
|
+
title: Titel
|
92
|
+
available_languages: verfügbare Sprachen
|
93
|
+
languages_pref_labeling: Sprachen für bevorzugte Labels
|
94
|
+
languages_further_labelings_Labeling::SKOS::AltLabel: Sprachen für alternative Labels
|
90
95
|
alphabetical_concepts:
|
91
96
|
untranslated_concepts:
|
92
97
|
caption: "Fehlende Übersetzungen"
|
@@ -141,6 +146,9 @@ de:
|
|
141
146
|
login: "Login"
|
142
147
|
sections: "Bereiche"
|
143
148
|
quick_search: "Schnellsuche"
|
149
|
+
help: "Hilfe"
|
150
|
+
frontpage:
|
151
|
+
type_to_browse: "Tippen um Konzepte zu durchsuchen"
|
144
152
|
search_results:
|
145
153
|
header: "Suche"
|
146
154
|
inflectionals: "Schreibweisen"
|
data/config/locales/en.yml
CHANGED
@@ -87,6 +87,11 @@ en:
|
|
87
87
|
matches: Concept mappings
|
88
88
|
instance_configuration:
|
89
89
|
caption: "Instance Configuration"
|
90
|
+
settings:
|
91
|
+
title: site title
|
92
|
+
available_languages: available languages
|
93
|
+
languages_pref_labeling: languages for preferred labels
|
94
|
+
languages_further_labelings_Labeling::SKOS::AltLabel: languages for alternative labels
|
90
95
|
alphabetical_concepts:
|
91
96
|
untranslated_concepts:
|
92
97
|
caption: "Missing Translations"
|
@@ -149,6 +154,9 @@ en:
|
|
149
154
|
login: "Login"
|
150
155
|
sections: "Sections"
|
151
156
|
quick_search: "Quick search"
|
157
|
+
help: "Help"
|
158
|
+
frontpage:
|
159
|
+
type_to_browse: "Start typing to browse concepts"
|
152
160
|
search_results:
|
153
161
|
header: "Search"
|
154
162
|
inflectionals: "inflectionals"
|
data/config/routes.rb
CHANGED
@@ -15,7 +15,6 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
|
17
17
|
Rails.application.routes.draw do
|
18
|
-
|
19
18
|
match 'schema(.:format)' => 'pages#schema', :as => 'schema'
|
20
19
|
|
21
20
|
scope '(:lang)', :constraints => lambda { |params, req|
|
@@ -31,6 +30,8 @@ Rails.application.routes.draw do
|
|
31
30
|
|
32
31
|
resources :triple_store_syncs, :only => [:new, :create]
|
33
32
|
|
33
|
+
match "/" => "frontpage#index"
|
34
|
+
|
34
35
|
match "concepts/:origin/branch(.:format)" => "concepts/versions#branch", :as => "concept_versions_branch"
|
35
36
|
match "concepts/:origin/merge(.:format)" => "concepts/versions#merge", :as => "concept_versions_merge"
|
36
37
|
match "concepts/:origin/lock(.:format)" => "concepts/versions#lock", :as => "concept_versions_lock"
|
@@ -38,13 +39,12 @@ Rails.application.routes.draw do
|
|
38
39
|
match "concepts/:origin/to_review(.:format)" => "concepts/versions#to_review", :as => "concept_versions_to_review"
|
39
40
|
match "concepts/:origin/consistency_check(.:format)" => "concepts/versions#consistency_check", :as => "concept_versions_consistency_check"
|
40
41
|
|
41
|
-
match 'alphabetical_concepts/:
|
42
|
-
match 'untranslated_concepts/:
|
42
|
+
match 'alphabetical_concepts(/:prefix)(.:format)' => 'concepts/alphabetical#index', :as => 'alphabetical_concepts'
|
43
|
+
match 'untranslated_concepts/:prefix(.:format)' => 'concepts/untranslated#index', :as => 'untranslated_concepts'
|
43
44
|
match 'hierarchical_concepts(.:format)' => 'concepts/hierarchical#index', :as => 'hierarchical_concepts'
|
44
45
|
|
45
46
|
match 'hierarchical_collections(.:format)' => 'collections/hierarchical#index', :as => 'hierarchical_collections'
|
46
47
|
|
47
|
-
match 'about(.:format)' => 'pages#about', :as => 'about'
|
48
48
|
match 'dashboard(.:format)' => 'dashboard#index', :as => 'dashboard'
|
49
49
|
|
50
50
|
get 'config(.:format)' => 'instance_configuration#index', :as => 'instance_configuration'
|
@@ -55,9 +55,11 @@ Rails.application.routes.draw do
|
|
55
55
|
|
56
56
|
match 'search(.:format)' => 'search_results#index', :as => 'search'
|
57
57
|
|
58
|
-
|
58
|
+
get "help" => "pages#help", :as => "help"
|
59
|
+
|
60
|
+
root :to => 'frontpage#index', :format => nil
|
59
61
|
end
|
60
62
|
|
61
63
|
match '/scheme(.:format)' => 'rdf#scheme', :as => 'scheme'
|
62
|
-
match '/:id(.:format)' => '
|
64
|
+
match '/:id(.:format)' => 'concepts#show', :as => 'rdf'
|
63
65
|
end
|
@@ -34,7 +34,7 @@ Iqvoc.config do |config|
|
|
34
34
|
})
|
35
35
|
end
|
36
36
|
|
37
|
-
# Iqvoc::Concept.base_class_name = "
|
37
|
+
# Iqvoc::Concept.base_class_name = "MyConceptClass"
|
38
38
|
# Iqvoc::Concept.pref_labeling_class_name = "MyLabelingClass"
|
39
39
|
# Iqvoc::Concept.further_relation_class_names << "MyConceptRelationClass"
|
40
40
|
# Iqvoc::Concept.note_class_names = []
|
data/lib/iqvoc/ability.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'active_support/concern'
|
2
2
|
|
3
3
|
module Iqvoc
|
4
4
|
module Configuration
|
@@ -42,6 +42,11 @@ module Iqvoc
|
|
42
42
|
instance_configuration_path },
|
43
43
|
:controller => "instance_configuration",
|
44
44
|
:authorized? => proc { can? :manage, Iqvoc.config }
|
45
|
+
}, {
|
46
|
+
:content => proc { link_to t("txt.views.navigation.help"), help_path },
|
47
|
+
:controller => "pages",
|
48
|
+
:action => "help",
|
49
|
+
:authorized? => proc { can? :read, :help }
|
45
50
|
}, {
|
46
51
|
:content => proc { link_to t("txt.views.navigation.about"), "http://iqvoc.net/" }
|
47
52
|
}
|
@@ -53,9 +58,6 @@ module Iqvoc
|
|
53
58
|
bootstrap/bootstrap.css
|
54
59
|
bootstrap/bootstrap-responsive.css
|
55
60
|
iqvoc/ie_fixes.css
|
56
|
-
excanvas.js
|
57
|
-
jit_rgraph.js
|
58
|
-
iqvoc/visualization.js
|
59
61
|
json2.js
|
60
62
|
bootstrap/bootstrap.js
|
61
63
|
html5.js
|
@@ -74,6 +74,12 @@ module Iqvoc::Environments
|
|
74
74
|
# Prepend all log lines with the following tags
|
75
75
|
# config.log_tags = [ :subdomain, :uuid ]
|
76
76
|
|
77
|
+
# Enforce whitelist mode for mass assignment.
|
78
|
+
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
79
|
+
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
80
|
+
# parameters by using an attr_accessible or attr_protected declaration.
|
81
|
+
config.active_record.whitelist_attributes = false
|
82
|
+
|
77
83
|
# The default URI prefix for RDF data. This will be followed by a document
|
78
84
|
# specific shnippet like (specimenType) and the id.
|
79
85
|
|
@@ -62,6 +62,12 @@ module Iqvoc::Environments
|
|
62
62
|
# Send deprecation notices to registered listeners
|
63
63
|
config.active_support.deprecation = :notify
|
64
64
|
|
65
|
+
# Enforce whitelist mode for mass assignment.
|
66
|
+
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
67
|
+
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
68
|
+
# parameters by using an attr_accessible or attr_protected declaration.
|
69
|
+
config.active_record.whitelist_attributes = false
|
70
|
+
|
65
71
|
# The JDBC driver URL for the connection to the virtuoso triple store.
|
66
72
|
# Login credentials have to be stored here too. See
|
67
73
|
# http://docs.openlinksw.com/virtuoso/VirtuosoDriverJDBC.html#jdbcurl4mat for
|
@@ -44,6 +44,12 @@ module Iqvoc::Environments
|
|
44
44
|
|
45
45
|
# Print deprecation notices to the stderr
|
46
46
|
config.active_support.deprecation = :stderr
|
47
|
+
|
48
|
+
# Enforce whitelist mode for mass assignment.
|
49
|
+
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
50
|
+
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
51
|
+
# parameters by using an attr_accessible or attr_protected declaration.
|
52
|
+
config.active_record.whitelist_attributes = false
|
47
53
|
end
|
48
54
|
|
49
55
|
end
|
@@ -103,7 +103,8 @@ module Iqvoc
|
|
103
103
|
|
104
104
|
# cache current settings
|
105
105
|
@defaults.each_with_object({}) do |(key, default_value), hsh|
|
106
|
-
|
106
|
+
value = @records[key]
|
107
|
+
@settings[key] = value.nil? ? default_value : value
|
107
108
|
end
|
108
109
|
end
|
109
110
|
|
@@ -112,7 +113,7 @@ module Iqvoc
|
|
112
113
|
if value == nil
|
113
114
|
raise TypeError, "nil values not supported"
|
114
115
|
end
|
115
|
-
unless [String, Fixnum, Float, Array].include?(value.class)
|
116
|
+
unless [TrueClass, FalseClass, String, Fixnum, Float, Array].include?(value.class)
|
116
117
|
raise TypeError, "complex values not supported"
|
117
118
|
end
|
118
119
|
end
|
data/lib/iqvoc/skos_importer.rb
CHANGED
@@ -29,6 +29,7 @@ module Iqvoc
|
|
29
29
|
end
|
30
30
|
|
31
31
|
@seen_first_level_objects = {}
|
32
|
+
@blank_nodes = {}
|
32
33
|
|
33
34
|
@existing_origins = {} # To prevent the creation of first level objects we already have
|
34
35
|
FIRST_LEVEL_OBJECT_CLASSES.each do |klass|
|
@@ -43,10 +44,17 @@ module Iqvoc
|
|
43
44
|
private
|
44
45
|
|
45
46
|
def import(file)
|
47
|
+
# Collect blank nodes
|
48
|
+
file.each do |line|
|
49
|
+
identify_blank_nodes(*extract_triple(line))
|
50
|
+
end
|
51
|
+
|
52
|
+
file.rewind if file.is_a?(IO)
|
46
53
|
types = {} # type identifier ("namespace:SomeClass") to Iqvoc class assignment hash
|
47
54
|
FIRST_LEVEL_OBJECT_CLASSES.each do |klass|
|
48
55
|
types["#{klass.rdf_namespace}:#{klass.rdf_class}"] = klass
|
49
56
|
end
|
57
|
+
|
50
58
|
file.each do |line|
|
51
59
|
import_first_level_objects(types, *extract_triple(line))
|
52
60
|
end
|
@@ -72,6 +80,13 @@ module Iqvoc
|
|
72
80
|
|
73
81
|
end
|
74
82
|
|
83
|
+
def identify_blank_nodes(subject, predicate, object)
|
84
|
+
if blank_node?(subject)
|
85
|
+
@blank_nodes[subject] ||= []
|
86
|
+
@blank_nodes[subject] << [predicate, object]
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
75
90
|
def import_first_level_objects(types, subject, predicate, object)
|
76
91
|
@logger.debug "types: #{types}"
|
77
92
|
@logger.debug "predicate: #{predicate}"
|
@@ -114,6 +129,10 @@ module Iqvoc
|
|
114
129
|
end
|
115
130
|
end
|
116
131
|
|
132
|
+
if blank_node?(object)
|
133
|
+
object = @blank_nodes[object]
|
134
|
+
end
|
135
|
+
|
117
136
|
types[predicate].build_from_rdf(subject, predicate, object)
|
118
137
|
end
|
119
138
|
|
@@ -127,6 +146,10 @@ module Iqvoc
|
|
127
146
|
@seen_first_level_objects[origin]
|
128
147
|
end
|
129
148
|
|
149
|
+
def blank_node?(str)
|
150
|
+
str.dup.to_s =~ /^_:.+/
|
151
|
+
end
|
152
|
+
|
130
153
|
def extract_triple(line)
|
131
154
|
raise "'#{line}' doesn't look like valid ntriples data." unless line =~ /^(.*)\.\w*$/
|
132
155
|
line = $1.squish
|
data/lib/iqvoc/version.rb
CHANGED
data/lib/tasks/importer.rake
CHANGED
@@ -6,8 +6,8 @@ namespace :iqvoc do
|
|
6
6
|
task :url => :environment do
|
7
7
|
require 'iqvoc/skos_importer'
|
8
8
|
|
9
|
-
raise "You have to specify an url to be
|
10
|
-
raise "You have to specify a default namespace to be
|
9
|
+
raise "You have to specify an url for the data file to be imported. Example: rake iqvoc:import:url URL=... NAMESPACE=" unless ENV['URL']
|
10
|
+
raise "You have to specify a default namespace for the data to be imported. Example: rake iqvoc:import:url URL=... NAMESPACE=" unless ENV['NAMESPACE']
|
11
11
|
Iqvoc::SkosImporter.new(open(URI.parse(ENV['URL']).to_s), URI.parse(ENV['NAMESPACE']).to_s)
|
12
12
|
end
|
13
13
|
|