iqvoc 4.14.5 → 4.15.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/Gemfile +9 -16
- data/Gemfile.lock +313 -257
- data/README.md +1 -1
- data/app/aides/entity_logger.rb +27 -0
- data/app/aides/maker.rb +1 -1
- data/app/aides/origin.rb +1 -1
- data/app/aides/{rdfapi.rb → rdf_api.rb} +1 -1
- data/app/aides/skos_importer.rb +1 -1
- data/app/assets/javascripts/iqvoc/iqvoc.js +4 -3
- data/app/assets/javascripts/iqvoc/treeview.js +3 -3
- data/app/assets/stylesheets/_framework.scss +1 -1
- data/app/controllers/collections/alphabetical_controller.rb +75 -0
- data/app/controllers/collections/expired_controller.rb +37 -0
- data/app/controllers/collections_controller.rb +22 -28
- data/app/controllers/concepts/alphabetical_controller.rb +4 -6
- data/app/controllers/concepts/expired_controller.rb +1 -1
- data/app/controllers/concepts/hierarchical_controller.rb +18 -15
- data/app/controllers/concepts_controller.rb +0 -3
- data/app/controllers/concepts_movement_controller.rb +1 -1
- data/app/controllers/concerns/controller_extensions.rb +15 -0
- data/app/controllers/dashboard_controller.rb +1 -1
- data/app/controllers/exports_controller.rb +17 -8
- data/app/controllers/rdf_controller.rb +0 -2
- data/app/controllers/remote_labels_controller.rb +0 -2
- data/app/controllers/search_results_controller.rb +59 -43
- data/app/helpers/concepts_helper.rb +2 -2
- data/app/helpers/navigation_helper.rb +7 -7
- data/app/helpers/rdf_helper.rb +2 -0
- data/app/jobs/export_job.rb +4 -7
- data/app/models/collection/base.rb +6 -8
- data/app/models/collection/member/skos/base.rb +2 -2
- data/app/models/collection/skos/base.rb +1 -1
- data/app/models/collection/skos/unordered.rb +1 -1
- data/app/models/collection/unordered.rb +2 -2
- data/app/models/concept/base.rb +2 -10
- data/app/models/concept/relation/base.rb +1 -1
- data/app/models/concept/relation/skos/base.rb +2 -2
- data/app/models/concept/relation/skos/broader/base.rb +2 -2
- data/app/models/concept/relation/skos/broader/mono.rb +1 -1
- data/app/models/concept/relation/skos/broader/poly.rb +1 -1
- data/app/models/concept/relation/skos/narrower/base.rb +1 -1
- data/app/models/concept/relation/skos/related.rb +1 -1
- data/app/models/concept/skos/base.rb +1 -1
- data/app/models/concept/skos/scheme.rb +2 -2
- data/app/models/concept/validations.rb +14 -0
- data/app/models/concerns/expirable.rb +14 -0
- data/app/models/export.rb +21 -9
- data/app/models/label/base.rb +19 -1
- data/app/models/label/skos/base.rb +1 -1
- data/app/models/labeling/base.rb +12 -0
- data/app/models/labeling/skos/alt_label.rb +1 -1
- data/app/models/labeling/skos/base.rb +4 -4
- data/app/models/labeling/skos/hidden_label.rb +1 -1
- data/app/models/labeling/skos/pref_label.rb +1 -1
- data/app/models/match/skos/base.rb +3 -3
- data/app/models/match/skos/broad_match.rb +2 -2
- data/app/models/match/skos/close_match.rb +1 -1
- data/app/models/match/skos/exact_match.rb +1 -1
- data/app/models/match/skos/mapping_relation.rb +1 -1
- data/app/models/match/skos/narrow_match.rb +2 -2
- data/app/models/match/skos/related_match.rb +1 -1
- data/app/models/note/base.rb +2 -2
- data/app/models/note/rdfs/see_also.rb +1 -1
- data/app/models/note/skos/base.rb +4 -4
- data/app/models/note/skos/change_note.rb +2 -2
- data/app/models/note/skos/definition.rb +1 -1
- data/app/models/note/skos/editorial_note.rb +1 -1
- data/app/models/note/skos/example.rb +1 -1
- data/app/models/note/skos/history_note.rb +1 -1
- data/app/models/note/skos/scope_note.rb +1 -1
- data/app/presenters/alphabetical_search_result.rb +2 -2
- data/app/services/rdf_sync_service.rb +1 -1
- data/app/uploaders/base.rb +4 -3
- data/app/view_models/concept_view.rb +1 -1
- data/app/views/collections/_data.html.erb +1 -1
- data/app/views/collections/_form.html.erb +14 -2
- data/app/views/collections/alphabetical/_search_result.html.erb +17 -0
- data/app/views/collections/alphabetical/_search_result_remote.html.erb +14 -0
- data/app/views/collections/alphabetical/index.html.erb +23 -0
- data/app/views/collections/edit.html.erb +1 -1
- data/app/views/collections/expired/index.html.erb +23 -0
- data/app/views/collections/index.html.erb +1 -1
- data/app/views/collections/new.html.erb +1 -1
- data/app/views/collections/show_published.html.erb +1 -1
- data/app/views/collections/show_unpublished.html.erb +1 -1
- data/app/views/collections/sidebars/_plural.html.erb +28 -0
- data/app/views/collections/sidebars/_singular.html.erb +22 -0
- data/app/views/concepts/_form.html.erb +1 -1
- data/app/views/concepts/alphabetical/index.html.erb +1 -1
- data/app/views/concepts/expired/index.html.erb +1 -1
- data/app/views/concepts/glance.html.erb +1 -1
- data/app/views/concepts/scheme/edit.html.erb +1 -1
- data/app/views/concepts/sidebars/_plural.html.erb +1 -1
- data/app/views/concepts/sidebars/_singular.html.erb +1 -1
- data/app/views/dashboard/glance.html.erb +1 -1
- data/app/views/exports/index.html.erb +5 -1
- data/app/views/exports/show.html.erb +1 -1
- data/app/views/partials/collection/_inline_base.html.erb +4 -0
- data/app/views/search_results/_sidebar.html.erb +1 -1
- data/config/application.rb +7 -2
- data/config/ci.rb +20 -0
- data/config/database.yml +15 -21
- data/config/database.yml.postgresql +13 -20
- data/config/engine.rb +1 -0
- data/config/environments/development.rb +1 -1
- data/config/environments/production.rb +1 -1
- data/config/environments/test.rb +1 -1
- data/config/initializers/content_security_policy.rb +6 -2
- data/config/initializers/filter_parameter_logging.rb +4 -4
- data/config/initializers/new_framework_defaults_7_1.rb +280 -0
- data/config/initializers/new_framework_defaults_8_0.rb +30 -0
- data/config/initializers/new_framework_defaults_8_1.rb +74 -0
- data/config/initializers/permissions_policy.rb +11 -9
- data/config/initializers/zeitwerk.rb +1 -3
- data/config/locales/de.yml +4 -1
- data/config/locales/en.yml +4 -1
- data/config/locales/pt.yml +2 -1
- data/config/puma.rb +34 -35
- data/config/routes.rb +3 -1
- data/db/migrate/20110510162719_use_mono_hierarchy_instead_of_poly_hierarchy.rb +2 -2
- data/db/migrate/20130227145825_fix_collection_type.rb +3 -3
- data/db/migrate/20130502151221_fix_collection_member_types.rb +1 -1
- data/db/migrate/20250218160045_adapt_zeitwerk_naming_to_iqvoc.rb +25 -0
- data/db/migrate/20250326182601_adapt_zeitwerk_skos_naming_to_instance_configuration.rb +11 -0
- data/db/schema.rb +100 -1
- data/iqvoc.gemspec +4 -4
- data/lib/iqvoc/configuration/collection.rb +16 -4
- data/lib/iqvoc/configuration/concept.rb +22 -18
- data/lib/iqvoc/configuration/core.rb +9 -23
- data/lib/iqvoc/configuration/label.rb +1 -1
- data/lib/iqvoc/environments/development.rb +62 -57
- data/lib/iqvoc/environments/production.rb +70 -67
- data/lib/iqvoc/environments/test.rb +44 -38
- data/lib/iqvoc/version.rb +1 -1
- data/test/controllers/concepts_movement_controller_test.rb +14 -14
- data/test/controllers/hierarchy_test.rb +0 -1
- data/test/controllers/reverse_match_test.rb +6 -6
- data/test/integration/alphabetical_test.rb +5 -5
- data/test/integration/browse_concepts_and_labels_test.rb +4 -4
- data/test/integration/client_edit_concept_test.rb +1 -1
- data/test/integration/collection_browsing_test.rb +2 -2
- data/test/integration/collection_circularity_test.rb +10 -10
- data/test/integration/collection_test.rb +79 -0
- data/test/integration/concept_browsing_test.rb +3 -3
- data/test/integration/concept_collection_assignment_test.rb +4 -4
- data/test/integration/concept_scheme_browsing_test.rb +7 -7
- data/test/integration/edit_collections_test.rb +1 -1
- data/test/integration/edit_concepts_test.rb +2 -2
- data/test/integration/instance_configuration_browsing_test.rb +1 -1
- data/test/integration/note_annotations_test.rb +2 -2
- data/test/integration/reverse_match_job_test.rb +9 -9
- data/test/integration/search_test.rb +20 -10
- data/test/integration/tree_test.rb +5 -5
- data/test/integration/untranslated_test.rb +2 -2
- data/test/integration_test_helper.rb +7 -0
- data/test/models/concept_scheme_test.rb +6 -6
- data/test/models/concept_test.rb +38 -38
- data/test/models/deep_cloning_test.rb +6 -6
- data/test/models/note_test.rb +4 -4
- data/test/models/rdf_sync_test.rb +1 -1
- data/test/models/rdfapi_test.rb +24 -24
- data/test/models/skos_collection_import_test.rb +3 -3
- data/test/models/skos_import_test.rb +4 -4
- metadata +44 -32
- data/app/views/collections/_sidebar.html.erb +0 -20
- data/config/environments/heroku.rb +0 -81
- data/config/initializers/heroku.rb +0 -24
- data/config/secrets.yml +0 -35
- /data/{app/helpers → lib}/iqvoc_module_helper.rb +0 -0
- /data/{app/models/concerns → lib}/search_extension.rb +0 -0
|
@@ -1,96 +1,99 @@
|
|
|
1
1
|
require "active_support/core_ext/integer/time"
|
|
2
2
|
require 'iqvoc'
|
|
3
3
|
|
|
4
|
-
module Iqvoc
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
module Iqvoc
|
|
5
|
+
module Environments
|
|
6
|
+
module Production
|
|
7
|
+
def self.setup(config)
|
|
8
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
# Code is not reloaded between requests.
|
|
11
|
+
config.enable_reloading = false
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
# and those relying on copy on write to perform better.
|
|
14
|
-
# Rake tasks automatically ignore this option for performance.
|
|
15
|
-
config.eager_load = true
|
|
13
|
+
# Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
|
|
14
|
+
config.eager_load = true
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
config.action_controller.perform_caching = true
|
|
16
|
+
# Full error reports are disabled.
|
|
17
|
+
config.consider_all_requests_local = false
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
# config.require_master_key = true
|
|
19
|
+
# Turn on fragment caching in view templates.
|
|
20
|
+
config.action_controller.perform_caching = true
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
# Cache assets for far-future expiry since they are all digest stamped.
|
|
23
|
+
config.public_file_server.headers = {
|
|
24
|
+
'cache-control' => "public, s-maxage=#{365.days.to_i}, max-age=#{365.days.to_i}, immutable",
|
|
25
|
+
'expires' => 1.year.from_now.to_formatted_s(:rfc822)
|
|
26
|
+
}
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
|
29
|
+
# config.asset_host = "http://assets.example.com"
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
|
|
31
|
+
# Store uploaded files on the local file system (see config/storage.yml for options).
|
|
32
|
+
config.active_storage.service = :local
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
# Assume all access to the app is happening through a SSL-terminating reverse proxy.
|
|
35
|
+
# config.assume_ssl = true
|
|
38
36
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
# config.action_cable.url = "wss://example.com/cable"
|
|
42
|
-
# config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
|
|
37
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
|
38
|
+
# config.force_ssl = true
|
|
43
39
|
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
# Skip http-to-https redirect for the default health check endpoint.
|
|
41
|
+
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
|
|
46
42
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
# Log to STDOUT with the current request id as a default log tag.
|
|
44
|
+
# config.log_tags = [ :request_id ]
|
|
45
|
+
config.logger = ActiveSupport::Logger.new(STDOUT)
|
|
50
46
|
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
# Change to "debug" to log everything (including potentially personally-identifiable information!)
|
|
48
|
+
config.log_level = ENV.fetch("LOG_LEVEL", "info")
|
|
53
49
|
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
# Prevent health checks from clogging up the logs.
|
|
51
|
+
config.silence_healthcheck_path = "/up"
|
|
56
52
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
# config.active_job.queue_name_prefix = "iqvoc_production"
|
|
53
|
+
# Don't log any deprecations.
|
|
54
|
+
config.active_support.report_deprecations = false
|
|
60
55
|
|
|
61
|
-
|
|
56
|
+
# Replace the default in-process memory cache store with a durable alternative.
|
|
57
|
+
# config.cache_store = :mem_cache_store
|
|
62
58
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
# config.action_mailer.raise_delivery_errors = false
|
|
59
|
+
# Replace the default in-process and non-durable queuing backend for Active Job.
|
|
60
|
+
# config.active_job.queue_adapter = :resque
|
|
66
61
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
|
63
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
|
64
|
+
# config.action_mailer.raise_delivery_errors = false
|
|
70
65
|
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
# Set host to be used by links generated in mailer templates.
|
|
67
|
+
config.action_mailer.default_url_options = { host: "example.com" }
|
|
73
68
|
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
# Specify outgoing SMTP server. Remember to add smtp/* credentials via bin/rails credentials:edit.
|
|
70
|
+
# config.action_mailer.smtp_settings = {
|
|
71
|
+
# user_name: Rails.application.credentials.dig(:smtp, :user_name),
|
|
72
|
+
# password: Rails.application.credentials.dig(:smtp, :password),
|
|
73
|
+
# address: "smtp.example.com",
|
|
74
|
+
# port: 587,
|
|
75
|
+
# authentication: :plain
|
|
76
|
+
# }
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
79
|
+
# the I18n.default_locale when a translation cannot be found).
|
|
80
|
+
config.i18n.fallbacks = true
|
|
79
81
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
# Do not dump schema after migrations.
|
|
83
|
+
config.active_record.dump_schema_after_migration = false
|
|
82
84
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
|
|
85
|
+
# Only use :id for inspections in production.
|
|
86
|
+
config.active_record.attributes_for_inspect = [ :id ]
|
|
86
87
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
# Enable DNS rebinding protection and other `Host` header attacks.
|
|
89
|
+
# config.hosts = [
|
|
90
|
+
# "example.com", # Allow requests from example.com
|
|
91
|
+
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
|
|
92
|
+
# ]
|
|
93
|
+
#
|
|
94
|
+
# Skip DNS rebinding protection for the default health check endpoint.
|
|
95
|
+
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
|
|
96
|
+
end
|
|
91
97
|
end
|
|
92
|
-
|
|
93
|
-
# Do not dump schema after migrations.
|
|
94
|
-
config.active_record.dump_schema_after_migration = false
|
|
95
98
|
end
|
|
96
99
|
end
|
|
@@ -1,57 +1,63 @@
|
|
|
1
1
|
require "active_support/core_ext/integer/time"
|
|
2
2
|
require 'iqvoc'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
# The test environment is used exclusively to run your application's
|
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
|
8
|
+
module Iqvoc
|
|
9
|
+
module Environments
|
|
10
|
+
module Test
|
|
11
|
+
def self.setup(config)
|
|
12
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
|
7
13
|
|
|
8
|
-
|
|
14
|
+
# While tests run files are not watched, reloading is not necessary.
|
|
15
|
+
config.enable_reloading = false
|
|
9
16
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
# Eager loading loads your entire application. When running a single test locally,
|
|
18
|
+
# this is usually not necessary, and can slow down your test suite. However, it's
|
|
19
|
+
# recommended that you enable it in continuous integration systems to ensure eager
|
|
20
|
+
# loading is working properly before deploying your code.
|
|
21
|
+
config.eager_load = ENV["CI"].present?
|
|
14
22
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
config.public_file_server.headers = {
|
|
18
|
-
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
|
|
19
|
-
}
|
|
23
|
+
# Configure public file server for tests with cache-control for performance.
|
|
24
|
+
config.public_file_server.headers = { "cache-control" => "public, max-age=3600" }
|
|
20
25
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
config.cache_store = :null_store
|
|
26
|
+
# Show full error reports.
|
|
27
|
+
config.consider_all_requests_local = true
|
|
28
|
+
config.cache_store = :null_store
|
|
25
29
|
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
# Render exception templates for rescuable exceptions and raise for other exceptions.
|
|
31
|
+
config.action_dispatch.show_exceptions = :rescuable
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
# Disable request forgery protection in test environment.
|
|
34
|
+
config.action_controller.allow_forgery_protection = false
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
# Store uploaded files on the local file system in a temporary directory.
|
|
37
|
+
config.active_storage.service = :test
|
|
34
38
|
|
|
35
|
-
|
|
39
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
|
40
|
+
# The :test delivery method accumulates sent emails in the
|
|
41
|
+
# ActionMailer::Base.deliveries array.
|
|
42
|
+
config.action_mailer.delivery_method = :test
|
|
36
43
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
# ActionMailer::Base.deliveries array.
|
|
40
|
-
config.action_mailer.delivery_method = :test
|
|
44
|
+
# Set host to be used by links generated in mailer templates.
|
|
45
|
+
config.action_mailer.default_url_options = { host: "example.com" }
|
|
41
46
|
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
# Print deprecation notices to the stderr.
|
|
48
|
+
config.active_support.deprecation = :stderr
|
|
44
49
|
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
# Raises error for missing translations.
|
|
51
|
+
config.i18n.raise_on_missing_translations = true
|
|
47
52
|
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
# Annotate rendered view with file names.
|
|
54
|
+
# config.action_view.annotate_rendered_view_with_filenames = true
|
|
50
55
|
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
# Raise error when a before_action's only/except options reference missing actions.
|
|
57
|
+
config.action_controller.raise_on_missing_callback_actions = true
|
|
53
58
|
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
config.autoload_paths << Rails.root.join('test/support')
|
|
60
|
+
end
|
|
61
|
+
end
|
|
56
62
|
end
|
|
57
63
|
end
|
data/lib/iqvoc/version.rb
CHANGED
|
@@ -36,19 +36,19 @@ class ConceptsMovementControllerTest < ActionController::TestCase
|
|
|
36
36
|
# - Air Sport
|
|
37
37
|
# + Sports
|
|
38
38
|
#
|
|
39
|
-
@air_sports = Concept::
|
|
40
|
-
|
|
39
|
+
@air_sports = Concept::Skos::Base.new.tap do |c|
|
|
40
|
+
RdfApi.devour c, 'skos:prefLabel', '"Air sports"@en'
|
|
41
41
|
c.publish
|
|
42
42
|
c.save
|
|
43
43
|
end
|
|
44
|
-
@achievement_hobbies = Concept::
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
@achievement_hobbies = Concept::Skos::Base.new(top_term: true).tap do |c|
|
|
45
|
+
RdfApi.devour c, 'skos:prefLabel', '"Achievement hobbies"@en'
|
|
46
|
+
RdfApi.devour c, 'skos:narrower', @air_sports
|
|
47
47
|
c.publish
|
|
48
48
|
c.save
|
|
49
49
|
end
|
|
50
|
-
@sports = Concept::
|
|
51
|
-
|
|
50
|
+
@sports = Concept::Skos::Base.new(top_term: true).tap do |c|
|
|
51
|
+
RdfApi.devour c, 'skos:prefLabel', '"Sports"@en'
|
|
52
52
|
c.publish
|
|
53
53
|
c.save
|
|
54
54
|
end
|
|
@@ -128,17 +128,17 @@ class ConceptsMovementControllerTest < ActionController::TestCase
|
|
|
128
128
|
UserSession.create(@admin)
|
|
129
129
|
|
|
130
130
|
# create unpublished concepts
|
|
131
|
-
@air_sports = Concept::
|
|
132
|
-
|
|
131
|
+
@air_sports = Concept::Skos::Base.new.tap do |c|
|
|
132
|
+
RdfApi.devour c, 'skos:prefLabel', '"Air sports"@en'
|
|
133
133
|
c.save
|
|
134
134
|
end
|
|
135
|
-
@achievement_hobbies = Concept::
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
@achievement_hobbies = Concept::Skos::Base.new(top_term: true).tap do |c|
|
|
136
|
+
RdfApi.devour c, 'skos:prefLabel', '"Achievement hobbies"@en'
|
|
137
|
+
RdfApi.devour c, 'skos:narrower', @air_sports
|
|
138
138
|
c.save
|
|
139
139
|
end
|
|
140
|
-
@sports = Concept::
|
|
141
|
-
|
|
140
|
+
@sports = Concept::Skos::Base.new(top_term: true).tap do |c|
|
|
141
|
+
RdfApi.devour c, 'skos:prefLabel', '"Sports"@en'
|
|
142
142
|
c.save
|
|
143
143
|
end
|
|
144
144
|
|
|
@@ -332,7 +332,6 @@ boot:
|
|
|
332
332
|
|
|
333
333
|
get :show, params: { lang: 'en', format: 'html', root: 'foo', siblings: 'true' }
|
|
334
334
|
entries = get_all_entries('ul.concept-hierarchy li')
|
|
335
|
-
# binding.pry
|
|
336
335
|
assert_equal ['Bar', 'Foo'], entries
|
|
337
336
|
|
|
338
337
|
get :show, params: { lang: 'en', format: 'html', root: 'lorem' }
|
|
@@ -33,14 +33,14 @@ class ReverseMatchTest < ActionController::TestCase
|
|
|
33
33
|
|
|
34
34
|
Iqvoc.config['sources.iqvoc'] = ['http://try.iqvoc.net']
|
|
35
35
|
|
|
36
|
-
@achievement_hobbies = Concept::
|
|
37
|
-
|
|
36
|
+
@achievement_hobbies = Concept::Skos::Base.new.tap do |c|
|
|
37
|
+
RdfApi.devour c, 'skos:prefLabel', '"Achievement hobbies"@en'
|
|
38
38
|
c.publish
|
|
39
39
|
c.save
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
@airsoft = Concept::
|
|
43
|
-
|
|
42
|
+
@airsoft = Concept::Skos::Base.new.tap do |c|
|
|
43
|
+
RdfApi.devour c, 'skos:prefLabel', '"Airsoft"@en'
|
|
44
44
|
c.publish
|
|
45
45
|
c.save
|
|
46
46
|
new_version = c.branch
|
|
@@ -56,7 +56,7 @@ class ReverseMatchTest < ActionController::TestCase
|
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
test 'remove non existing match' do
|
|
59
|
-
m = Match::
|
|
59
|
+
m = Match::Skos::NarrowMatch.create concept_id: @achievement_hobbies.id, value: 'http://iqvoc.net'
|
|
60
60
|
patch :remove_match, params: {
|
|
61
61
|
origin: @achievement_hobbies.origin,
|
|
62
62
|
match_class: 'match_skos_relatedmatch',
|
|
@@ -68,7 +68,7 @@ class ReverseMatchTest < ActionController::TestCase
|
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
test 'remove match' do
|
|
71
|
-
m = Match::
|
|
71
|
+
m = Match::Skos::NarrowMatch.create concept_id: @achievement_hobbies.id, value: 'http://iqvoc.net'
|
|
72
72
|
patch :remove_match, params: {
|
|
73
73
|
origin: @achievement_hobbies.origin,
|
|
74
74
|
match_class: 'match_skos_broadmatch',
|
|
@@ -24,17 +24,17 @@ class AlphabeticalConceptsTest < ActionDispatch::IntegrationTest
|
|
|
24
24
|
]
|
|
25
25
|
|
|
26
26
|
data.each_with_index do |hsh, i|
|
|
27
|
-
concept =
|
|
27
|
+
concept = RdfApi.devour "concept_#{i}", 'a', 'skos:Concept'
|
|
28
28
|
labelings = []
|
|
29
29
|
hsh.each do |lang, val|
|
|
30
|
-
|
|
30
|
+
RdfApi.devour concept, 'skos:prefLabel', "\"#{val}\"@#{lang}"
|
|
31
31
|
end
|
|
32
32
|
concept.publish.save
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
Concept::
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
Concept::Skos::Base.new.tap do |c|
|
|
36
|
+
RdfApi.devour c, 'skos:prefLabel', '"Air sports"@en'
|
|
37
|
+
RdfApi.devour c, 'skos:altLabel', '"Berta"@en'
|
|
38
38
|
c.publish
|
|
39
39
|
c.save
|
|
40
40
|
end
|
|
@@ -19,9 +19,9 @@ require File.join(File.expand_path(File.dirname(__FILE__)), '../integration_test
|
|
|
19
19
|
class BrowseConceptsAndLabelsTest < ActionDispatch::IntegrationTest
|
|
20
20
|
setup do
|
|
21
21
|
@concepts = %w("Tree"@en "Forest"@en "Baum"@de "Forst"@de).map do |literal|
|
|
22
|
-
concept = Concept::
|
|
22
|
+
concept = Concept::Skos::Base.new.publish
|
|
23
23
|
concept.save
|
|
24
|
-
|
|
24
|
+
RdfApi.devour concept, 'skos:prefLabel', literal
|
|
25
25
|
concept
|
|
26
26
|
end
|
|
27
27
|
end
|
|
@@ -57,10 +57,10 @@ class BrowseConceptsAndLabelsTest < ActionDispatch::IntegrationTest
|
|
|
57
57
|
test 'showing expired concepts' do
|
|
58
58
|
# prepare database with expired concept
|
|
59
59
|
concepts = %w("Method"@en "Methode"@de).map do |literal|
|
|
60
|
-
concept = Concept::
|
|
60
|
+
concept = Concept::Skos::Base.create! do |c|
|
|
61
61
|
c.expired_at = 2.days.ago
|
|
62
62
|
end
|
|
63
|
-
|
|
63
|
+
RdfApi.devour concept, 'skos:prefLabel', literal
|
|
64
64
|
concept
|
|
65
65
|
end
|
|
66
66
|
|
|
@@ -23,7 +23,7 @@ class ClientEditConceptsTest < ActionDispatch::IntegrationTest
|
|
|
23
23
|
self.use_transactional_tests = false
|
|
24
24
|
|
|
25
25
|
setup do
|
|
26
|
-
@concept = Concept::
|
|
26
|
+
@concept = Concept::Skos::Base.new.publish
|
|
27
27
|
@concept.save
|
|
28
28
|
|
|
29
29
|
Capybara.current_driver = Capybara.javascript_driver
|
|
@@ -21,12 +21,12 @@ class CollectionBrowsingTest < ActionDispatch::IntegrationTest
|
|
|
21
21
|
login('administrator')
|
|
22
22
|
|
|
23
23
|
@indoor = Iqvoc::Collection.base_class.new.publish.tap do |c|
|
|
24
|
-
|
|
24
|
+
RdfApi.devour c, 'skos:prefLabel', '"Indoors"@en'
|
|
25
25
|
c.save
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
@outdoor = Iqvoc::Collection.base_class.new.publish.tap do |c|
|
|
29
|
-
|
|
29
|
+
RdfApi.devour c, 'skos:prefLabel', '"Outdoors"@en'
|
|
30
30
|
c.save
|
|
31
31
|
end
|
|
32
32
|
end
|
|
@@ -21,18 +21,18 @@ class CollectionCircularityTest < ActionDispatch::IntegrationTest
|
|
|
21
21
|
login('administrator')
|
|
22
22
|
|
|
23
23
|
@coll1 = Iqvoc::Collection.base_class.new.tap { |c| c.save }
|
|
24
|
-
|
|
24
|
+
RdfApi.devour @coll1, 'skos:prefLabel', '"coll1"@en'
|
|
25
25
|
@coll2 = Iqvoc::Collection.base_class.new.tap { |c| c.save }
|
|
26
|
-
|
|
26
|
+
RdfApi.devour @coll2, 'skos:prefLabel', '"coll2"@en'
|
|
27
27
|
@coll3 = Iqvoc::Collection.base_class.new.tap { |c| c.save }
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@concept1 = Concept::
|
|
31
|
-
|
|
32
|
-
@concept2 = Concept::
|
|
33
|
-
|
|
34
|
-
@concept3 = Concept::
|
|
35
|
-
|
|
28
|
+
RdfApi.devour @coll3, 'skos:prefLabel', '"coll3"@en'
|
|
29
|
+
|
|
30
|
+
@concept1 = Concept::Skos::Base.new.publish.tap { |c| c.save }
|
|
31
|
+
RdfApi.devour @concept1, 'skos:prefLabel', '"concept1"@en'
|
|
32
|
+
@concept2 = Concept::Skos::Base.new.publish.tap { |c| c.save }
|
|
33
|
+
RdfApi.devour @concept2, 'skos:prefLabel', '"concept2"@en'
|
|
34
|
+
@concept3 = Concept::Skos::Base.new.publish.tap { |c| c.save }
|
|
35
|
+
RdfApi.devour @concept3, 'skos:prefLabel', '"concept3"@en'
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
test 'inline assignments are persisted' do
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
# Copyright 2011-2013 innoQ Deutschland GmbH
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
17
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), '../integration_test_helper')
|
|
18
|
+
|
|
19
|
+
class CollectionTest < ActionDispatch::IntegrationTest
|
|
20
|
+
test 'collection creation' do
|
|
21
|
+
login('administrator')
|
|
22
|
+
visit dashboard_path(lang: 'en')
|
|
23
|
+
|
|
24
|
+
click_link_or_button 'New Collection'
|
|
25
|
+
|
|
26
|
+
# fill in english pref label
|
|
27
|
+
fill_in 'concept_labelings_by_text_labeling_skos_pref_labels_en', with: 'Test-Collection'
|
|
28
|
+
|
|
29
|
+
save_check_and_publish
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
test 'send to review with inconsistent concept' do
|
|
33
|
+
login('administrator')
|
|
34
|
+
visit dashboard_path(lang: 'en')
|
|
35
|
+
click_link_or_button 'New Collection'
|
|
36
|
+
|
|
37
|
+
# Create invalid preflabel
|
|
38
|
+
fill_in 'concept_labelings_by_text_labeling_skos_pref_labels_en', with: 'Foo,Foo'
|
|
39
|
+
click_link_or_button 'Save'
|
|
40
|
+
|
|
41
|
+
# Consistency check should run when sending the collection to review.
|
|
42
|
+
click_link_or_button 'Send to review'
|
|
43
|
+
assert has_content? 'Instance is inconsistent.'
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
test 'editing collection' do
|
|
47
|
+
login('administrator')
|
|
48
|
+
visit dashboard_path(lang: 'en')
|
|
49
|
+
|
|
50
|
+
click_link_or_button 'New Collection'
|
|
51
|
+
|
|
52
|
+
# fill in english pref label
|
|
53
|
+
fill_in 'concept_labelings_by_text_labeling_skos_pref_labels_en', with: 'Test-Collection'
|
|
54
|
+
fill_in 'concept_note_skos_definitions_attributes_0_value', with: 'Test-Definition for Test-Collection'
|
|
55
|
+
|
|
56
|
+
save_check_and_publish
|
|
57
|
+
assert has_content? 'Test-Definition for Test-Collection'
|
|
58
|
+
|
|
59
|
+
click_link_or_button 'Create new version'
|
|
60
|
+
fill_in 'concept_note_skos_definitions_attributes_0_value', with: 'Updated Test-Definition for Test-Collection'
|
|
61
|
+
|
|
62
|
+
save_check_and_publish
|
|
63
|
+
assert has_content? 'Updated Test-Definition for Test-Collection'
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
private
|
|
67
|
+
|
|
68
|
+
def save_check_and_publish
|
|
69
|
+
click_link_or_button 'Save'
|
|
70
|
+
|
|
71
|
+
assert has_content? 'The collection has been successfully saved'
|
|
72
|
+
|
|
73
|
+
click_link_or_button 'Check consistency'
|
|
74
|
+
assert has_content? 'Instance is consistent.'
|
|
75
|
+
|
|
76
|
+
click_link_or_button 'Publish'
|
|
77
|
+
assert has_content? 'Instance has been successfully published.'
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -18,9 +18,9 @@ require File.join(File.expand_path(File.dirname(__FILE__)), '../integration_test
|
|
|
18
18
|
|
|
19
19
|
class ConceptBrowsingTest < ActionDispatch::IntegrationTest
|
|
20
20
|
setup do
|
|
21
|
-
@concept1 = Concept::
|
|
22
|
-
@concept2 = Concept::
|
|
23
|
-
@concept3 = Concept::
|
|
21
|
+
@concept1 = Concept::Skos::Base.new.publish.tap { |c| c.save }
|
|
22
|
+
@concept2 = Concept::Skos::Base.new.publish.tap { |c| c.save }
|
|
23
|
+
@concept3 = Concept::Skos::Base.new.publish.tap { |c| c.save }
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
test 'showing published concept' do
|
|
@@ -21,21 +21,21 @@ class ConceptCollectionAssignmentTest < ActionDispatch::IntegrationTest
|
|
|
21
21
|
login 'administrator'
|
|
22
22
|
|
|
23
23
|
@sports_coll = Iqvoc::Collection.base_class.new.tap do |c|
|
|
24
|
-
|
|
24
|
+
RdfApi.devour c, 'skos:prefLabel', '"Sports"@en'
|
|
25
25
|
c.publish
|
|
26
26
|
c.save
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
@hobbies_coll = Iqvoc::Collection.base_class.new.tap do |c|
|
|
30
|
-
|
|
30
|
+
RdfApi.devour c, 'skos:prefLabel', '"Hobbies"@en'
|
|
31
31
|
c.publish
|
|
32
32
|
c.save
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
test 'concept collection assignment' do
|
|
37
|
-
concept = Concept::
|
|
38
|
-
|
|
37
|
+
concept = Concept::Skos::Base.new.tap do |c|
|
|
38
|
+
RdfApi.devour c, 'skos:prefLabel', '"Testcollection"@en'
|
|
39
39
|
c.publish
|
|
40
40
|
c.save
|
|
41
41
|
end
|