qa_server 0.1.99

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +71 -0
  3. data/Gemfile +55 -0
  4. data/Gemfile.lock +411 -0
  5. data/LICENSE +201 -0
  6. data/README.md +187 -0
  7. data/Rakefile +18 -0
  8. data/app/assets/images/qa_server/LD4L-bg.png +0 -0
  9. data/app/assets/images/qa_server/cornell-reduced-white.svg +160 -0
  10. data/app/assets/images/qa_server/iowa-logo.png +0 -0
  11. data/app/assets/images/qa_server/samvera-fall-font1-1000w-light.png +0 -0
  12. data/app/assets/javascripts/qa_server.js +0 -0
  13. data/app/assets/stylesheets/qa_server/_authorities.scss +0 -0
  14. data/app/assets/stylesheets/qa_server/_check-status.scss +72 -0
  15. data/app/assets/stylesheets/qa_server/_footer.scss +20 -0
  16. data/app/assets/stylesheets/qa_server/_header.scss +51 -0
  17. data/app/assets/stylesheets/qa_server/_home-page.scss +15 -0
  18. data/app/assets/stylesheets/qa_server/_monitor-status.scss +13 -0
  19. data/app/assets/stylesheets/qa_server/_qa_server.scss +36 -0
  20. data/app/assets/stylesheets/qa_server/_styles.scss +27 -0
  21. data/app/assets/stylesheets/qa_server/_usage.scss +0 -0
  22. data/app/controllers/qa_server/authority_list_controller.rb +14 -0
  23. data/app/controllers/qa_server/authority_validation_controller.rb +77 -0
  24. data/app/controllers/qa_server/check_status_controller.rb +38 -0
  25. data/app/controllers/qa_server/homepage_controller.rb +8 -0
  26. data/app/controllers/qa_server/monitor_status_controller.rb +79 -0
  27. data/app/controllers/qa_server/usage_controller.rb +8 -0
  28. data/app/loggers/qa_server/scenario_logger.rb +84 -0
  29. data/app/models/qa_server/authority_scenario.rb +35 -0
  30. data/app/models/qa_server/authority_status.rb +18 -0
  31. data/app/models/qa_server/authority_status_failure.rb +7 -0
  32. data/app/models/qa_server/scenarios.rb +71 -0
  33. data/app/models/qa_server/search_scenario.rb +58 -0
  34. data/app/models/qa_server/term_scenario.rb +50 -0
  35. data/app/presenters/qa_server/authority_list_presenter.rb +22 -0
  36. data/app/presenters/qa_server/check_status_presenter.rb +96 -0
  37. data/app/presenters/qa_server/monitor_status_presenter.rb +108 -0
  38. data/app/services/qa_server/authority_lister_service.rb +31 -0
  39. data/app/services/qa_server/authority_loader_service.rb +38 -0
  40. data/app/services/qa_server/authority_validator_service.rb +41 -0
  41. data/app/services/qa_server/database_migrator.rb +70 -0
  42. data/app/services/qa_server/scenarios_loader_service.rb +57 -0
  43. data/app/validators/qa_server/scenario_validator.rb +134 -0
  44. data/app/validators/qa_server/search_scenario_validator.rb +84 -0
  45. data/app/validators/qa_server/term_scenario_validator.rb +42 -0
  46. data/app/views/layouts/qa_server.html.erb +65 -0
  47. data/app/views/qa_server/authority_list/index.html.erb +27 -0
  48. data/app/views/qa_server/check_status/index.html.erb +104 -0
  49. data/app/views/qa_server/homepage/index.html.erb +10 -0
  50. data/app/views/qa_server/monitor_status/index.html.erb +78 -0
  51. data/app/views/qa_server/usage/index.html.erb +106 -0
  52. data/app/views/shared/_footer.html.erb +24 -0
  53. data/config/locales/qa_server.en.yml +68 -0
  54. data/config/routes.rb +12 -0
  55. data/lib/generators/qa_server/assets_generator.rb +35 -0
  56. data/lib/generators/qa_server/config_generator.rb +31 -0
  57. data/lib/generators/qa_server/install_generator.rb +60 -0
  58. data/lib/generators/qa_server/models_generator.rb +18 -0
  59. data/lib/generators/qa_server/templates/config/authorities/linked_data/agrovoc_direct.json +69 -0
  60. data/lib/generators/qa_server/templates/config/authorities/linked_data/agrovoc_ld4l_cache.json +85 -0
  61. data/lib/generators/qa_server/templates/config/authorities/linked_data/dbpedia_direct.json +36 -0
  62. data/lib/generators/qa_server/templates/config/authorities/linked_data/dbpedia_ld4l_cache.json +83 -0
  63. data/lib/generators/qa_server/templates/config/authorities/linked_data/geonames_direct.json +68 -0
  64. data/lib/generators/qa_server/templates/config/authorities/linked_data/geonames_ld4l_cache.json +102 -0
  65. data/lib/generators/qa_server/templates/config/authorities/linked_data/getty_aat_ld4l_cache.json +109 -0
  66. data/lib/generators/qa_server/templates/config/authorities/linked_data/getty_tgn_ld4l_cache.json +72 -0
  67. data/lib/generators/qa_server/templates/config/authorities/linked_data/getty_ulan_ld4l_cache.json +81 -0
  68. data/lib/generators/qa_server/templates/config/authorities/linked_data/loc_direct.json +47 -0
  69. data/lib/generators/qa_server/templates/config/authorities/linked_data/locgenres_ld4l_cache.json +99 -0
  70. data/lib/generators/qa_server/templates/config/authorities/linked_data/locnames_ld4l_cache.json +89 -0
  71. data/lib/generators/qa_server/templates/config/authorities/linked_data/locsubjects_ld4l_cache.json +82 -0
  72. data/lib/generators/qa_server/templates/config/authorities/linked_data/mesh_ld4l_cache.json +70 -0
  73. data/lib/generators/qa_server/templates/config/authorities/linked_data/nalt_direct.json +32 -0
  74. data/lib/generators/qa_server/templates/config/authorities/linked_data/nalt_ld4l_cache.json +84 -0
  75. data/lib/generators/qa_server/templates/config/authorities/linked_data/oclcfast_direct.json +81 -0
  76. data/lib/generators/qa_server/templates/config/authorities/linked_data/oclcfast_ld4l_cache.json +86 -0
  77. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/agrovoc_direct_validation.yml +9 -0
  78. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/agrovoc_ld4l_cache_validation.yml +9 -0
  79. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/agrovoc_validation.yml +9 -0
  80. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/dbpedia_direct_validation.yml +6 -0
  81. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/dbpedia_ld4l_cache_validation.yml +9 -0
  82. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/geonames_direct_validation.yml +9 -0
  83. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/geonames_ld4l_cache_validation.yml +41 -0
  84. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/getty_aat_ld4l_cache_validation.yml +115 -0
  85. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/getty_tgn_ld4l_cache_validation.yml +9 -0
  86. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/getty_ulan_ld4l_cache_validation.yml +15 -0
  87. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/loc_direct_validation.yml +25 -0
  88. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/loc_validation.yml +22 -0
  89. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locgenres_ld4l_cache_validation.yml +99 -0
  90. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locnames_ld4l_cache_validation.yml +27 -0
  91. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locsubjects_ld4l_cache_validation.yml +27 -0
  92. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/mesh_ld4l_cache_validation.yml +9 -0
  93. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/nalt_direct_validation.yml +6 -0
  94. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/nalt_ld4l_cache_validation.yml +9 -0
  95. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/oclc_fast_validation.yml +58 -0
  96. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/oclcfast_direct_validation.yml +58 -0
  97. data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/oclcfast_ld4l_cache_validation.yml +30 -0
  98. data/lib/generators/qa_server/templates/config/locales/qa_server.en.yml +9 -0
  99. data/lib/generators/qa_server/templates/db/migrate/20180313045551_create_cron_authority_status.rb.erb +9 -0
  100. data/lib/generators/qa_server/templates/db/migrate/20180508045549_rename_cron_authority_status_to_authority_status.rb.erb +5 -0
  101. data/lib/generators/qa_server/templates/db/migrate/20180508045551_create_authority_status_failure.rb.erb +15 -0
  102. data/lib/generators/qa_server/templates/qa_server.scss +5 -0
  103. data/lib/qa_server/engine.rb +19 -0
  104. data/lib/qa_server/version.rb +3 -0
  105. data/lib/qa_server.rb +6 -0
  106. data/lib/tasks/install.rake +8 -0
  107. data/lib/tasks/qa_server_tasks.rake +4 -0
  108. data/qa_server.gemspec +39 -0
  109. data/spec/.gitignore +1 -0
  110. data/spec/rails_helper.rb +2 -0
  111. data/spec/spec_helper.rb +283 -0
  112. data/spec/test_app_templates/Gemfile.extra +5 -0
  113. data/spec/test_app_templates/lib/generators/test_app_generator.rb +15 -0
  114. data/tasks/qa_server_dev.rake +16 -0
  115. metadata +275 -0
@@ -0,0 +1,24 @@
1
+ <div class="container">
2
+ <footer class="navbar navbar-inverse site-footer">
3
+ <div class="container-fluid">
4
+ <div class="navbar-text text-left">
5
+ <p><%= t('qa_server.application_name') %>, v<%= t('qa_server.application_version') %></p>
6
+ <p><%= t('qa_server.footer.service_html') %></p>
7
+ </div>
8
+ <div class="navbar-right">
9
+ <div class="navbar-text text-right">
10
+ <p><%= t('qa_server.footer.copyright_html') %></p>
11
+ <p><%= t('qa_server.footer.disclaimer_html') %></p>
12
+ </div>
13
+ </div>
14
+ </div>
15
+ <div class="container-fluid">
16
+ <div class="footer-logos">
17
+ <a href="https://uiowa.edu/" target="_blank"><img src="<%= image_url('qa_server/iowa-logo.png') %>" class="footer-logo"></a>
18
+ <a href="http://cornell.edu" target="_blank"><img src="<%= image_url('qa_server/cornell-reduced-white.svg') %>" class="footer-logo"></a>
19
+ <a href="http://samvera.org" target="_blank"><img src="<%= image_url('qa_server/samvera-fall-font1-1000w-light.png') %>" class="footer-logo"></a>
20
+ <a href="http://ld4l.org" target="_blank"><img src="<%= image_url('qa_server/LD4L-bg.png') %>" class="footer-logo"></a>
21
+ </div>
22
+ </div>
23
+ </footer>
24
+ </div>
@@ -0,0 +1,68 @@
1
+ ---
2
+ en:
3
+ qa_server:
4
+ menu:
5
+ home: Home
6
+ usage: Usage
7
+ authorities: Authorities
8
+ check_status: Check Status
9
+ monitor_status: Monitor Status
10
+ warning:
11
+ chrome_unencoding_msg: "NOTE: Sample URLs with an encoded URI for term fetch do not work in Chrome for Mac or Windows and do not work in IE for Window. This is because Chrome and IE unencode the periods. Firefox on Windows and Mac and Safari on Mac are known to work."
12
+ authority_list:
13
+ title: Authority List
14
+ see_check_status_html: 'See <a href="%{href}">Check Status</a> to test whether an authority is online.'
15
+ data:
16
+ authority: Authority
17
+ subauthority: Subauthority
18
+ service: Service
19
+ action: Action
20
+ url: Sample URL
21
+ check_status:
22
+ title: Check Status
23
+ select_authority: Select authority...
24
+ show_all: ALL Authorities (SLOW)
25
+ connections: Check Connection Status only
26
+ accuracy: Check Accuracy only
27
+ all_checks: Run all checks
28
+ wait_message: "Please wait while the status is verified. This will be slow if you selected ALL Authorities."
29
+ connection_checks: Connection Checks
30
+ accuracy_checks: Search Accuracy Checks
31
+ status_table:
32
+ action: Action
33
+ actual_position: Actual Position
34
+ authority: Authority
35
+ errmsg: Errors
36
+ expected_by_position: Expected by Position
37
+ service: Service
38
+ status: Status
39
+ subauthority: Subauthority
40
+ subject_uri: Expected Subject
41
+ url: Sample URL
42
+ monitor_status:
43
+ summary:
44
+ title: Summary
45
+ authorities: Authorities
46
+ authorities_with_failures: Authorities with Failures
47
+ passing_tests: Passing Tests
48
+ failing_tests: Failing Tests
49
+ total_tests: TOTAL Tests
50
+ last_updated: 'Status last updated %{date} ET'
51
+ failures:
52
+ title: Failures During Latest Status Update
53
+ status: Status
54
+ authority: Authority
55
+ subauthority: Subauthority
56
+ service: Service
57
+ action: Action
58
+ url: Sample URL
59
+ errmsg: Errors
60
+ history:
61
+ title: History
62
+ since: 'Since %{date} ET'
63
+ days_failing: Days Failing
64
+ authority: Authority
65
+ subauthority: Subauthority
66
+ service: Service
67
+ action: Action
68
+ url: Sample URL
data/config/routes.rb ADDED
@@ -0,0 +1,12 @@
1
+ QaServer::Engine.routes.draw do
2
+ # Downloads controller route
3
+ resources :homepage, only: 'index'
4
+
5
+ # Route the home page as the root
6
+ root to: 'homepage#index'
7
+
8
+ resources :usage, only: 'index'
9
+ resources :check_status, only: 'index'
10
+ resources :monitor_status, only: 'index'
11
+ resources :authority_list, only: 'index'
12
+ end
@@ -0,0 +1,35 @@
1
+ require 'rails/generators'
2
+
3
+ class QaServer::AssetsGenerator < Rails::Generators::Base
4
+ source_root File.expand_path('../templates', __FILE__)
5
+
6
+ desc """
7
+ This generator installs the qa_server CSS assets into your application
8
+ """
9
+
10
+ def banner
11
+ say_status('info', 'GENERATING QA_SERVER ASSETS', :blue)
12
+ end
13
+
14
+ def inject_css
15
+ say_status('info', ' -- adding qa_server css', :blue)
16
+ copy_file "qa_server.scss", "app/assets/stylesheets/qa_server.scss"
17
+ end
18
+
19
+ def inject_js
20
+ return if qa_server_javascript_installed?
21
+ say_status('info', ' -- adding qa_server javascript', :blue)
22
+ insert_into_file 'app/assets/javascripts/application.js', after: '//= require_tree .' do
23
+ <<-JS.strip_heredoc
24
+
25
+ //= require qa_server
26
+ JS
27
+ end
28
+ end
29
+
30
+ private
31
+
32
+ def qa_server_javascript_installed?
33
+ IO.read("app/assets/javascripts/application.js").include?('qa_server')
34
+ end
35
+ end
@@ -0,0 +1,31 @@
1
+ require 'rails/generators'
2
+
3
+ class QaServer::ConfigGenerator < Rails::Generators::Base
4
+ source_root File.expand_path('../templates', __FILE__)
5
+
6
+ desc """
7
+ This generator installs the qa_server configuration files into your application for:
8
+ * authority configs
9
+ * authority scenarios
10
+ * i18n
11
+ """
12
+
13
+ def banner
14
+ say_status('info', 'INSTALLING QA_SERVER CONFIGURATIONS', :blue)
15
+ end
16
+
17
+ def authority_configs
18
+ say_status('info', ' -- adding authority configurations', :blue)
19
+ directory "config/authorities/linked_data", recursive: false
20
+ end
21
+
22
+ def authority_scenarios
23
+ say_status('info', ' -- adding authority validations', :blue)
24
+ directory "config/authorities/linked_data/scenarios", recursive: false
25
+ end
26
+
27
+ def inject_i18n
28
+ say_status('info', ' -- adding i18n translations', :blue)
29
+ copy_file 'config/locales/qa_server.en.yml'
30
+ end
31
+ end
@@ -0,0 +1,60 @@
1
+ module QaServer
2
+ class Install < Rails::Generators::Base
3
+ source_root File.expand_path('../templates', __FILE__)
4
+
5
+ desc """
6
+ This generator makes the following changes to your application:
7
+ 1. Runs qa_server:models:install
8
+ 2. Injects QaServer routes
9
+ 3. Installs qa_server assets
10
+ """
11
+
12
+ def banner
13
+ say_status('info', 'INSTALLING QA_SERVER', :blue)
14
+ end
15
+
16
+ def run_required_generators
17
+ generate "qa_server:assets"
18
+ generate "qa_server:config"
19
+ generate "qa_server:models#{options[:force] ? ' -f' : ''}"
20
+ end
21
+
22
+ def add_to_gemfile
23
+ say_status('info', ' -- adding qa_server required gems', :blue)
24
+ gem 'qa', github: 'samvera/questioning_authority', branch: 'min_context'
25
+ gem 'linkeddata'
26
+
27
+ Bundler.with_clean_env do
28
+ run "bundle install"
29
+ end
30
+ end
31
+
32
+ # The engine routes have to come after the devise routes so that /users/sign_in will work
33
+ def inject_routes
34
+ say_status('info', ' -- adding qa_server routes', :blue)
35
+
36
+ # # Remove root route that was added by blacklight generator
37
+ # gsub_file 'config/routes.rb', /root (:to =>|to:) "catalog#index"/, ''
38
+
39
+ inject_into_file 'config/routes.rb', after: /Rails.application.routes.draw do\n/ do
40
+ " mount Qa::Engine => '/authorities'\n"\
41
+ " mount QaServer::Engine, at: '/'\n"\
42
+ " resources :welcome, only: 'index'\n"\
43
+ " root 'qa_server/homepage#index'\n"
44
+ end
45
+ end
46
+
47
+ def inject_bootstrap
48
+ say_status('info', ' -- adding bootstrap resources', :blue)
49
+
50
+ inject_into_file 'app/views/layouts/application.html.erb', after: /<head>\n/ do
51
+ " <!-- Latest compiled and minified CSS -->\n"\
52
+ " <link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'>\n"\
53
+ " <!-- jQuery library -->\n"\
54
+ " <script src='https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js'></script>\n"\
55
+ " <!-- Latest compiled JavaScript -->\n"\
56
+ " <script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js'></script>\n"
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,18 @@
1
+ class QaServer::ModelsGenerator < Rails::Generators::Base
2
+ source_root File.expand_path('../templates', __FILE__)
3
+
4
+ desc """
5
+ This generator makes the following changes to your application:
6
+ 1. Copies database migrations
7
+ """
8
+
9
+ def banner
10
+ say_status('info', 'INSTALLING QA_SERVER MODELS AND MIGRATIONS', :blue)
11
+ end
12
+
13
+ # Setup the database migrations
14
+ def copy_migrations
15
+ say_status('info', ' -- installing migrations', :blue)
16
+ rake 'qa_server:install:migrations'
17
+ end
18
+ end
@@ -0,0 +1,69 @@
1
+ {
2
+ "term": {
3
+ "url": {
4
+ "@context": "http://www.w3.org/ns/hydra/context.jsonld",
5
+ "@type": "IriTemplate",
6
+ "template": "http://artemide.art.uniroma2.it:8081/agrovoc/rest/v1/data?uri={?term_uri}",
7
+ "variableRepresentation": "BasicRepresentation",
8
+ "mapping": [
9
+ {
10
+ "@type": "IriTemplateMapping",
11
+ "variable": "term_uri",
12
+ "property": "hydra:freetextQuery",
13
+ "required": true,
14
+ "encode": true
15
+ }
16
+ ]
17
+ },
18
+ "qa_replacement_patterns": {
19
+ "term_id": "term_uri"
20
+ },
21
+ "term_id": "URI",
22
+ "language": ["en"],
23
+ "results": {
24
+ "label_predicate": "http://www.w3.org/2004/02/skos/core#prefLabel",
25
+ "altlabel_predicate": "http://www.w3.org/2004/02/skos/core#altLabel",
26
+ "broader_predicate": "http://www.w3.org/2004/02/skos/core#broader",
27
+ "narrower_predicate": "http://www.w3.org/2004/02/skos/core#narrower",
28
+ "sameas_predicate": "http://www.w3.org/2004/02/skos/core#exactMatch"
29
+ }
30
+ },
31
+ "search": {
32
+ "url": {
33
+ "@context": "http://www.w3.org/ns/hydra/context.jsonld",
34
+ "@type": "IriTemplate",
35
+ "template": "http://artemide.art.uniroma2.it:8081/agrovoc/rest/v1/search/?query=*{?query}*&lang={?lang}&maxhits={?maxRecords}",
36
+ "variableRepresentation": "BasicRepresentation",
37
+ "mapping": [
38
+ {
39
+ "@type": "IriTemplateMapping",
40
+ "variable": "query",
41
+ "property": "hydra:freetextQuery",
42
+ "required": true
43
+ },
44
+ {
45
+ "@type": "IriTemplateMapping",
46
+ "variable": "lang",
47
+ "property": "hydra:freetextQuery",
48
+ "required": false,
49
+ "default": "en"
50
+ },
51
+ {
52
+ "@type": "IriTemplateMapping",
53
+ "variable": "maxRecords",
54
+ "property": "hydra:freetextQuery",
55
+ "required": false,
56
+ "default": "20"
57
+ }
58
+ ]
59
+ },
60
+ "qa_replacement_patterns": {
61
+ "query": "query"
62
+ },
63
+ "results": {
64
+ "id_predicate": "http://purl.org/dc/terms/identifier",
65
+ "label_predicate": "http://www.w3.org/2004/02/skos/core#prefLabel",
66
+ "sort_predicate": "http://www.w3.org/2004/02/skos/core#prefLabel"
67
+ }
68
+ }
69
+ }
@@ -0,0 +1,85 @@
1
+ {
2
+ "term": {
3
+ "url": {
4
+ "@context": "http://www.w3.org/ns/hydra/context.jsonld",
5
+ "@type": "IriTemplate",
6
+ "template": "http://services.ld4l.org/ld4l_services/agrovoc_lookup.jsp?uri={?term_uri}",
7
+ "variableRepresentation": "BasicRepresentation",
8
+ "mapping": [
9
+ {
10
+ "@type": "IriTemplateMapping",
11
+ "variable": "term_uri",
12
+ "property": "hydra:freetextQuery",
13
+ "required": true,
14
+ "encode": true
15
+ }
16
+ ]
17
+ },
18
+ "qa_replacement_patterns": {
19
+ "term_id": "term_uri"
20
+ },
21
+ "term_id": "URI",
22
+ "results": {
23
+ "label_predicate": "http://www.w3.org/2004/02/skos/core#prefLabel",
24
+ "altlabel_predicate": "http://www.w3.org/2004/02/skos/core#altLabel",
25
+ "broader_predicate": "http://www.w3.org/2004/02/skos/core#broader",
26
+ "narrower_predicate": "http://www.w3.org/2004/02/skos/core#narrower",
27
+ "sameas_predicate": "http://www.w3.org/2004/02/skos/core#exactMatch"
28
+ }
29
+ },
30
+ "search": {
31
+ "url": {
32
+ "@context": "http://www.w3.org/ns/hydra/context.jsonld",
33
+ "@type": "IriTemplate",
34
+ "template": "http://services.ld4l.org/ld4l_services/agrovoc_batch.jsp?query={?query}&maxRecords={?maxRecords}&entity={?subauth}&lang={?lang}",
35
+ "variableRepresentation": "BasicRepresentation",
36
+ "mapping": [
37
+ {
38
+ "@type": "IriTemplateMapping",
39
+ "variable": "query",
40
+ "property": "hydra:freetextQuery",
41
+ "required": true
42
+ },
43
+ {
44
+ "@type": "IriTemplateMapping",
45
+ "variable": "subauth",
46
+ "property": "hydra:freetextQuery",
47
+ "required": false,
48
+ "default": ""
49
+ },
50
+ {
51
+ "@type": "IriTemplateMapping",
52
+ "variable": "maxRecords",
53
+ "property": "hydra:freetextQuery",
54
+ "required": false,
55
+ "default": "20"
56
+ },
57
+ {
58
+ "@type": "IriTemplateMapping",
59
+ "variable": "lang",
60
+ "property": "hydra:freetextQuery",
61
+ "required": false,
62
+ "default": "en"
63
+ }
64
+ ]
65
+ },
66
+ "qa_replacement_patterns": {
67
+ "query": "query",
68
+ "subauth": "subauth"
69
+ },
70
+ "results": {
71
+ "id_predicate": "http://purl.org/dc/terms/identifier",
72
+ "label_predicate": "http://www.w3.org/2004/02/skos/core#prefLabel",
73
+ "sort_predicate": "http://vivoweb.org/ontology/core#rank"
74
+ },
75
+ "subauthorities": {
76
+ "person": "Person",
77
+ "organization": "Organization",
78
+ "place": "Place",
79
+ "intangible": "Intangible",
80
+ "geocoordinates": "GeoCoordinates",
81
+ "work": "Work"
82
+ }
83
+ }
84
+ }
85
+
@@ -0,0 +1,36 @@
1
+ {
2
+ "term": {
3
+ "url": {
4
+ "@context": "http://www.w3.org/ns/hydra/context.jsonld",
5
+ "@type": "IriTemplate",
6
+ "template": "{?term_uri}?locale={?lang}",
7
+ "variableRepresentation": "BasicRepresentation",
8
+ "mapping": [
9
+ {
10
+ "@type": "IriTemplateMapping",
11
+ "variable": "term_uri",
12
+ "property": "hydra:freetextQuery",
13
+ "required": true,
14
+ "encode": false
15
+ },
16
+ {
17
+ "@type": "IriTemplateMapping",
18
+ "variable": "lang",
19
+ "property": "hydra:freetextQuery",
20
+ "required": false,
21
+ "default": "en"
22
+ }
23
+ ]
24
+ },
25
+ "qa_replacement_patterns": {
26
+ "term_id": "term_uri"
27
+ },
28
+ "language": ["en"],
29
+ "term_id": "URI",
30
+ "results": {
31
+ "label_predicate": "http://www.w3.org/2000/01/rdf-schema#label",
32
+ "sameas_predicate": "http://www.w3.org/2002/07/owl#sameAs"
33
+ }
34
+ },
35
+ "search": {}
36
+ }
@@ -0,0 +1,83 @@
1
+ {
2
+ "term": {
3
+ "url": {
4
+ "@context": "http://www.w3.org/ns/hydra/context.jsonld",
5
+ "@type": "IriTemplate",
6
+ "template": "http://services.ld4l.org/ld4l_services/dbpedia_name_lookup.jsp?uri={?term_uri}",
7
+ "variableRepresentation": "BasicRepresentation",
8
+ "mapping": [
9
+ {
10
+ "@type": "IriTemplateMapping",
11
+ "variable": "term_uri",
12
+ "property": "hydra:freetextQuery",
13
+ "required": true,
14
+ "encode": true
15
+ }
16
+ ]
17
+ },
18
+ "qa_replacement_patterns": {
19
+ "term_id": "term_uri"
20
+ },
21
+ "language": "en",
22
+ "term_id": "URI",
23
+ "results": {
24
+ "label_predicate": "http://dbpedia.org/property/name",
25
+ "sameas_predicate": "http://www.w3.org/2002/07/owl#sameAs"
26
+ }
27
+ },
28
+ "search": {
29
+ "url": {
30
+ "@context": "http://www.w3.org/ns/hydra/context.jsonld",
31
+ "@type": "IriTemplate",
32
+ "template": "http://services.ld4l.org/ld4l_services/dbpedia_name_batch.jsp?entity={?subauth}&query={?query}&maxRecords={?maxRecords}&lang={?lang}",
33
+ "variableRepresentation": "BasicRepresentation",
34
+ "mapping": [
35
+ {
36
+ "@type": "IriTemplateMapping",
37
+ "variable": "query",
38
+ "property": "hydra:freetextQuery",
39
+ "required": true
40
+ },
41
+ {
42
+ "@type": "IriTemplateMapping",
43
+ "variable": "subauth",
44
+ "property": "hydra:freetextQuery",
45
+ "required": false,
46
+ "default": ""
47
+ },
48
+ {
49
+ "@type": "IriTemplateMapping",
50
+ "variable": "maxRecords",
51
+ "property": "hydra:freetextQuery",
52
+ "required": false,
53
+ "default": "20"
54
+ },
55
+ {
56
+ "@type": "IriTemplateMapping",
57
+ "variable": "lang",
58
+ "property": "hydra:freetextQuery",
59
+ "required": false,
60
+ "default": "en"
61
+ }
62
+ ]
63
+ },
64
+ "qa_replacement_patterns": {
65
+ "query": "query",
66
+ "subauth": "subauth"
67
+ },
68
+ "language": ["en"],
69
+ "results": {
70
+ "id_predicate": "http://dbpedia.org/property/id",
71
+ "label_predicate": "http://dbpedia.org/property/name",
72
+ "sort_predicate": "http://vivoweb.org/ontology/core#rank"
73
+ },
74
+ "subauthorities": {
75
+ "person": "Person",
76
+ "organization": "Organization",
77
+ "place": "Place",
78
+ "intangible": "Intangible",
79
+ "geocoordinates": "GeoCoordinates",
80
+ "work": "Work"
81
+ }
82
+ }
83
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ "term": {
3
+ "url": {
4
+ "@context": "http://www.w3.org/ns/hydra/context.jsonld",
5
+ "@type": "IriTemplate",
6
+ "template": "{?term_uri}",
7
+ "variableRepresentation": "BasicRepresentation",
8
+ "mapping": [
9
+ {
10
+ "@type": "IriTemplateMapping",
11
+ "variable": "term_uri",
12
+ "property": "hydra:freetextQuery",
13
+ "required": true,
14
+ "encode": false
15
+ }
16
+ ]
17
+ },
18
+ "qa_replacement_patterns": {
19
+ "term_id": "term_uri"
20
+ },
21
+ "term_id": "URI",
22
+ "results": {
23
+ "label_predicate": "http://www.geonames.org/ontology#name",
24
+ "altlabel_predicate": "http://www.geonames.org/ontology#countryCode",
25
+ "broader_predicate": "http://www.geonames.org/ontology#parentFeature",
26
+ "sameas_predicate": "http://www.w3.org/2000/01/rdf-schema#seeAlso"
27
+ }
28
+ },
29
+ "search": {
30
+ "url": {
31
+ "@context": "http://www.w3.org/ns/hydra/context.jsonld",
32
+ "@type": "IriTemplate",
33
+ "template": "http://api.geonames.org/search?q={?query}&maxRows={?maximumRecords}&username={?username}&type=rdf",
34
+ "variableRepresentation": "BasicRepresentation",
35
+ "mapping": [
36
+ {
37
+ "@type": "IriTemplateMapping",
38
+ "variable": "query",
39
+ "property": "hydra:freetextQuery",
40
+ "required": true
41
+ },
42
+ {
43
+ "@type": "IriTemplateMapping",
44
+ "variable": "username",
45
+ "property": "hydra:freetextQuery",
46
+ "required": true,
47
+ "default": "elrayle"
48
+ },
49
+ {
50
+ "@type": "IriTemplateMapping",
51
+ "variable": "maximumRecords",
52
+ "property": "hydra:freetextQuery",
53
+ "required": false,
54
+ "default": "10"
55
+ }
56
+ ]
57
+ },
58
+ "qa_replacement_patterns": {
59
+ "query": "query"
60
+ },
61
+ "language": ["en"],
62
+ "results": {
63
+ "label_predicate": "http://www.geonames.org/ontology#name",
64
+ "altlabel_predicate": "http://www.geonames.org/ontology#countryCode",
65
+ "sort_predicate": "http://www.geonames.org/ontology#name"
66
+ }
67
+ }
68
+ }