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.
Files changed (172) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/Gemfile +9 -16
  4. data/Gemfile.lock +313 -257
  5. data/README.md +1 -1
  6. data/app/aides/entity_logger.rb +27 -0
  7. data/app/aides/maker.rb +1 -1
  8. data/app/aides/origin.rb +1 -1
  9. data/app/aides/{rdfapi.rb → rdf_api.rb} +1 -1
  10. data/app/aides/skos_importer.rb +1 -1
  11. data/app/assets/javascripts/iqvoc/iqvoc.js +4 -3
  12. data/app/assets/javascripts/iqvoc/treeview.js +3 -3
  13. data/app/assets/stylesheets/_framework.scss +1 -1
  14. data/app/controllers/collections/alphabetical_controller.rb +75 -0
  15. data/app/controllers/collections/expired_controller.rb +37 -0
  16. data/app/controllers/collections_controller.rb +22 -28
  17. data/app/controllers/concepts/alphabetical_controller.rb +4 -6
  18. data/app/controllers/concepts/expired_controller.rb +1 -1
  19. data/app/controllers/concepts/hierarchical_controller.rb +18 -15
  20. data/app/controllers/concepts_controller.rb +0 -3
  21. data/app/controllers/concepts_movement_controller.rb +1 -1
  22. data/app/controllers/concerns/controller_extensions.rb +15 -0
  23. data/app/controllers/dashboard_controller.rb +1 -1
  24. data/app/controllers/exports_controller.rb +17 -8
  25. data/app/controllers/rdf_controller.rb +0 -2
  26. data/app/controllers/remote_labels_controller.rb +0 -2
  27. data/app/controllers/search_results_controller.rb +59 -43
  28. data/app/helpers/concepts_helper.rb +2 -2
  29. data/app/helpers/navigation_helper.rb +7 -7
  30. data/app/helpers/rdf_helper.rb +2 -0
  31. data/app/jobs/export_job.rb +4 -7
  32. data/app/models/collection/base.rb +6 -8
  33. data/app/models/collection/member/skos/base.rb +2 -2
  34. data/app/models/collection/skos/base.rb +1 -1
  35. data/app/models/collection/skos/unordered.rb +1 -1
  36. data/app/models/collection/unordered.rb +2 -2
  37. data/app/models/concept/base.rb +2 -10
  38. data/app/models/concept/relation/base.rb +1 -1
  39. data/app/models/concept/relation/skos/base.rb +2 -2
  40. data/app/models/concept/relation/skos/broader/base.rb +2 -2
  41. data/app/models/concept/relation/skos/broader/mono.rb +1 -1
  42. data/app/models/concept/relation/skos/broader/poly.rb +1 -1
  43. data/app/models/concept/relation/skos/narrower/base.rb +1 -1
  44. data/app/models/concept/relation/skos/related.rb +1 -1
  45. data/app/models/concept/skos/base.rb +1 -1
  46. data/app/models/concept/skos/scheme.rb +2 -2
  47. data/app/models/concept/validations.rb +14 -0
  48. data/app/models/concerns/expirable.rb +14 -0
  49. data/app/models/export.rb +21 -9
  50. data/app/models/label/base.rb +19 -1
  51. data/app/models/label/skos/base.rb +1 -1
  52. data/app/models/labeling/base.rb +12 -0
  53. data/app/models/labeling/skos/alt_label.rb +1 -1
  54. data/app/models/labeling/skos/base.rb +4 -4
  55. data/app/models/labeling/skos/hidden_label.rb +1 -1
  56. data/app/models/labeling/skos/pref_label.rb +1 -1
  57. data/app/models/match/skos/base.rb +3 -3
  58. data/app/models/match/skos/broad_match.rb +2 -2
  59. data/app/models/match/skos/close_match.rb +1 -1
  60. data/app/models/match/skos/exact_match.rb +1 -1
  61. data/app/models/match/skos/mapping_relation.rb +1 -1
  62. data/app/models/match/skos/narrow_match.rb +2 -2
  63. data/app/models/match/skos/related_match.rb +1 -1
  64. data/app/models/note/base.rb +2 -2
  65. data/app/models/note/rdfs/see_also.rb +1 -1
  66. data/app/models/note/skos/base.rb +4 -4
  67. data/app/models/note/skos/change_note.rb +2 -2
  68. data/app/models/note/skos/definition.rb +1 -1
  69. data/app/models/note/skos/editorial_note.rb +1 -1
  70. data/app/models/note/skos/example.rb +1 -1
  71. data/app/models/note/skos/history_note.rb +1 -1
  72. data/app/models/note/skos/scope_note.rb +1 -1
  73. data/app/presenters/alphabetical_search_result.rb +2 -2
  74. data/app/services/rdf_sync_service.rb +1 -1
  75. data/app/uploaders/base.rb +4 -3
  76. data/app/view_models/concept_view.rb +1 -1
  77. data/app/views/collections/_data.html.erb +1 -1
  78. data/app/views/collections/_form.html.erb +14 -2
  79. data/app/views/collections/alphabetical/_search_result.html.erb +17 -0
  80. data/app/views/collections/alphabetical/_search_result_remote.html.erb +14 -0
  81. data/app/views/collections/alphabetical/index.html.erb +23 -0
  82. data/app/views/collections/edit.html.erb +1 -1
  83. data/app/views/collections/expired/index.html.erb +23 -0
  84. data/app/views/collections/index.html.erb +1 -1
  85. data/app/views/collections/new.html.erb +1 -1
  86. data/app/views/collections/show_published.html.erb +1 -1
  87. data/app/views/collections/show_unpublished.html.erb +1 -1
  88. data/app/views/collections/sidebars/_plural.html.erb +28 -0
  89. data/app/views/collections/sidebars/_singular.html.erb +22 -0
  90. data/app/views/concepts/_form.html.erb +1 -1
  91. data/app/views/concepts/alphabetical/index.html.erb +1 -1
  92. data/app/views/concepts/expired/index.html.erb +1 -1
  93. data/app/views/concepts/glance.html.erb +1 -1
  94. data/app/views/concepts/scheme/edit.html.erb +1 -1
  95. data/app/views/concepts/sidebars/_plural.html.erb +1 -1
  96. data/app/views/concepts/sidebars/_singular.html.erb +1 -1
  97. data/app/views/dashboard/glance.html.erb +1 -1
  98. data/app/views/exports/index.html.erb +5 -1
  99. data/app/views/exports/show.html.erb +1 -1
  100. data/app/views/partials/collection/_inline_base.html.erb +4 -0
  101. data/app/views/search_results/_sidebar.html.erb +1 -1
  102. data/config/application.rb +7 -2
  103. data/config/ci.rb +20 -0
  104. data/config/database.yml +15 -21
  105. data/config/database.yml.postgresql +13 -20
  106. data/config/engine.rb +1 -0
  107. data/config/environments/development.rb +1 -1
  108. data/config/environments/production.rb +1 -1
  109. data/config/environments/test.rb +1 -1
  110. data/config/initializers/content_security_policy.rb +6 -2
  111. data/config/initializers/filter_parameter_logging.rb +4 -4
  112. data/config/initializers/new_framework_defaults_7_1.rb +280 -0
  113. data/config/initializers/new_framework_defaults_8_0.rb +30 -0
  114. data/config/initializers/new_framework_defaults_8_1.rb +74 -0
  115. data/config/initializers/permissions_policy.rb +11 -9
  116. data/config/initializers/zeitwerk.rb +1 -3
  117. data/config/locales/de.yml +4 -1
  118. data/config/locales/en.yml +4 -1
  119. data/config/locales/pt.yml +2 -1
  120. data/config/puma.rb +34 -35
  121. data/config/routes.rb +3 -1
  122. data/db/migrate/20110510162719_use_mono_hierarchy_instead_of_poly_hierarchy.rb +2 -2
  123. data/db/migrate/20130227145825_fix_collection_type.rb +3 -3
  124. data/db/migrate/20130502151221_fix_collection_member_types.rb +1 -1
  125. data/db/migrate/20250218160045_adapt_zeitwerk_naming_to_iqvoc.rb +25 -0
  126. data/db/migrate/20250326182601_adapt_zeitwerk_skos_naming_to_instance_configuration.rb +11 -0
  127. data/db/schema.rb +100 -1
  128. data/iqvoc.gemspec +4 -4
  129. data/lib/iqvoc/configuration/collection.rb +16 -4
  130. data/lib/iqvoc/configuration/concept.rb +22 -18
  131. data/lib/iqvoc/configuration/core.rb +9 -23
  132. data/lib/iqvoc/configuration/label.rb +1 -1
  133. data/lib/iqvoc/environments/development.rb +62 -57
  134. data/lib/iqvoc/environments/production.rb +70 -67
  135. data/lib/iqvoc/environments/test.rb +44 -38
  136. data/lib/iqvoc/version.rb +1 -1
  137. data/test/controllers/concepts_movement_controller_test.rb +14 -14
  138. data/test/controllers/hierarchy_test.rb +0 -1
  139. data/test/controllers/reverse_match_test.rb +6 -6
  140. data/test/integration/alphabetical_test.rb +5 -5
  141. data/test/integration/browse_concepts_and_labels_test.rb +4 -4
  142. data/test/integration/client_edit_concept_test.rb +1 -1
  143. data/test/integration/collection_browsing_test.rb +2 -2
  144. data/test/integration/collection_circularity_test.rb +10 -10
  145. data/test/integration/collection_test.rb +79 -0
  146. data/test/integration/concept_browsing_test.rb +3 -3
  147. data/test/integration/concept_collection_assignment_test.rb +4 -4
  148. data/test/integration/concept_scheme_browsing_test.rb +7 -7
  149. data/test/integration/edit_collections_test.rb +1 -1
  150. data/test/integration/edit_concepts_test.rb +2 -2
  151. data/test/integration/instance_configuration_browsing_test.rb +1 -1
  152. data/test/integration/note_annotations_test.rb +2 -2
  153. data/test/integration/reverse_match_job_test.rb +9 -9
  154. data/test/integration/search_test.rb +20 -10
  155. data/test/integration/tree_test.rb +5 -5
  156. data/test/integration/untranslated_test.rb +2 -2
  157. data/test/integration_test_helper.rb +7 -0
  158. data/test/models/concept_scheme_test.rb +6 -6
  159. data/test/models/concept_test.rb +38 -38
  160. data/test/models/deep_cloning_test.rb +6 -6
  161. data/test/models/note_test.rb +4 -4
  162. data/test/models/rdf_sync_test.rb +1 -1
  163. data/test/models/rdfapi_test.rb +24 -24
  164. data/test/models/skos_collection_import_test.rb +3 -3
  165. data/test/models/skos_import_test.rb +4 -4
  166. metadata +44 -32
  167. data/app/views/collections/_sidebar.html.erb +0 -20
  168. data/config/environments/heroku.rb +0 -81
  169. data/config/initializers/heroku.rb +0 -24
  170. data/config/secrets.yml +0 -35
  171. /data/{app/helpers → lib}/iqvoc_module_helper.rb +0 -0
  172. /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::Environments
5
- def self.setup_production(config)
6
- # Settings specified here will take precedence over those in config/application.rb.
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
- # Code is not reloaded between requests.
9
- config.cache_classes = true
10
+ # Code is not reloaded between requests.
11
+ config.enable_reloading = false
10
12
 
11
- # Eager load code on boot. This eager loads most of Rails and
12
- # your application in memory, allowing both threaded web servers
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
- # Full error reports are disabled and caching is turned on.
18
- config.consider_all_requests_local = false
19
- config.action_controller.perform_caching = true
16
+ # Full error reports are disabled.
17
+ config.consider_all_requests_local = false
20
18
 
21
- # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
22
- # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
23
- # config.require_master_key = true
19
+ # Turn on fragment caching in view templates.
20
+ config.action_controller.perform_caching = true
24
21
 
25
- # Disable serving static files from the `/public` folder by default since
26
- # Apache or NGINX already handles this.
27
- config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
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
- # Enable serving of images, stylesheets, and JavaScripts from an asset server.
30
- # config.asset_host = "http://assets.example.com"
28
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
29
+ # config.asset_host = "http://assets.example.com"
31
30
 
32
- # Specifies the header that your server uses for sending files.
33
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
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
- # Store uploaded files on the local file system (see config/storage.yml for options).
37
- config.active_storage.service = :local
34
+ # Assume all access to the app is happening through a SSL-terminating reverse proxy.
35
+ # config.assume_ssl = true
38
36
 
39
- # Mount Action Cable outside main process or domain.
40
- # config.action_cable.mount_path = nil
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
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45
- # config.force_ssl = true
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
- # Include generic and useful information about system operation, but avoid logging too much
48
- # information to avoid inadvertent exposure of personally identifiable information (PII).
49
- config.log_level = (ENV['LOG_LEVEL'] || :info)
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
- # Prepend all log lines with the following tags.
52
- config.log_tags = [ :request_id ]
47
+ # Change to "debug" to log everything (including potentially personally-identifiable information!)
48
+ config.log_level = ENV.fetch("LOG_LEVEL", "info")
53
49
 
54
- # Use a different cache store in production.
55
- # config.cache_store = :mem_cache_store
50
+ # Prevent health checks from clogging up the logs.
51
+ config.silence_healthcheck_path = "/up"
56
52
 
57
- # Use a real queuing backend for Active Job (and separate queues per environment).
58
- # config.active_job.queue_adapter = :resque
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
- config.action_mailer.perform_caching = false
56
+ # Replace the default in-process memory cache store with a durable alternative.
57
+ # config.cache_store = :mem_cache_store
62
58
 
63
- # Ignore bad email addresses and do not raise email delivery errors.
64
- # Set this to true and configure the email server for immediate delivery to raise delivery errors.
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
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
68
- # the I18n.default_locale when a translation cannot be found).
69
- config.i18n.fallbacks = true
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
- # Send deprecation notices to registered listeners.
72
- config.active_support.deprecation = :notify
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
- # Log disallowed deprecations.
75
- config.active_support.disallowed_deprecation = :log
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
- # Tell Active Support which deprecation messages to disallow.
78
- config.active_support.disallowed_deprecation_warnings = []
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
- # Use default logging formatter so that PID and timestamp are not suppressed.
81
- config.log_formatter = ::Logger::Formatter.new
82
+ # Do not dump schema after migrations.
83
+ config.active_record.dump_schema_after_migration = false
82
84
 
83
- # Use a different logger for distributed setups.
84
- # require "syslog/logger"
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
- if ENV["RAILS_LOG_TO_STDOUT"].present?
88
- logger = ActiveSupport::Logger.new(STDOUT)
89
- logger.formatter = config.log_formatter
90
- config.logger = ActiveSupport::TaggedLogging.new(logger)
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
- module Iqvoc::Environments
5
- def self.setup_test(config)
6
- # Settings specified here will take precedence over those in config/application.rb.
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
- config.cache_classes = true
14
+ # While tests run files are not watched, reloading is not necessary.
15
+ config.enable_reloading = false
9
16
 
10
- # Do not eager load code on boot. This avoids loading your whole application
11
- # just for the purpose of running a single test. If you are using a tool that
12
- # preloads Rails for running tests, you may have to set it to true.
13
- config.eager_load = false
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
- # Configure public file server for tests with Cache-Control for performance.
16
- config.public_file_server.enabled = true
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
- # Show full error reports and disable caching.
22
- config.consider_all_requests_local = true
23
- config.action_controller.perform_caching = false
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
- # Raise exceptions instead of rendering exception templates.
27
- config.action_dispatch.show_exceptions = false
30
+ # Render exception templates for rescuable exceptions and raise for other exceptions.
31
+ config.action_dispatch.show_exceptions = :rescuable
28
32
 
29
- # Disable request forgery protection in test environment.
30
- config.action_controller.allow_forgery_protection = false
33
+ # Disable request forgery protection in test environment.
34
+ config.action_controller.allow_forgery_protection = false
31
35
 
32
- # Store uploaded files on the local file system in a temporary directory.
33
- config.active_storage.service = :test
36
+ # Store uploaded files on the local file system in a temporary directory.
37
+ config.active_storage.service = :test
34
38
 
35
- config.action_mailer.perform_caching = false
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
- # Tell Action Mailer not to deliver emails to the real world.
38
- # The :test delivery method accumulates sent emails in the
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
- # Print deprecation notices to the stderr.
43
- config.active_support.deprecation = :stderr
47
+ # Print deprecation notices to the stderr.
48
+ config.active_support.deprecation = :stderr
44
49
 
45
- # Raise exceptions for disallowed deprecations.
46
- config.active_support.disallowed_deprecation = :raise
50
+ # Raises error for missing translations.
51
+ config.i18n.raise_on_missing_translations = true
47
52
 
48
- # Tell Active Support which deprecation messages to disallow.
49
- config.active_support.disallowed_deprecation_warnings = []
53
+ # Annotate rendered view with file names.
54
+ # config.action_view.annotate_rendered_view_with_filenames = true
50
55
 
51
- # Raises error for missing translations.
52
- config.i18n.raise_on_missing_translations = true
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
- # Annotate rendered view with file names.
55
- # config.action_view.annotate_rendered_view_with_filenames = true
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
@@ -15,5 +15,5 @@
15
15
  # limitations under the License.
16
16
 
17
17
  module Iqvoc
18
- VERSION = "4.14.5"
18
+ VERSION = "4.15.0"
19
19
  end
@@ -36,19 +36,19 @@ class ConceptsMovementControllerTest < ActionController::TestCase
36
36
  # - Air Sport
37
37
  # + Sports
38
38
  #
39
- @air_sports = Concept::SKOS::Base.new.tap do |c|
40
- RDFAPI.devour c, 'skos:prefLabel', '"Air sports"@en'
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::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
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::SKOS::Base.new(top_term: true).tap do |c|
51
- RDFAPI.devour c, 'skos:prefLabel', '"Sports"@en'
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::SKOS::Base.new.tap do |c|
132
- RDFAPI.devour c, 'skos:prefLabel', '"Air sports"@en'
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::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
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::SKOS::Base.new(top_term: true).tap do |c|
141
- RDFAPI.devour c, 'skos:prefLabel', '"Sports"@en'
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::SKOS::Base.new.tap do |c|
37
- RDFAPI.devour c, 'skos:prefLabel', '"Achievement hobbies"@en'
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::SKOS::Base.new.tap do |c|
43
- RDFAPI.devour c, 'skos:prefLabel', '"Airsoft"@en'
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::SKOS::NarrowMatch.create concept_id: @achievement_hobbies.id, value: 'http://iqvoc.net'
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::SKOS::NarrowMatch.create concept_id: @achievement_hobbies.id, value: 'http://iqvoc.net'
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 = RDFAPI.devour "concept_#{i}", 'a', 'skos:Concept'
27
+ concept = RdfApi.devour "concept_#{i}", 'a', 'skos:Concept'
28
28
  labelings = []
29
29
  hsh.each do |lang, val|
30
- RDFAPI.devour concept, 'skos:prefLabel', "\"#{val}\"@#{lang}"
30
+ RdfApi.devour concept, 'skos:prefLabel', "\"#{val}\"@#{lang}"
31
31
  end
32
32
  concept.publish.save
33
33
  end
34
34
 
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'
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::SKOS::Base.new.publish
22
+ concept = Concept::Skos::Base.new.publish
23
23
  concept.save
24
- RDFAPI.devour concept, 'skos:prefLabel', literal
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::SKOS::Base.create! do |c|
60
+ concept = Concept::Skos::Base.create! do |c|
61
61
  c.expired_at = 2.days.ago
62
62
  end
63
- RDFAPI.devour concept, 'skos:prefLabel', literal
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::SKOS::Base.new.publish
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
- RDFAPI.devour c, 'skos:prefLabel', '"Indoors"@en'
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
- RDFAPI.devour c, 'skos:prefLabel', '"Outdoors"@en'
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
- RDFAPI.devour @coll1, 'skos:prefLabel', '"coll1"@en'
24
+ RdfApi.devour @coll1, 'skos:prefLabel', '"coll1"@en'
25
25
  @coll2 = Iqvoc::Collection.base_class.new.tap { |c| c.save }
26
- RDFAPI.devour @coll2, 'skos:prefLabel', '"coll2"@en'
26
+ RdfApi.devour @coll2, 'skos:prefLabel', '"coll2"@en'
27
27
  @coll3 = Iqvoc::Collection.base_class.new.tap { |c| c.save }
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'
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::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 }
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
- RDFAPI.devour c, 'skos:prefLabel', '"Sports"@en'
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
- RDFAPI.devour c, 'skos:prefLabel', '"Hobbies"@en'
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::SKOS::Base.new.tap do |c|
38
- RDFAPI.devour c, 'skos:prefLabel', '"Testcollection"@en'
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