iqvoc 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +69 -0
- data/Gemfile.lock +134 -0
- data/LICENSE +13 -0
- data/README.md +68 -0
- data/Rakefile +23 -0
- data/app/controllers/application_controller.rb +125 -0
- data/app/controllers/collections/hierarchical_controller.rb +44 -0
- data/app/controllers/collections_controller.rb +124 -0
- data/app/controllers/concepts/alphabetical_controller.rb +39 -0
- data/app/controllers/concepts/hierarchical_controller.rb +74 -0
- data/app/controllers/concepts/untranslated_controller.rb +38 -0
- data/app/controllers/concepts/versions_controller.rb +119 -0
- data/app/controllers/concepts_controller.rb +174 -0
- data/app/controllers/dashboard_controller.rb +43 -0
- data/app/controllers/pages_controller.rb +22 -0
- data/app/controllers/rdf_controller.rb +43 -0
- data/app/controllers/search_results_controller.rb +101 -0
- data/app/controllers/triple_store_syncs_controller.rb +45 -0
- data/app/controllers/user_sessions_controller.rb +48 -0
- data/app/controllers/users_controller.rb +81 -0
- data/app/helpers/application_helper.rb +60 -0
- data/app/helpers/concepts_helper.rb +86 -0
- data/app/helpers/dashboard_helper.rb +46 -0
- data/app/helpers/rdf_helper.rb +63 -0
- data/app/helpers/search_results_helper.rb +32 -0
- data/app/models/collection/base.rb +161 -0
- data/app/models/collection/member/base.rb +23 -0
- data/app/models/collection/member/collection.rb +33 -0
- data/app/models/collection/member/concept.rb +33 -0
- data/app/models/collection/unordered.rb +18 -0
- data/app/models/concept/base.rb +418 -0
- data/app/models/concept/relation/base.rb +95 -0
- data/app/models/concept/relation/reverse_relation_extension.rb +49 -0
- data/app/models/concept/relation/skos/base.rb +37 -0
- data/app/models/concept/relation/skos/broader/base.rb +41 -0
- data/app/models/concept/relation/skos/broader/mono.rb +28 -0
- data/app/models/concept/relation/skos/broader/poly.rb +23 -0
- data/app/models/concept/relation/skos/narrower/base.rb +37 -0
- data/app/models/concept/relation/skos/related.rb +21 -0
- data/app/models/concept/skos/base.rb +28 -0
- data/app/models/label/base.rb +98 -0
- data/app/models/label/skos/base.rb +27 -0
- data/app/models/labeling/base.rb +81 -0
- data/app/models/labeling/skos/alt_label.rb +21 -0
- data/app/models/labeling/skos/base.rb +99 -0
- data/app/models/labeling/skos/hidden_label.rb +25 -0
- data/app/models/labeling/skos/pref_label.rb +30 -0
- data/app/models/match/base.rb +57 -0
- data/app/models/match/skos/base.rb +23 -0
- data/app/models/match/skos/broad_match.rb +21 -0
- data/app/models/match/skos/close_match.rb +21 -0
- data/app/models/match/skos/exact_match.rb +21 -0
- data/app/models/match/skos/mapping_relation.rb +21 -0
- data/app/models/match/skos/narrow_match.rb +21 -0
- data/app/models/match/skos/related_match.rb +21 -0
- data/app/models/note/annotated/base.rb +29 -0
- data/app/models/note/base.rb +127 -0
- data/app/models/note/skos/base.rb +52 -0
- data/app/models/note/skos/change_note.rb +38 -0
- data/app/models/note/skos/definition.rb +33 -0
- data/app/models/note/skos/editorial_note.rb +21 -0
- data/app/models/note/skos/example.rb +21 -0
- data/app/models/note/skos/history_note.rb +21 -0
- data/app/models/note/skos/scope_note.rb +21 -0
- data/app/models/origin_mapping.rb +58 -0
- data/app/models/rdf_store.rb +96 -0
- data/app/models/search_extension.rb +58 -0
- data/app/models/user.rb +49 -0
- data/app/models/user_session.rb +23 -0
- data/app/views/collections/_collection.html.erb +10 -0
- data/app/views/collections/_form.html.erb +47 -0
- data/app/views/collections/edit.html.erb +11 -0
- data/app/views/collections/index.html.erb +12 -0
- data/app/views/collections/new.html.erb +7 -0
- data/app/views/collections/show.html.erb +53 -0
- data/app/views/collections/show.iqrdf +22 -0
- data/app/views/concepts/_base_data.html.erb +72 -0
- data/app/views/concepts/_close_match.html.erb +16 -0
- data/app/views/concepts/_show_head.html.erb +23 -0
- data/app/views/concepts/_visualization.html.erb +9 -0
- data/app/views/concepts/alphabetical/_pref_labeling.html.erb +6 -0
- data/app/views/concepts/alphabetical/index.html.erb +17 -0
- data/app/views/concepts/edit.html.erb +32 -0
- data/app/views/concepts/hierarchical/_treeview.html.erb +20 -0
- data/app/views/concepts/hierarchical/index.html.erb +5 -0
- data/app/views/concepts/index.iqrdf +24 -0
- data/app/views/concepts/new.html.erb +3 -0
- data/app/views/concepts/show_published.html.erb +16 -0
- data/app/views/concepts/show_unpublished.html.erb +43 -0
- data/app/views/concepts/untranslated/index.html.erb +23 -0
- data/app/views/dashboard/index.html.erb +47 -0
- data/app/views/errors/access_denied.html.erb +3 -0
- data/app/views/errors/multiple_choices.html.erb +11 -0
- data/app/views/errors/not_found.html.erb +8 -0
- data/app/views/kaminari/_page.html.erb +6 -0
- data/app/views/kaminari/_paginator.html.erb +15 -0
- data/app/views/layouts/_controls.html.erb +37 -0
- data/app/views/layouts/_header.html.erb +1 -0
- data/app/views/layouts/_navigation.html.erb +27 -0
- data/app/views/layouts/_sections.html.erb +8 -0
- data/app/views/layouts/application.html.erb +83 -0
- data/app/views/pages/about.html.erb +77 -0
- data/app/views/partials/_rdf_logo.html.erb +4 -0
- data/app/views/partials/collection/_member.html.erb +14 -0
- data/app/views/partials/collection_label/_search_result.html.erb +5 -0
- data/app/views/partials/concept/_edit_link_base.html.erb +4 -0
- data/app/views/partials/concept/_inline_base.html.erb +4 -0
- data/app/views/partials/concept/_new_link_base.html.erb +4 -0
- data/app/views/partials/concept/relation/_base.html.erb +8 -0
- data/app/views/partials/concept/relation/_edit_base.html.erb +15 -0
- data/app/views/partials/concept/relation/skos/_narrower.html.erb +12 -0
- data/app/views/partials/concept/relation/skos/broader/_mono.html.erb +28 -0
- data/app/views/partials/concept/relation/skos/broader/_poly.html.erb +14 -0
- data/app/views/partials/labeling/skos/_base.html.erb +17 -0
- data/app/views/partials/labeling/skos/_edit_base.html.erb +7 -0
- data/app/views/partials/labeling/skos/_search_result.html.erb +12 -0
- data/app/views/partials/match/_base.html.erb +13 -0
- data/app/views/partials/match/_edit_base.html.erb +6 -0
- data/app/views/partials/note/_base.html.erb +15 -0
- data/app/views/partials/note/_edit_base.html.erb +28 -0
- data/app/views/partials/note/_note.html.erb +14 -0
- data/app/views/partials/note/_search_result.html.erb +8 -0
- data/app/views/partials/note/skos/_edit_change_note.html.erb +47 -0
- data/app/views/partials/note/skos/definition/_search_result.html.erb +8 -0
- data/app/views/rdf/show_concept.iqrdf +5 -0
- data/app/views/search_results/_head_contents.html.erb +4 -0
- data/app/views/search_results/_rdf_links.html.erb +4 -0
- data/app/views/search_results/index.html.erb +92 -0
- data/app/views/search_results/index.iqrdf +33 -0
- data/app/views/triple_store_syncs/new.html.erb +7 -0
- data/app/views/user_sessions/new.html.erb +11 -0
- data/app/views/users/_form.html.erb +45 -0
- data/app/views/users/_user_preference.html.erb +12 -0
- data/app/views/users/edit.html.erb +14 -0
- data/app/views/users/index.html.erb +29 -0
- data/app/views/users/new.html.erb +13 -0
- data/config/application.rb +82 -0
- data/config/boot.rb +29 -0
- data/config/database.template.yml +43 -0
- data/config/database.yml +40 -0
- data/config/deploy/common.rb +79 -0
- data/config/deploy/ec2.rb +43 -0
- data/config/deploy/history.rb +29 -0
- data/config/deploy/innoq.rb +37 -0
- data/config/deploy.rb +72 -0
- data/config/engine.rb +25 -0
- data/config/environment.rb +21 -0
- data/config/environments/development.rb +74 -0
- data/config/environments/production.rb +65 -0
- data/config/environments/production.template.rb +65 -0
- data/config/environments/production_internal.rb +65 -0
- data/config/environments/test.rb +51 -0
- data/config/initializers/action_view.rb +23 -0
- data/config/initializers/active_record.rb +18 -0
- data/config/initializers/backtrace_silencers.rb +23 -0
- data/config/initializers/inflections.rb +26 -0
- data/config/initializers/iqvoc.rb +50 -0
- data/config/initializers/jdbc.rb +23 -0
- data/config/initializers/kaminari_config.rb +8 -0
- data/config/initializers/language.rb +6 -0
- data/config/initializers/mime_types.rb +24 -0
- data/config/initializers/secret_token.rb +29 -0
- data/config/initializers/secret_token.rb.template +29 -0
- data/config/initializers/session_store.rb +24 -0
- data/config/locales/activerecord.de.yml +135 -0
- data/config/locales/activerecord.en.yml +135 -0
- data/config/locales/authlogic.de.yml +38 -0
- data/config/locales/authlogic.en.yml +38 -0
- data/config/locales/de.yml +326 -0
- data/config/locales/defaults.de.yml +153 -0
- data/config/locales/en.yml +332 -0
- data/config/routes.rb +53 -0
- data/config/warble.rb +158 -0
- data/db/iqvoc_test.sqlite3 +0 -0
- data/db/migrate/20100927101502_create_schema.rb +174 -0
- data/db/migrate/20101125141218_add_collection_tables.rb +32 -0
- data/db/migrate/20101129161528_add_type_to_collections.rb +24 -0
- data/db/migrate/20101202094602_add_origin_to_collections.rb +25 -0
- data/db/migrate/20101202135420_rename_collection_contents_to_collection_members.rb +25 -0
- data/db/migrate/20101208103531_add_type_to_collection_contents.rb +27 -0
- data/db/migrate/20101210153916_add_indexes_to_collections.rb +25 -0
- data/db/migrate/20110204121244_create_collection_labels.rb +32 -0
- data/db/migrate/20110208084250_change_origin_lengths.rb +27 -0
- data/db/migrate/20110328124300_discard_collection_specifics.rb +27 -0
- data/db/migrate/20110408120357_remove_classifications_and_classifiers.rb +32 -0
- data/db/migrate/20110408120740_remove_xl_specfic_stuff.rb +39 -0
- data/db/migrate/20110420133640_change_value_in_notes.rb +8 -0
- data/db/migrate/20110427120534_add_published_at_to_labels.rb +9 -0
- data/db/migrate/20110510162719_use_mono_hierarchy_instead_of_poly_hierarchy.rb +13 -0
- data/db/migrate/20110512132624_extend_notes_value_field_length.rb +8 -0
- data/db/migrate/20110525103100_separate_note_annotation_predicates.rb +38 -0
- data/db/migrate/20110615134040_change_umt_note_annotations_to_dct.rb +9 -0
- data/db/schema.rb +127 -0
- data/db/seeds.rb +37 -0
- data/iqvoc.gemspec +27 -0
- data/lib/engine_tasks/assets.rake +49 -0
- data/lib/engine_tasks/db.rake +18 -0
- data/lib/engine_tasks/release.rake +118 -0
- data/lib/iqvoc/ability.rb +44 -0
- data/lib/iqvoc/data_helper.rb +27 -0
- data/lib/iqvoc/deep_cloning.rb +92 -0
- data/lib/iqvoc/rdf_helper.rb +67 -0
- data/lib/iqvoc/skos_importer.rb +144 -0
- data/lib/iqvoc/version.rb +19 -0
- data/lib/iqvoc/versioning.rb +151 -0
- data/lib/iqvoc.rb +228 -0
- data/lib/maker.rb +144 -0
- data/lib/ojdbc14.jar +0 -0
- data/lib/string.rb +23 -0
- data/lib/tasks/importer.rake +16 -0
- data/lib/tasks/jdbc.rake +24 -0
- data/public/404.html +26 -0
- data/public/422.html +26 -0
- data/public/500.html +26 -0
- data/public/favicon.ico +0 -0
- data/public/images/iqvoc/add.png +0 -0
- data/public/images/iqvoc/arrow_down.gif +0 -0
- data/public/images/iqvoc/arrow_up.gif +0 -0
- data/public/images/iqvoc/footer.png +0 -0
- data/public/images/iqvoc/go_there.png +0 -0
- data/public/images/iqvoc/header.png +0 -0
- data/public/images/iqvoc/header_long.png +0 -0
- data/public/images/iqvoc/iqvoc.png +0 -0
- data/public/images/iqvoc/note_add.png +0 -0
- data/public/images/iqvoc/note_delete.png +0 -0
- data/public/images/iqvoc/note_edit.png +0 -0
- data/public/images/iqvoc/ok.png +0 -0
- data/public/images/iqvoc/rails.png +0 -0
- data/public/images/iqvoc/rdf_flyer.gif +0 -0
- data/public/images/iqvoc/red_arrow.png +0 -0
- data/public/images/iqvoc/remove.png +0 -0
- data/public/images/iqvoc/shadow.png +0 -0
- data/public/images/iqvoc/spinner.gif +0 -0
- data/public/images/iqvoc/tokenizer_delete.png +0 -0
- data/public/images/iqvoc/tokenizer_pencile.png +0 -0
- data/public/images/iqvoc/tokenizer_show.png +0 -0
- data/public/images/iqvoc/unfinished.png +0 -0
- data/public/javascripts/iqvoc/application.js +123 -0
- data/public/javascripts/iqvoc/entityselect.js +121 -0
- data/public/javascripts/iqvoc/excanvas.js +35 -0
- data/public/javascripts/iqvoc/iqvoc.js +118 -0
- data/public/javascripts/iqvoc/jit_rgraph.js +153 -0
- data/public/javascripts/iqvoc/jquery-1.6.2.min.js +18 -0
- data/public/javascripts/iqvoc/jquery-treeview/changelog.txt +29 -0
- data/public/javascripts/iqvoc/jquery-treeview/demo/async.html +44 -0
- data/public/javascripts/iqvoc/jquery-treeview/demo/bg.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/demo/demo.js +43 -0
- data/public/javascripts/iqvoc/jquery-treeview/demo/images.html +56 -0
- data/public/javascripts/iqvoc/jquery-treeview/demo/index.html +340 -0
- data/public/javascripts/iqvoc/jquery-treeview/demo/large.html +559 -0
- data/public/javascripts/iqvoc/jquery-treeview/demo/prerendered.html +621 -0
- data/public/javascripts/iqvoc/jquery-treeview/demo/screen.css +24 -0
- data/public/javascripts/iqvoc/jquery-treeview/demo/simple.html +82 -0
- data/public/javascripts/iqvoc/jquery-treeview/demo/source.php +87 -0
- data/public/javascripts/iqvoc/jquery-treeview/demo/source.phps +87 -0
- data/public/javascripts/iqvoc/jquery-treeview/images/ajax-loader.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/images/file.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/images/folder-closed.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/images/folder.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/images/minus.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/images/plus.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/images/treeview-black-line.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/images/treeview-black.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/images/treeview-default-line.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/images/treeview-default.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/images/treeview-famfamfam-line.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/images/treeview-famfamfam.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/images/treeview-gray-line.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/images/treeview-gray.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/images/treeview-red-line.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/images/treeview-red.gif +0 -0
- data/public/javascripts/iqvoc/jquery-treeview/jquery.treeview.async.js +82 -0
- data/public/javascripts/iqvoc/jquery-treeview/jquery.treeview.css +75 -0
- data/public/javascripts/iqvoc/jquery-treeview/jquery.treeview.js +251 -0
- data/public/javascripts/iqvoc/jquery-treeview/jquery.treeview.min.js +15 -0
- data/public/javascripts/iqvoc/jquery-treeview/jquery.treeview.pack.js +16 -0
- data/public/javascripts/iqvoc/jquery-treeview/lib/jquery.cookie.js +92 -0
- data/public/javascripts/iqvoc/jquery-treeview/lib/jquery.js +3363 -0
- data/public/javascripts/iqvoc/jquery-treeview/todo +8 -0
- data/public/javascripts/iqvoc/jquery-ui-1.8.13.custom.js +3229 -0
- data/public/javascripts/iqvoc/jquery-ui-1.8.13.custom.min.js +163 -0
- data/public/javascripts/iqvoc/jquery-ui.datepicker-de.js +22 -0
- data/public/javascripts/iqvoc/json2.js +480 -0
- data/public/javascripts/iqvoc/langselect.js +73 -0
- data/public/javascripts/iqvoc/rails.js +132 -0
- data/public/javascripts/iqvoc/storage.js +122 -0
- data/public/javascripts/iqvoc/visualization.js +321 -0
- data/public/robots.txt +5 -0
- data/public/stylesheets/iqvoc/blueprint/ie.css +35 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/buttons/icons/cross.png +0 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/buttons/icons/key.png +0 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/buttons/icons/tick.png +0 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/buttons/readme.txt +32 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/buttons/screen.css +97 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/fancy-type/readme.txt +14 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/fancy-type/screen.css +71 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/icons/doc.png +0 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/icons/email.png +0 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/icons/external.png +0 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/icons/feed.png +0 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/icons/im.png +0 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/icons/pdf.png +0 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/icons/visited.png +0 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/icons/xls.png +0 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/readme.txt +18 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/screen.css +40 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/rtl/readme.txt +10 -0
- data/public/stylesheets/iqvoc/blueprint/plugins/rtl/screen.css +110 -0
- data/public/stylesheets/iqvoc/blueprint/print.css +29 -0
- data/public/stylesheets/iqvoc/blueprint/screen.css +258 -0
- data/public/stylesheets/iqvoc/blueprint/src/forms.css +65 -0
- data/public/stylesheets/iqvoc/blueprint/src/grid.css +280 -0
- data/public/stylesheets/iqvoc/blueprint/src/grid.png +0 -0
- data/public/stylesheets/iqvoc/blueprint/src/ie.css +76 -0
- data/public/stylesheets/iqvoc/blueprint/src/print.css +85 -0
- data/public/stylesheets/iqvoc/blueprint/src/reset.css +45 -0
- data/public/stylesheets/iqvoc/blueprint/src/typography.css +106 -0
- data/public/stylesheets/iqvoc/forms.css +71 -0
- data/public/stylesheets/iqvoc/images/back.png +0 -0
- data/public/stylesheets/iqvoc/images/branch.png +0 -0
- data/public/stylesheets/iqvoc/images/categ.png +0 -0
- data/public/stylesheets/iqvoc/images/categ_open.png +0 -0
- data/public/stylesheets/iqvoc/images/go_there.png +0 -0
- data/public/stylesheets/iqvoc/images/iqvoc.png +0 -0
- data/public/stylesheets/iqvoc/images/leaf_end.png +0 -0
- data/public/stylesheets/iqvoc/images/leaf_end_filled.png +0 -0
- data/public/stylesheets/iqvoc/images/leaf_mid.png +0 -0
- data/public/stylesheets/iqvoc/images/leaf_mid_filled.png +0 -0
- data/public/stylesheets/iqvoc/images/leaf_nothing.png +0 -0
- data/public/stylesheets/iqvoc/images/leaf_only.png +0 -0
- data/public/stylesheets/iqvoc/images/leaf_only_filled.png +0 -0
- data/public/stylesheets/iqvoc/images/leaf_top.png +0 -0
- data/public/stylesheets/iqvoc/images/leaf_top_filled.png +0 -0
- data/public/stylesheets/iqvoc/images/nothing.png +0 -0
- data/public/stylesheets/iqvoc/images/top_01.png +0 -0
- data/public/stylesheets/iqvoc/images/trunk.png +0 -0
- data/public/stylesheets/iqvoc/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/stylesheets/iqvoc/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
- data/public/stylesheets/iqvoc/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
- data/public/stylesheets/iqvoc/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
- data/public/stylesheets/iqvoc/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/stylesheets/iqvoc/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
- data/public/stylesheets/iqvoc/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
- data/public/stylesheets/iqvoc/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
- data/public/stylesheets/iqvoc/images/ui-icons_217bc0_256x240.png +0 -0
- data/public/stylesheets/iqvoc/images/ui-icons_2e83ff_256x240.png +0 -0
- data/public/stylesheets/iqvoc/images/ui-icons_469bdd_256x240.png +0 -0
- data/public/stylesheets/iqvoc/images/ui-icons_6da8d5_256x240.png +0 -0
- data/public/stylesheets/iqvoc/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/stylesheets/iqvoc/images/ui-icons_d8e7f3_256x240.png +0 -0
- data/public/stylesheets/iqvoc/images/ui-icons_f9bd01_256x240.png +0 -0
- data/public/stylesheets/iqvoc/iqvoc.css +477 -0
- data/public/stylesheets/iqvoc/jquery-ui-1.8.13.custom.css +415 -0
- data/public/stylesheets/iqvoc/widgets.css +81 -0
- data/test/factories.rb +74 -0
- data/test/integration/alphabetical_test.rb +53 -0
- data/test/integration/authentication_test.rb +41 -0
- data/test/integration/browse_concepts_and_labels_test.rb +61 -0
- data/test/integration/browse_static_pages_test.rb +29 -0
- data/test/integration/client_augmentation_test.rb +42 -0
- data/test/integration/client_edit_concept_test.rb +72 -0
- data/test/integration/collection_circularity_test.rb +110 -0
- data/test/integration/concept_test.rb +61 -0
- data/test/integration/edit_concepts_test.rb +40 -0
- data/test/integration/note_annotations_test.rb +86 -0
- data/test/integration/search_test.rb +205 -0
- data/test/integration/tree_test.rb +31 -0
- data/test/integration/untranslated_test.rb +60 -0
- data/test/integration_test_helper.rb +45 -0
- data/test/performance/browsing_test.rb +25 -0
- data/test/test_helper.rb +29 -0
- data/test/unit/concept_test.rb +93 -0
- data/test/unit/note_test.rb +32 -0
- data/test/unit/origin_mapping_test.rb +70 -0
- data/test/unit/skos_import_test.rb +100 -0
- metadata +522 -0
@@ -0,0 +1,67 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
# Copyright 2011 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
|
+
module Iqvoc
|
18
|
+
# TODO: The whole class should move to umt because it highly proprietary
|
19
|
+
# (and also has the wrong name because it only deals with "turtle").
|
20
|
+
# TODO: The term "Helper" is misleading.
|
21
|
+
class RdfHelper
|
22
|
+
|
23
|
+
LITERAL_REGEXP = /"(.*)"@([a-zA-Z]{2})/
|
24
|
+
|
25
|
+
NSMAP = {
|
26
|
+
'rdf' => "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
|
27
|
+
'skos' => "http://www.w3.org/2004/02/skos/core#",
|
28
|
+
'owl' => "http://www.w3.org/2002/07/owl#",
|
29
|
+
'rdfs' => "http://www.w3.org/2000/01/rdf-schema#" }
|
30
|
+
|
31
|
+
def self.extract_id(uri)
|
32
|
+
uri =~ /([^\/]+)\/{0,1}$/
|
33
|
+
$1
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.is_literal_form?(str)
|
37
|
+
str.match LITERAL_REGEXP
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.quote_turtle_literal(val)
|
41
|
+
if val.to_s.match(/^<.*>$/)
|
42
|
+
val
|
43
|
+
else
|
44
|
+
"\"#{val}\""
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.split_literal(str)
|
49
|
+
elements = str.scan(LITERAL_REGEXP).first
|
50
|
+
@split_literal = {
|
51
|
+
:value => elements[0].gsub(/\\"/, '"'),
|
52
|
+
:language => elements[1]
|
53
|
+
}
|
54
|
+
RAILS_DEFAULT_LOGGER.debug "@split_literal => #{@split_literal}"
|
55
|
+
@split_literal
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.to_xml_attribute_array
|
59
|
+
res = {}
|
60
|
+
NSMAP.each do |k,v|
|
61
|
+
res["xmlns:#{k}"] = v
|
62
|
+
end
|
63
|
+
res
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,144 @@
|
|
1
|
+
module Iqvoc
|
2
|
+
class SkosImporter
|
3
|
+
|
4
|
+
FIRST_LEVEL_OBJECT_CLASSES = [Iqvoc::Concept.base_class]
|
5
|
+
SECOND_LEVEL_OBJECT_CLASSES = Iqvoc::Concept.labeling_classes.keys +
|
6
|
+
Iqvoc::Concept.note_classes +
|
7
|
+
Iqvoc::Concept.relation_classes +
|
8
|
+
Iqvoc::Concept.match_classes
|
9
|
+
|
10
|
+
def initialize(file, default_namespace_url)
|
11
|
+
unless file.is_a?(File) || file.is_a?(Array)
|
12
|
+
raise "Iqvoc::SkosImporter#import: Parameter 'file' should be a File or an Array."
|
13
|
+
end
|
14
|
+
|
15
|
+
# Some general Namespaces to support in any case
|
16
|
+
@prefixes = {
|
17
|
+
"http://www.w3.org/2004/02/skos/core#" => "skos:",
|
18
|
+
"http://www.w3.org/2008/05/skos#" => "skos:",
|
19
|
+
"http://www.w3.org/1999/02/22-rdf-syntax-ns#" => "rdf:",
|
20
|
+
default_namespace_url => ":"
|
21
|
+
}
|
22
|
+
# Add the namespaces specified in the Iqvoc config
|
23
|
+
Iqvoc.rdf_namespaces.each do |pref, uri|
|
24
|
+
@prefixes[uri] = "#{pref.to_s}:"
|
25
|
+
end
|
26
|
+
|
27
|
+
@seen_first_level_objects = {}
|
28
|
+
|
29
|
+
@existing_origins = {} # To prevent the creation of first level objects we already have
|
30
|
+
FIRST_LEVEL_OBJECT_CLASSES.each do |klass|
|
31
|
+
klass.select("origin").all.each do |thing|
|
32
|
+
@existing_origins[thing.origin] = klass
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
import(file)
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def import(file)
|
42
|
+
types = {} # type identifier ("namespace:SomeClass") to Iqvoc class assignment hash
|
43
|
+
FIRST_LEVEL_OBJECT_CLASSES.each do |klass|
|
44
|
+
types["#{klass.rdf_namespace}:#{klass.rdf_class}"] = klass
|
45
|
+
end
|
46
|
+
file.each do |line|
|
47
|
+
import_first_level_objects(types, *extract_triple(line))
|
48
|
+
end
|
49
|
+
new_subjects = @seen_first_level_objects.dup # Remember the objects seen yet, because they are the ones to be published later
|
50
|
+
|
51
|
+
file.rewind if file.is_a?(IO)
|
52
|
+
types = {}
|
53
|
+
SECOND_LEVEL_OBJECT_CLASSES.each do |klass|
|
54
|
+
types["#{klass.rdf_namespace}:#{klass.rdf_predicate}"] = klass
|
55
|
+
end
|
56
|
+
file.each do |line|
|
57
|
+
import_second_level_objects(types, *extract_triple(line))
|
58
|
+
end
|
59
|
+
|
60
|
+
new_subjects.each do |id, subject|
|
61
|
+
if subject.valid_with_full_validation?
|
62
|
+
subject.publish
|
63
|
+
subject.save!
|
64
|
+
else
|
65
|
+
Rails.logger.warn "WARNING: Subject not valid: '#{subject.origin}'. Won't be published automatically.."
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
def import_first_level_objects(types, subject, predicate, object)
|
72
|
+
if (predicate == "rdf:type" && types[object] && subject =~ /^:(.+)$/)
|
73
|
+
# We've found a subject definition with a class we know and which is in our responsibility (":")
|
74
|
+
origin = $1
|
75
|
+
|
76
|
+
if (@existing_origins[origin])
|
77
|
+
if (types[object] == @existing_origins[origin])
|
78
|
+
Rails.logger.info "Iqvoc::SkosImporter: Subject with origin '#{origin}' already exists. Skipping duplicate creation (should be no problem)."
|
79
|
+
else
|
80
|
+
Rails.logger.warn "Iqvoc::SkosImporter: Subject with origin '#{origin} already exists but has another class (#{@existing_origins[origin]}) then the one I wanted to create (#{types[object]}). You seem to have a problem with your configuration!"
|
81
|
+
end
|
82
|
+
else
|
83
|
+
@seen_first_level_objects[origin] = types[object].create!(:origin => origin)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def import_second_level_objects(types, subject, predicate, object)
|
89
|
+
return unless (subject =~ /^:(.*)$/ && types[predicate]) # We're not responsible for this
|
90
|
+
|
91
|
+
# Load the subject and replace the string by the respective data object
|
92
|
+
subject_origin = $1
|
93
|
+
subject = load_first_level_object(subject_origin)
|
94
|
+
unless subject
|
95
|
+
Rails.logger.warn "Iqvoc::SkosImporter: Couldn't find Subject with origin '#{subject_origin}. Skipping entry '#{subject} #{predicate} #{object}.'"
|
96
|
+
return
|
97
|
+
end
|
98
|
+
|
99
|
+
# Load the data object for the object string if this is representing a thing in our domain
|
100
|
+
if (object =~ /^:(.*)$/ && types[predicate])
|
101
|
+
object_origin = $1
|
102
|
+
object = load_first_level_object(object_origin)
|
103
|
+
unless object
|
104
|
+
Rails.logger.warn "Iqvoc::SkosImporter: Couldn't find Object with origin '#{object_origin}. Skipping entry ':#{subject_origin} #{predicate} #{object}.'"
|
105
|
+
return
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
types[predicate].build_from_rdf(subject, predicate, object)
|
110
|
+
end
|
111
|
+
|
112
|
+
def load_first_level_object(origin)
|
113
|
+
unless @seen_first_level_objects[origin]
|
114
|
+
FIRST_LEVEL_OBJECT_CLASSES.each do |klass|
|
115
|
+
@seen_first_level_objects[origin] = klass.by_origin(origin).last
|
116
|
+
break if @seen_first_level_objects[origin]
|
117
|
+
end
|
118
|
+
end
|
119
|
+
@seen_first_level_objects[origin]
|
120
|
+
end
|
121
|
+
|
122
|
+
def extract_triple(line)
|
123
|
+
raise "'#{line}' doesn't look like valid ntriples data." unless line =~ /^(.*)\.\w*$/
|
124
|
+
line = $1.squish
|
125
|
+
|
126
|
+
triple = line.split(' ', 3) # The first one are uris the last can be a literal too
|
127
|
+
|
128
|
+
triple.each do |e| # Do some fun with the uris and literals
|
129
|
+
@prefixes.keys.each do |uri_prefix| # Use prefixes instead of full uris
|
130
|
+
e.gsub! /<#{uri_prefix}([^>]*)>/ do |matches|
|
131
|
+
@prefixes[uri_prefix] + $1.gsub(".", "_")
|
132
|
+
end
|
133
|
+
end
|
134
|
+
e.squish!
|
135
|
+
e.gsub!(/^:(.*)$/) do
|
136
|
+
":#{OriginMapping.merge($1)}" # Force correct origins in the default namespace
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
triple
|
141
|
+
end
|
142
|
+
|
143
|
+
end
|
144
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
# Copyright 2011 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
|
+
module Iqvoc
|
18
|
+
VERSION = "3.2.3"
|
19
|
+
end
|
@@ -0,0 +1,151 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
# Copyright 2011 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
|
+
module Iqvoc
|
18
|
+
module Versioning
|
19
|
+
|
20
|
+
extend ActiveSupport::Concern
|
21
|
+
|
22
|
+
included do
|
23
|
+
|
24
|
+
# ********* Relations
|
25
|
+
|
26
|
+
belongs_to :published_version, :foreign_key => 'published_version_id', :class_name => name
|
27
|
+
|
28
|
+
belongs_to :locking_user, :foreign_key => 'locked_by', :class_name => 'User'
|
29
|
+
|
30
|
+
# ********* Scopes
|
31
|
+
|
32
|
+
scope :by_origin, lambda { |origin|
|
33
|
+
where(:origin => origin)
|
34
|
+
}
|
35
|
+
|
36
|
+
scope :published, lambda {
|
37
|
+
where(arel_table[:published_at].not_eq(nil))
|
38
|
+
}
|
39
|
+
scope :unpublished, lambda {
|
40
|
+
where(:published_at => nil)
|
41
|
+
}
|
42
|
+
# The following scope returns all objects which should be selectable by the editor
|
43
|
+
scope :editor_selectable, lambda {
|
44
|
+
where(
|
45
|
+
arel_table[:published_at].not_eq(nil).or( # == published (is there a way to OR comibne two scopes? [published OROPERATOR where(...)])
|
46
|
+
arel_table[:published_at].eq(nil).and(arel_table[:published_version_id].eq(nil)) # this are all unpublished with no published version
|
47
|
+
)
|
48
|
+
)
|
49
|
+
}
|
50
|
+
|
51
|
+
scope :in_edit_mode, lambda {
|
52
|
+
where(arel_table[:locked_by].not_eq(nil))
|
53
|
+
}
|
54
|
+
|
55
|
+
scope :unpublished_or_follow_up, lambda {
|
56
|
+
where(
|
57
|
+
arel_table[:published_at].eq(nil).or(
|
58
|
+
arel_table[:follow_up].not_eq(nil)
|
59
|
+
)
|
60
|
+
)
|
61
|
+
}
|
62
|
+
|
63
|
+
scope :unsynced, where(:rdf_updated_at => nil)
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
# ********* Methods
|
68
|
+
|
69
|
+
def branch(user)
|
70
|
+
new_version = self.clone(:include => self.class.includes_to_deep_cloning)
|
71
|
+
new_version.lock_by_user(user.id)
|
72
|
+
new_version.increment!(:rev)
|
73
|
+
new_version.published_version_id = self.id
|
74
|
+
new_version.unpublish
|
75
|
+
new_version.send(:"#{Iqvoc.change_note_class_name.to_relation_name}").build(
|
76
|
+
:language => I18n.locale.to_s,
|
77
|
+
:annotations_attributes => [
|
78
|
+
{ :namespace => "dct", :predicate => "creator", :value => user.name },
|
79
|
+
{ :namespace => "dct", :predicate => "modified", :value => DateTime.now.to_s }
|
80
|
+
])
|
81
|
+
new_version
|
82
|
+
end
|
83
|
+
|
84
|
+
def publish
|
85
|
+
write_attribute(:published_at, Time.now)
|
86
|
+
write_attribute(:to_review, nil)
|
87
|
+
write_attribute(:published_version_id, nil)
|
88
|
+
end
|
89
|
+
|
90
|
+
def unpublish
|
91
|
+
write_attribute(:published_at, nil)
|
92
|
+
end
|
93
|
+
|
94
|
+
def published?
|
95
|
+
read_attribute(:published_at).present?
|
96
|
+
end
|
97
|
+
|
98
|
+
# Editor selectable if published or no published version exists (before
|
99
|
+
# first publication)
|
100
|
+
def editor_selectable?
|
101
|
+
published? || read_attribute(:published_version_id).blank?
|
102
|
+
end
|
103
|
+
|
104
|
+
def lock_by_user(user_id)
|
105
|
+
write_attribute(:locked_by, user_id)
|
106
|
+
end
|
107
|
+
|
108
|
+
def locked?
|
109
|
+
locked_by?
|
110
|
+
end
|
111
|
+
|
112
|
+
def state
|
113
|
+
if published?
|
114
|
+
I18n.t("txt.common.state.published")
|
115
|
+
elsif !published? && in_review?
|
116
|
+
I18n.t("txt.common.state.in_review")
|
117
|
+
elsif !published? && !in_review?
|
118
|
+
I18n.t("txt.common.state.checked_out")
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
def unlock
|
123
|
+
write_attribute(:locked_by, nil)
|
124
|
+
end
|
125
|
+
|
126
|
+
def in_review?
|
127
|
+
read_attribute(:to_review).present?
|
128
|
+
end
|
129
|
+
|
130
|
+
def to_review
|
131
|
+
write_attribute(:to_review, true)
|
132
|
+
end
|
133
|
+
|
134
|
+
module ClassMethods
|
135
|
+
|
136
|
+
def include_to_deep_cloning(*association_names)
|
137
|
+
(@@include_to_deep_cloning ||= {})[self] ||= []
|
138
|
+
association_names.each do |association_name|
|
139
|
+
@@include_to_deep_cloning[self] << association_name
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
def includes_to_deep_cloning
|
144
|
+
(@@include_to_deep_cloning ||= {})[self] ||= []
|
145
|
+
(@@include_to_deep_cloning.keys & self.ancestors).map{|c| @@include_to_deep_cloning[c]}.flatten.compact
|
146
|
+
end
|
147
|
+
|
148
|
+
end
|
149
|
+
|
150
|
+
end
|
151
|
+
end
|
data/lib/iqvoc.rb
ADDED
@@ -0,0 +1,228 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
# Copyright 2011 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 'string'
|
18
|
+
|
19
|
+
module Iqvoc
|
20
|
+
|
21
|
+
unless Iqvoc.const_defined?(:Application)
|
22
|
+
require File.join(File.dirname(__FILE__), '../config/engine')
|
23
|
+
end
|
24
|
+
|
25
|
+
mattr_accessor :title,
|
26
|
+
:searchable_class_names,
|
27
|
+
:unlimited_search_results,
|
28
|
+
:available_languages,
|
29
|
+
:default_rdf_namespace_helper_methods,
|
30
|
+
:rdf_namespaces,
|
31
|
+
:change_note_class_name,
|
32
|
+
:additional_js_files,
|
33
|
+
:additional_css_files,
|
34
|
+
:first_level_class_configuration_modules,
|
35
|
+
:ability_class_name
|
36
|
+
|
37
|
+
self.title = "iQvoc"
|
38
|
+
|
39
|
+
self.searchable_class_names = [
|
40
|
+
'Labeling::SKOS::Base',
|
41
|
+
'Labeling::SKOS::PrefLabel',
|
42
|
+
'Note::Base'
|
43
|
+
]
|
44
|
+
self.unlimited_search_results = false
|
45
|
+
|
46
|
+
self.available_languages = [:en, :de]
|
47
|
+
|
48
|
+
self.default_rdf_namespace_helper_methods = [:iqvoc_default_rdf_namespaces]
|
49
|
+
|
50
|
+
self.rdf_namespaces = {
|
51
|
+
:rdf => "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
|
52
|
+
:rdfs => "http://www.w3.org/2000/01/rdf-schema#",
|
53
|
+
:owl => "http://www.w3.org/2002/07/owl#",
|
54
|
+
:skos => "http://www.w3.org/2004/02/skos/core#",
|
55
|
+
:dct => "http://purl.org/dc/terms/"
|
56
|
+
}
|
57
|
+
|
58
|
+
# The class to use for automatic generation of change notes on every save
|
59
|
+
self.change_note_class_name = 'Note::SKOS::ChangeNote'
|
60
|
+
|
61
|
+
# Use these config hooks in your engine to inject your custom js and css includes.
|
62
|
+
self.additional_js_files = []
|
63
|
+
self.additional_css_files = []
|
64
|
+
|
65
|
+
self.first_level_class_configuration_modules = [] # Will be set in the modules
|
66
|
+
|
67
|
+
self.ability_class_name = 'Iqvoc::Ability'
|
68
|
+
|
69
|
+
def self.change_note_class
|
70
|
+
change_note_class_name.constantize
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.searchable_classes
|
74
|
+
searchable_class_names.map(&:constantize)
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.first_level_classes
|
78
|
+
self.first_level_class_configuration_modules.map { |mod| mod.send(:base_class) }
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.ability_class
|
82
|
+
ability_class_name.constantize
|
83
|
+
end
|
84
|
+
|
85
|
+
# ************** Concept specific settings **************
|
86
|
+
|
87
|
+
module Concept
|
88
|
+
|
89
|
+
Iqvoc.first_level_class_configuration_modules << self
|
90
|
+
|
91
|
+
mattr_accessor :base_class_name,
|
92
|
+
:broader_relation_class_name, :further_relation_class_names,
|
93
|
+
:pref_labeling_class_name, :pref_labeling_languages, :further_labeling_class_names,
|
94
|
+
:match_class_names,
|
95
|
+
:note_class_names,
|
96
|
+
:additional_association_class_names,
|
97
|
+
:view_sections,
|
98
|
+
:include_module_names
|
99
|
+
|
100
|
+
self.base_class_name = 'Concept::SKOS::Base'
|
101
|
+
|
102
|
+
self.broader_relation_class_name = 'Concept::Relation::SKOS::Broader::Mono'
|
103
|
+
self.further_relation_class_names = [ 'Concept::Relation::SKOS::Related' ]
|
104
|
+
|
105
|
+
self.pref_labeling_class_name = 'Labeling::SKOS::PrefLabel'
|
106
|
+
self.pref_labeling_languages = [:en, :de]
|
107
|
+
self.further_labeling_class_names = { 'Labeling::SKOS::AltLabel' => [:de, :en] }
|
108
|
+
|
109
|
+
self.note_class_names = [
|
110
|
+
Iqvoc.change_note_class_name,
|
111
|
+
'Note::SKOS::Definition',
|
112
|
+
'Note::SKOS::EditorialNote',
|
113
|
+
'Note::SKOS::Example',
|
114
|
+
'Note::SKOS::HistoryNote',
|
115
|
+
'Note::SKOS::ScopeNote'
|
116
|
+
]
|
117
|
+
|
118
|
+
self.match_class_names = [
|
119
|
+
'Match::SKOS::CloseMatch',
|
120
|
+
'Match::SKOS::ExactMatch',
|
121
|
+
'Match::SKOS::RelatedMatch',
|
122
|
+
'Match::SKOS::BroadMatch',
|
123
|
+
'Match::SKOS::NarrowMatch',
|
124
|
+
]
|
125
|
+
|
126
|
+
self.additional_association_class_names = {}
|
127
|
+
|
128
|
+
self.view_sections = ["main", "labels", "relations", "notes", "matches"]
|
129
|
+
|
130
|
+
self.include_module_names = []
|
131
|
+
|
132
|
+
# Do not use the following method in models. This will probably cause a
|
133
|
+
# loading loop (something like "expected file xyz to load ...")
|
134
|
+
def self.base_class
|
135
|
+
base_class_name.constantize
|
136
|
+
end
|
137
|
+
|
138
|
+
def self.pref_labeling_class
|
139
|
+
pref_labeling_class_name.constantize
|
140
|
+
end
|
141
|
+
|
142
|
+
def self.labeling_class_names
|
143
|
+
{ pref_labeling_class_name => pref_labeling_languages }.merge(further_labeling_class_names)
|
144
|
+
end
|
145
|
+
|
146
|
+
def self.labeling_classes
|
147
|
+
{ pref_labeling_class => pref_labeling_languages }.merge(further_labeling_classes)
|
148
|
+
end
|
149
|
+
|
150
|
+
def self.broader_relation_class
|
151
|
+
broader_relation_class_name.constantize
|
152
|
+
end
|
153
|
+
|
154
|
+
def self.further_labeling_classes
|
155
|
+
further_labeling_class_names.keys.each_with_object({}) do |class_name, hash|
|
156
|
+
hash[class_name.constantize] = further_labeling_class_names[class_name]
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
def self.relation_class_names
|
161
|
+
further_relation_class_names + [broader_relation_class_name, broader_relation_class.narrower_class.name]
|
162
|
+
end
|
163
|
+
|
164
|
+
def self.relation_classes
|
165
|
+
relation_class_names.map(&:constantize)
|
166
|
+
end
|
167
|
+
|
168
|
+
def self.further_relation_classes
|
169
|
+
further_relation_class_names.map(&:constantize)
|
170
|
+
end
|
171
|
+
|
172
|
+
def self.note_classes
|
173
|
+
note_class_names.map(&:constantize)
|
174
|
+
end
|
175
|
+
|
176
|
+
def self.match_classes
|
177
|
+
match_class_names.map(&:constantize)
|
178
|
+
end
|
179
|
+
|
180
|
+
def self.additional_association_classes
|
181
|
+
additional_association_class_names.keys.each_with_object({}) do |class_name, hash|
|
182
|
+
hash[class_name.constantize] = additional_association_class_names[class_name]
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
def self.supports_multi_language_pref_labelings?
|
187
|
+
pref_labeling_languages.size > 1
|
188
|
+
end
|
189
|
+
|
190
|
+
def self.include_modules
|
191
|
+
include_module_names.map(&:constantize)
|
192
|
+
end
|
193
|
+
|
194
|
+
end
|
195
|
+
|
196
|
+
# ************** Collection specific settings **************
|
197
|
+
|
198
|
+
module Collection
|
199
|
+
|
200
|
+
mattr_accessor :base_class_name
|
201
|
+
|
202
|
+
self.base_class_name = 'Collection::Unordered'
|
203
|
+
|
204
|
+
def self.base_class
|
205
|
+
base_class_name.constantize
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
# ************** Label specific settings **************
|
210
|
+
|
211
|
+
module Label
|
212
|
+
|
213
|
+
mattr_accessor :base_class_name
|
214
|
+
|
215
|
+
self.base_class_name = 'Label::SKOS::Base'
|
216
|
+
|
217
|
+
# Do not use the following method in models. This will probably cause a
|
218
|
+
# loading loop (something like "expected file xyz to load ...")
|
219
|
+
def self.base_class
|
220
|
+
base_class_name.constantize
|
221
|
+
end
|
222
|
+
|
223
|
+
end
|
224
|
+
|
225
|
+
end
|
226
|
+
|
227
|
+
# FIXME: For yet unknown reasons, the load hook gets to run 2 times
|
228
|
+
ActiveSupport.run_load_hooks(:after_iqvoc_config, Iqvoc)
|