qa 2.1.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +22 -3
- data/app/controllers/qa/application_controller.rb +2 -0
- data/app/controllers/qa/linked_data_terms_controller.rb +108 -49
- data/config/initializers/linked_data_authorities.rb +1 -17
- data/config/routes.rb +3 -0
- data/lib/generators/qa/apidoc/USAGE +11 -0
- data/lib/generators/qa/apidoc/apidoc_generator.rb +22 -0
- data/lib/generators/qa/apidoc/templates/public/qa/apidoc/apidoc.json +1322 -0
- data/lib/generators/qa/apidoc/templates/public/qa/apidoc/favicon-16x16.png +0 -0
- data/lib/generators/qa/apidoc/templates/public/qa/apidoc/favicon-32x32.png +0 -0
- data/lib/generators/qa/apidoc/templates/public/qa/apidoc/index.html +61 -0
- data/lib/generators/qa/apidoc/templates/public/qa/apidoc/oauth2-redirect.html +67 -0
- data/lib/generators/qa/apidoc/templates/public/qa/apidoc/swagger-ui-bundle.js +93 -0
- data/lib/generators/qa/apidoc/templates/public/qa/apidoc/swagger-ui-bundle.js.map +1 -0
- data/lib/generators/qa/apidoc/templates/public/qa/apidoc/swagger-ui-standalone-preset.js +14 -0
- data/lib/generators/qa/apidoc/templates/public/qa/apidoc/swagger-ui-standalone-preset.js.map +1 -0
- data/lib/generators/qa/apidoc/templates/public/qa/apidoc/swagger-ui.css +3 -0
- data/lib/generators/qa/apidoc/templates/public/qa/apidoc/swagger-ui.css.map +1 -0
- data/lib/generators/qa/apidoc/templates/public/qa/apidoc/swagger-ui.js +9 -0
- data/lib/generators/qa/apidoc/templates/public/qa/apidoc/swagger-ui.js.map +1 -0
- data/lib/generators/qa/install/install_generator.rb +7 -0
- data/lib/generators/qa/install/templates/config/initializers/qa.rb +6 -0
- data/lib/qa/authorities/getty/aat.rb +13 -6
- data/lib/qa/authorities/getty/tgn.rb +10 -21
- data/lib/qa/authorities/getty/ulan.rb +12 -15
- data/lib/qa/authorities/linked_data.rb +1 -0
- data/lib/qa/authorities/linked_data/authority_service.rb +47 -0
- data/lib/qa/authorities/linked_data/config.rb +1 -1
- data/lib/qa/authorities/linked_data/find_term.rb +2 -1
- data/lib/qa/authorities/linked_data/generic_authority.rb +8 -1
- data/lib/qa/authorities/loc/generic_authority.rb +2 -2
- data/lib/qa/configuration.rb +18 -0
- data/lib/qa/version.rb +1 -1
- data/spec/controllers/linked_data_terms_controller_spec.rb +175 -35
- data/spec/controllers/terms_controller_spec.rb +2 -2
- data/spec/fixtures/authorities/linked_data/lod_term_uri_param_config.json +27 -0
- data/spec/lib/authorities/getty/aat_spec.rb +14 -9
- data/spec/lib/authorities/getty/tgn_spec.rb +6 -17
- data/spec/lib/authorities/getty/ulan_spec.rb +5 -5
- data/spec/lib/authorities/linked_data/authority_service_spec.rb +46 -0
- data/spec/lib/authorities/linked_data/generic_authority_spec.rb +0 -84
- data/spec/lib/authorities/loc_spec.rb +9 -9
- data/spec/lib/configuration_spec.rb +58 -0
- metadata +42 -14
- data/config/authorities/linked_data/agrovoc.json +0 -61
- data/spec/fixtures/lod_agrovoc_query_many_results.json +0 -1
- data/spec/fixtures/lod_agrovoc_query_no_results.json +0 -1
- data/spec/fixtures/lod_agrovoc_term_found.rdf.xml +0 -217
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: fb238fb83dfeddf175de6e3b39f7cbfd8bc8d665ef07bfbd68d540ca9d19541b
|
4
|
+
data.tar.gz: 5a3b16d8b57dff5b3ece7fbd5dfa99be1d87879675d5e6d6764782087b2b06f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61d883f7a50e76e1aa0ea9d410d4251b294b81eb46355c8340af70e263ea9dddbd0f1f2407eff42dbb5ce1e04e4d04e8cb0f889a493c96885f70ea24b2a58c21
|
7
|
+
data.tar.gz: f0481a189b24f742f5d1c38f2c2e3c478c1cd06b427fe7cd86604b5378c64ec601f90b41af3f9ceb1c4d4d69b672cc9e957e4f08423b74664e4151663b8200f1
|
data/README.md
CHANGED
@@ -313,7 +313,7 @@ This will create two tables/models Qa::LocalAuthority and Qa::LocalAuthorityEntr
|
|
313
313
|
label: 'Uighur',
|
314
314
|
uri: 'http://id.loc.gov/vocabulary/languages/uig')
|
315
315
|
|
316
|
-
Unfortunately, Rails doesn't have a
|
316
|
+
Unfortunately, Rails doesn't have a mechanism for adding functional indexes to tables, so if you have a lot of rows, you'll want to add an index:
|
317
317
|
|
318
318
|
CREATE INDEX "index_qa_local_authority_entries_on_lower_label" ON
|
319
319
|
"qa_local_authority_entries" (local_authority_id, lower(label))
|
@@ -340,7 +340,7 @@ The entire list (up to the first 1000 terms) can also be returned using:
|
|
340
340
|
|
341
341
|
#### Loading RDF data into database tables
|
342
342
|
|
343
|
-
You can use the Qa::Services::RDFAuthorityParser to import rdf files into
|
343
|
+
You can use the Qa::Services::RDFAuthorityParser to import rdf files into your database tables. See the class file, lib/qa/services/rdf_authority_parser.rb, for examples and more information.
|
344
344
|
To run the class in your local project you must include `gem 'linkeddata'` into your Gemfile and `require 'linkeddata'` into an initializer or your application.rb
|
345
345
|
|
346
346
|
### Medical Subject Headings (MeSH)
|
@@ -358,7 +358,7 @@ Then, create the tables in your database
|
|
358
358
|
|
359
359
|
rake db:migrate
|
360
360
|
|
361
|
-
Now that you've setup your application to use MeSH terms, you'll now need to load the
|
361
|
+
Now that you've setup your application to use MeSH terms, you'll now need to load the terms into your
|
362
362
|
database so you can query them locally.
|
363
363
|
|
364
364
|
To import the mesh terms into the local database, first download the MeSH descriptor dump in ASCII
|
@@ -625,7 +625,26 @@ NOTE: All predicates with the URI as the subject will be included under "predica
|
|
625
625
|
|
626
626
|
See [Using with autocomplete in Sufia](https://github.com/samvera/questioning_authority/wiki/Using-with-autocomplete-in-Sufia) in the wiki documentation for QA.
|
627
627
|
|
628
|
+
If you are using jQueryUI >= 1.8 you can use the [autocomplete function](http://api.jqueryui.com/autocomplete/), for example:
|
628
629
|
|
630
|
+
```
|
631
|
+
$(function(){
|
632
|
+
$('#some_input').autocomplete({
|
633
|
+
source: function (request, response) {
|
634
|
+
$.ajax({
|
635
|
+
url: "/qa/search/loc/subjects?q=" + request.term,
|
636
|
+
type: 'GET',
|
637
|
+
dataType: 'json',
|
638
|
+
complete: function (xhr, status) {
|
639
|
+
var results = $.parseJSON(xhr.responseText);
|
640
|
+
response(results);
|
641
|
+
}
|
642
|
+
});
|
643
|
+
},
|
644
|
+
autoFocus: true
|
645
|
+
});
|
646
|
+
});
|
647
|
+
```
|
629
648
|
|
630
649
|
# Developer Notes
|
631
650
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module Qa
|
2
2
|
class ApplicationController < ActionController::Base
|
3
|
+
skip_before_action :verify_authenticity_token, only: :options, raise: false
|
4
|
+
|
3
5
|
# Process the OPTIONS method for all routes
|
4
6
|
# @see route definitions in /config/routes.rb
|
5
7
|
# @note Reference: https://fetch.spec.whatwg.org/#http-access-control-allow-headers
|
@@ -2,9 +2,11 @@
|
|
2
2
|
# out which linked data authority to query based on the 'vocab' param.
|
3
3
|
|
4
4
|
class Qa::LinkedDataTermsController < ::ApplicationController
|
5
|
-
before_action :check_authority, :init_authority
|
5
|
+
before_action :check_authority, :init_authority, except: [:list, :reload]
|
6
6
|
before_action :check_search_subauthority, :check_query_param, only: :search
|
7
7
|
before_action :check_show_subauthority, :check_id_param, only: :show
|
8
|
+
before_action :check_uri_param, only: :fetch
|
9
|
+
before_action :validate_auth_reload_token, only: :reload
|
8
10
|
|
9
11
|
delegate :cors_allow_origin_header, to: Qa::ApplicationController
|
10
12
|
|
@@ -14,54 +16,85 @@ class Qa::LinkedDataTermsController < ::ApplicationController
|
|
14
16
|
head :not_found
|
15
17
|
end
|
16
18
|
|
19
|
+
# Return a list of supported authority names
|
20
|
+
# get "/list/linked_data/authorities"
|
21
|
+
# @see Qa::Authorities::LinkedData::AuthorityService#authority_names
|
22
|
+
def list
|
23
|
+
render json: Qa::Authorities::LinkedData::AuthorityService.authority_names.to_json
|
24
|
+
end
|
25
|
+
|
26
|
+
# Reload authority configurations
|
27
|
+
# get "/reload/linked_data/authorities?auth_token=YOUR_AUTH_TOKEN_DEFINED_HERE"
|
28
|
+
# @see Qa::Authorities::LinkedData::AuthorityService#load_authorities
|
29
|
+
def reload
|
30
|
+
Qa::Authorities::LinkedData::AuthorityService.load_authorities
|
31
|
+
list
|
32
|
+
end
|
33
|
+
|
17
34
|
# Return a list of terms based on a query
|
35
|
+
# get "/search/linked_data/:vocab(/:subauthority)"
|
18
36
|
# @see Qa::Authorities::LinkedData::SearchQuery#search
|
19
|
-
def search
|
20
|
-
|
21
|
-
terms = @authority.search(query, subauth: subauthority, language: language, replacements: replacement_params)
|
22
|
-
rescue Qa::ServiceUnavailable
|
23
|
-
logger.warn "Service Unavailable - Search query #{query} unsuccessful for#{subauth_warn_msg} authority #{vocab_param}"
|
24
|
-
head :service_unavailable
|
25
|
-
return
|
26
|
-
rescue Qa::ServiceError
|
27
|
-
logger.warn "Internal Server Error - Search query #{query} unsuccessful for#{subauth_warn_msg} authority #{vocab_param}"
|
28
|
-
head :internal_server_error
|
29
|
-
return
|
30
|
-
rescue RDF::FormatError
|
31
|
-
logger.warn "RDF Format Error - Results from search query #{query} for#{subauth_warn_msg} authority #{vocab_param} " \
|
32
|
-
"was not identified as a valid RDF format. You may need to include the linkeddata gem."
|
33
|
-
head :internal_server_error
|
34
|
-
return
|
35
|
-
end
|
37
|
+
def search
|
38
|
+
terms = @authority.search(query, subauth: subauthority, language: language, replacements: replacement_params)
|
36
39
|
cors_allow_origin_header(response)
|
37
40
|
render json: terms
|
41
|
+
rescue Qa::ServiceUnavailable
|
42
|
+
logger.warn "Service Unavailable - Search query #{query} unsuccessful for#{subauth_warn_msg} authority #{vocab_param}"
|
43
|
+
head :service_unavailable
|
44
|
+
rescue Qa::ServiceError
|
45
|
+
logger.warn "Internal Server Error - Search query #{query} unsuccessful for#{subauth_warn_msg} authority #{vocab_param}"
|
46
|
+
head :internal_server_error
|
47
|
+
rescue RDF::FormatError
|
48
|
+
logger.warn "RDF Format Error - Results from search query #{query} for#{subauth_warn_msg} authority #{vocab_param} " \
|
49
|
+
"was not identified as a valid RDF format. You may need to include the linkeddata gem."
|
50
|
+
head :internal_server_error
|
38
51
|
end
|
39
52
|
|
40
|
-
# Return all the information for a given term
|
53
|
+
# Return all the information for a given term given an id or URI
|
54
|
+
# get "/show/linked_data/:vocab/:id"
|
55
|
+
# get "/show/linked_data/:vocab/:subauthority/:id
|
41
56
|
# @see Qa::Authorities::LinkedData::FindTerm#find
|
42
57
|
def show # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
58
|
+
term = @authority.find(id, subauth: subauthority, language: language, replacements: replacement_params, jsonld: jsonld?)
|
59
|
+
cors_allow_origin_header(response)
|
60
|
+
content_type = jsonld? ? 'application/ld+json' : 'application/json'
|
61
|
+
render json: term, content_type: content_type
|
62
|
+
rescue Qa::TermNotFound
|
63
|
+
logger.warn "Term Not Found - Fetch term #{id} unsuccessful for#{subauth_warn_msg} authority #{vocab_param}"
|
64
|
+
head :not_found
|
65
|
+
rescue Qa::ServiceUnavailable
|
66
|
+
logger.warn "Service Unavailable - Fetch term #{id} unsuccessful for#{subauth_warn_msg} authority #{vocab_param}"
|
67
|
+
head :service_unavailable
|
68
|
+
rescue Qa::ServiceError
|
69
|
+
logger.warn "Internal Server Error - Fetch term #{id} unsuccessful for#{subauth_warn_msg} authority #{vocab_param}"
|
70
|
+
head :internal_server_error
|
71
|
+
rescue RDF::FormatError
|
72
|
+
logger.warn "RDF Format Error - Results from fetch term #{id} for#{subauth_warn_msg} authority #{vocab_param} " \
|
73
|
+
"was not identified as a valid RDF format. You may need to include the linkeddata gem."
|
74
|
+
head :internal_server_error
|
75
|
+
end
|
76
|
+
|
77
|
+
# Return all the information for a given term given a URI
|
78
|
+
# get "/fetch/linked_data/:vocab"
|
79
|
+
# @see Qa::Authorities::LinkedData::FindTerm#find
|
80
|
+
def fetch # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
81
|
+
term = @authority.find(uri, subauth: subauthority, language: language, replacements: replacement_params, jsonld: jsonld?)
|
63
82
|
cors_allow_origin_header(response)
|
64
|
-
|
83
|
+
content_type = jsonld? ? 'application/ld+json' : 'application/json'
|
84
|
+
render json: term, content_type: content_type
|
85
|
+
rescue Qa::TermNotFound
|
86
|
+
logger.warn "Term Not Found - Fetch term #{uri} unsuccessful for#{subauth_warn_msg} authority #{vocab_param}"
|
87
|
+
head :not_found
|
88
|
+
rescue Qa::ServiceUnavailable
|
89
|
+
logger.warn "Service Unavailable - Fetch term #{uri} unsuccessful for#{subauth_warn_msg} authority #{vocab_param}"
|
90
|
+
head :service_unavailable
|
91
|
+
rescue Qa::ServiceError
|
92
|
+
logger.warn "Internal Server Error - Fetch term #{uri} unsuccessful for#{subauth_warn_msg} authority #{vocab_param}"
|
93
|
+
head :internal_server_error
|
94
|
+
rescue RDF::FormatError
|
95
|
+
logger.warn "RDF Format Error - Results from fetch term #{uri} for#{subauth_warn_msg} authority #{vocab_param} " \
|
96
|
+
"was not identified as a valid RDF format. You may need to include the linkeddata gem."
|
97
|
+
head :internal_server_error
|
65
98
|
end
|
66
99
|
|
67
100
|
private
|
@@ -101,10 +134,20 @@ class Qa::LinkedDataTermsController < ::ApplicationController
|
|
101
134
|
end
|
102
135
|
|
103
136
|
def check_query_param
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
137
|
+
missing_required_param('search', 'q') if params[:q].blank?
|
138
|
+
end
|
139
|
+
|
140
|
+
def check_id_param
|
141
|
+
missing_required_param('show', 'id') if id.blank?
|
142
|
+
end
|
143
|
+
|
144
|
+
def check_uri_param
|
145
|
+
missing_required_param('fetch', 'uri') if uri.blank?
|
146
|
+
end
|
147
|
+
|
148
|
+
def missing_required_param(action_name, param_name)
|
149
|
+
logger.warn "Required #{action_name} param '#{param_name}' is missing or empty"
|
150
|
+
head :bad_request
|
108
151
|
end
|
109
152
|
|
110
153
|
# converts wildcards into URL-encoded characters
|
@@ -112,11 +155,8 @@ class Qa::LinkedDataTermsController < ::ApplicationController
|
|
112
155
|
params[:q].gsub("*", "%2A")
|
113
156
|
end
|
114
157
|
|
115
|
-
def
|
116
|
-
|
117
|
-
logger.warn "Required show param 'id' is missing or empty"
|
118
|
-
head :bad_request
|
119
|
-
end
|
158
|
+
def uri
|
159
|
+
params[:uri]
|
120
160
|
end
|
121
161
|
|
122
162
|
def id
|
@@ -138,4 +178,23 @@ class Qa::LinkedDataTermsController < ::ApplicationController
|
|
138
178
|
def subauth_warn_msg
|
139
179
|
subauthority.nil? ? "" : " sub-authority #{subauthority} in"
|
140
180
|
end
|
181
|
+
|
182
|
+
def format
|
183
|
+
return 'json' unless params.key?(:format)
|
184
|
+
return 'json' if params[:format].blank?
|
185
|
+
params[:format]
|
186
|
+
end
|
187
|
+
|
188
|
+
def jsonld?
|
189
|
+
format == 'jsonld'
|
190
|
+
end
|
191
|
+
|
192
|
+
def validate_auth_reload_token
|
193
|
+
token = params.key?(:auth_token) ? params[:auth_token] : nil
|
194
|
+
valid = Qa.config.valid_authority_reload_token?(token)
|
195
|
+
return true if valid
|
196
|
+
logger.warn "FAIL: unable to reload authorities; error_msg: Invalid token (#{token}) does not match expected token."
|
197
|
+
head :unauthorized
|
198
|
+
false
|
199
|
+
end
|
141
200
|
end
|
@@ -1,17 +1 @@
|
|
1
|
-
|
2
|
-
# load QA configured linked data authorities
|
3
|
-
Dir[File.join(Qa::Engine.root, 'config', 'authorities', 'linked_data', '*.json')].each do |fn|
|
4
|
-
auth = File.basename(fn, '.json').upcase.to_sym
|
5
|
-
json = File.read(File.expand_path(fn, __FILE__))
|
6
|
-
cfg = JSON.parse(json).deep_symbolize_keys
|
7
|
-
auth_cfg[auth] = cfg
|
8
|
-
end
|
9
|
-
|
10
|
-
# load app configured linked data authorities and overrides
|
11
|
-
Dir[Rails.root.join('config', 'authorities', 'linked_data', '*.json')].each do |fn|
|
12
|
-
auth = File.basename(fn, '.json').upcase.to_sym
|
13
|
-
json = File.read(File.expand_path(fn, __FILE__))
|
14
|
-
cfg = JSON.parse(json).deep_symbolize_keys
|
15
|
-
auth_cfg[auth] = cfg
|
16
|
-
end
|
17
|
-
LINKED_DATA_AUTHORITIES_CONFIG = auth_cfg.freeze
|
1
|
+
Qa::Authorities::LinkedData::AuthorityService.load_authorities
|
data/config/routes.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
Qa::Engine.routes.draw do
|
2
|
+
get "/list/linked_data/authorities", controller: :linked_data_terms, action: :list
|
3
|
+
get "/reload/linked_data/authorities", controller: :linked_data_terms, action: :reload
|
2
4
|
get "/search/linked_data/:vocab(/:subauthority)", controller: :linked_data_terms, action: :search
|
5
|
+
get "/fetch/linked_data/:vocab", controller: :linked_data_terms, action: :fetch
|
3
6
|
get "/show/linked_data/:vocab/:id", controller: :linked_data_terms, action: :show
|
4
7
|
get "/show/linked_data/:vocab/:subauthority/:id", controller: :linked_data_terms, action: :show
|
5
8
|
get "/terms/:vocab(/:subauthority)", controller: :terms, action: :index
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class Qa::ApidocGenerator < 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. Add swagger-docs gem and bundle install
|
7
|
+
2. Add swagger documentation for the QA linked data API
|
8
|
+
|
9
|
+
"""
|
10
|
+
|
11
|
+
def add_to_gemfile
|
12
|
+
gem 'swagger-docs'
|
13
|
+
|
14
|
+
Bundler.with_clean_env do
|
15
|
+
run "bundle install"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def copy_api_docs
|
20
|
+
directory "public/qa/apidoc", recursive: false
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,1322 @@
|
|
1
|
+
{
|
2
|
+
"openapi": "3.0.1",
|
3
|
+
"info": {
|
4
|
+
"title": "QA 2.2 Linked Data API",
|
5
|
+
"version": "2.2",
|
6
|
+
"license": {
|
7
|
+
"name": "Apache 2.0",
|
8
|
+
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
9
|
+
}
|
10
|
+
},
|
11
|
+
"servers": [
|
12
|
+
{
|
13
|
+
"url": "http://{site_host}/{apiBase}",
|
14
|
+
"description": "QA v2.2 API Server",
|
15
|
+
"variables": {
|
16
|
+
"site_host": {
|
17
|
+
"default": "localhost:3000",
|
18
|
+
"description": ""
|
19
|
+
},
|
20
|
+
"apiBase": {
|
21
|
+
"default": "qa"
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
],
|
26
|
+
"paths": {
|
27
|
+
"/list/linked_data/authorities": {
|
28
|
+
"get": {
|
29
|
+
"summary": "List currently loaded linked data authorities",
|
30
|
+
"operationId": "GET_listAuthorities",
|
31
|
+
"tags": [
|
32
|
+
"Authority Management"
|
33
|
+
],
|
34
|
+
"responses": {
|
35
|
+
"200": {
|
36
|
+
"description": "Successfully accessed authority and received results.",
|
37
|
+
"headers": {
|
38
|
+
"Access-Control-Allow-Origin": {
|
39
|
+
"description": "CORS header will be * if cors_headers_enabled",
|
40
|
+
"schema": {
|
41
|
+
"type": "string"
|
42
|
+
}
|
43
|
+
}
|
44
|
+
},
|
45
|
+
"content": {
|
46
|
+
"application/json": {
|
47
|
+
"schema": {
|
48
|
+
"$ref": "#/components/schemas/linked_data_authorities_list_result"
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
},
|
56
|
+
"/reload/linked_data/authorities": {
|
57
|
+
"get": {
|
58
|
+
"summary": "Reload linked data authorities. Using this command avoids having to restart the rails server.",
|
59
|
+
"operationId": "GET_reloadAuthorities",
|
60
|
+
"tags": [
|
61
|
+
"Authority Management"
|
62
|
+
],
|
63
|
+
"parameters": [
|
64
|
+
{
|
65
|
+
"description": "Security token which must be included for this command to execute.",
|
66
|
+
"in": "query",
|
67
|
+
"name": "auth_token",
|
68
|
+
"required": true,
|
69
|
+
"schema": {
|
70
|
+
"default": "",
|
71
|
+
"type": "string"
|
72
|
+
}
|
73
|
+
}
|
74
|
+
],
|
75
|
+
"responses": {
|
76
|
+
"200": {
|
77
|
+
"description": "Successfully reloaded authorities.",
|
78
|
+
"headers": {
|
79
|
+
"Access-Control-Allow-Origin": {
|
80
|
+
"description": "CORS header will be * if cors_headers_enabled",
|
81
|
+
"schema": {
|
82
|
+
"type": "string"
|
83
|
+
}
|
84
|
+
}
|
85
|
+
},
|
86
|
+
"content": {
|
87
|
+
"application/json": {
|
88
|
+
"schema": {
|
89
|
+
"$ref": "#/components/schemas/linked_data_authorities_list_result"
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
},
|
94
|
+
"401": {
|
95
|
+
"description": "Unauthorized",
|
96
|
+
"content": {
|
97
|
+
"text/plain": {
|
98
|
+
"schema": {
|
99
|
+
"type": "string",
|
100
|
+
"example": ""
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
}
|
105
|
+
}
|
106
|
+
}
|
107
|
+
},
|
108
|
+
"/search/linked_data/{vocab}": {
|
109
|
+
"get": {
|
110
|
+
"summary": "Send a query string to an authority and return search results. Parameters are typical examples. Actual parameters are driven by the authority's config file.",
|
111
|
+
"operationId": "GET_searchAuthority",
|
112
|
+
"tags": [
|
113
|
+
"Search Query"
|
114
|
+
],
|
115
|
+
"parameters": [
|
116
|
+
{
|
117
|
+
"description": "Name of the authority's configuration file.",
|
118
|
+
"in": "path",
|
119
|
+
"name": "vocab",
|
120
|
+
"required": true,
|
121
|
+
"schema": {
|
122
|
+
"default": "oclc_fast",
|
123
|
+
"type": "string"
|
124
|
+
}
|
125
|
+
},
|
126
|
+
{
|
127
|
+
"description": "The query string",
|
128
|
+
"in": "query",
|
129
|
+
"name": "q",
|
130
|
+
"required": true,
|
131
|
+
"schema": {
|
132
|
+
"default": "science",
|
133
|
+
"type": "string"
|
134
|
+
}
|
135
|
+
},
|
136
|
+
{
|
137
|
+
"description": "Limit number of returned results. NOTE: Most authorities use maxRecords instead of maximumRecords for this parameter.",
|
138
|
+
"in": "query",
|
139
|
+
"name": "maximumRecords",
|
140
|
+
"required": false,
|
141
|
+
"schema": {
|
142
|
+
"default": 4,
|
143
|
+
"type": "integer"
|
144
|
+
}
|
145
|
+
},
|
146
|
+
{
|
147
|
+
"description": "Limit string values to this language when multiple languages are provided.",
|
148
|
+
"in": "query",
|
149
|
+
"name": "lang",
|
150
|
+
"required": false,
|
151
|
+
"schema": {
|
152
|
+
"default": "en",
|
153
|
+
"type": "string"
|
154
|
+
}
|
155
|
+
}
|
156
|
+
],
|
157
|
+
"responses": {
|
158
|
+
"200": {
|
159
|
+
"description": "Successfully accessed authority and received results.",
|
160
|
+
"headers": {
|
161
|
+
"Access-Control-Allow-Origin": {
|
162
|
+
"description": "CORS header will be * if cors_headers_enabled",
|
163
|
+
"schema": {
|
164
|
+
"type": "string"
|
165
|
+
}
|
166
|
+
}
|
167
|
+
},
|
168
|
+
"content": {
|
169
|
+
"application/json": {
|
170
|
+
"schema": {
|
171
|
+
"$ref": "#/components/schemas/linked_data_query_results"
|
172
|
+
}
|
173
|
+
}
|
174
|
+
}
|
175
|
+
},
|
176
|
+
"400": {
|
177
|
+
"description": "Bad Request - occurs when required params are missing (e.g. q)",
|
178
|
+
"content": {
|
179
|
+
"text/plain": {
|
180
|
+
"schema": {
|
181
|
+
"type": "string",
|
182
|
+
"example": ""
|
183
|
+
}
|
184
|
+
}
|
185
|
+
}
|
186
|
+
},
|
187
|
+
"500": {
|
188
|
+
"description": "Internal Server Error - can be raised while attempting to access the external authority OR during processing of results when results are not a valid RDF Format",
|
189
|
+
"content": {
|
190
|
+
"text/plain": {
|
191
|
+
"schema": {
|
192
|
+
"type": "string",
|
193
|
+
"example": ""
|
194
|
+
}
|
195
|
+
}
|
196
|
+
}
|
197
|
+
},
|
198
|
+
"503": {
|
199
|
+
"description": "Service Unavailable - can be raised while attempting to access the external authority",
|
200
|
+
"content": {
|
201
|
+
"text/plain": {
|
202
|
+
"schema": {
|
203
|
+
"type": "string",
|
204
|
+
"example": ""
|
205
|
+
}
|
206
|
+
}
|
207
|
+
}
|
208
|
+
}
|
209
|
+
}
|
210
|
+
},
|
211
|
+
"options": {
|
212
|
+
"summary": "CORS preflight request",
|
213
|
+
"operationId": "OPTIONS_searchAuthority",
|
214
|
+
"tags": [
|
215
|
+
"Search Query"
|
216
|
+
],
|
217
|
+
"parameters": [
|
218
|
+
{
|
219
|
+
"description": "Name of the authority's configuration file.",
|
220
|
+
"in": "path",
|
221
|
+
"name": "vocab",
|
222
|
+
"required": true,
|
223
|
+
"schema": {
|
224
|
+
"default": "oclc_fast",
|
225
|
+
"type": "string"
|
226
|
+
}
|
227
|
+
}
|
228
|
+
],
|
229
|
+
"responses": {
|
230
|
+
"204": {
|
231
|
+
"description": "When CORS is enabled, perform CORS preflight for searching an authority",
|
232
|
+
"headers": {
|
233
|
+
"Access-Control-Allow-Origin": {
|
234
|
+
"description": "CORS header will be * if CORS headers are enabled",
|
235
|
+
"schema": {
|
236
|
+
"type": "string"
|
237
|
+
}
|
238
|
+
},
|
239
|
+
"Access-Control-Allow-Methods": {
|
240
|
+
"description": "Indicates which method a future CORS request to the same resource might use.",
|
241
|
+
"schema": {
|
242
|
+
"type": "string"
|
243
|
+
}
|
244
|
+
}
|
245
|
+
},
|
246
|
+
"content": {
|
247
|
+
"text/plain": {
|
248
|
+
"schema": {
|
249
|
+
"type": "string",
|
250
|
+
"example": ""
|
251
|
+
}
|
252
|
+
}
|
253
|
+
}
|
254
|
+
},
|
255
|
+
"501": {
|
256
|
+
"description": "OPTIONS action is not implement when CORS headers are not enabled",
|
257
|
+
"content": {
|
258
|
+
"text/plain": {
|
259
|
+
"schema": {
|
260
|
+
"type": "string",
|
261
|
+
"example": ""
|
262
|
+
}
|
263
|
+
}
|
264
|
+
}
|
265
|
+
}
|
266
|
+
}
|
267
|
+
}
|
268
|
+
},
|
269
|
+
"/search/linked_data/{vocab}/{subauthority}": {
|
270
|
+
"get": {
|
271
|
+
"summary": "Send a query string to a subauthority in an authority and return search results.",
|
272
|
+
"operationId": "GET_searchSubauthority",
|
273
|
+
"tags": [
|
274
|
+
"Search Query"
|
275
|
+
],
|
276
|
+
"parameters": [
|
277
|
+
{
|
278
|
+
"description": "Name of the authority's configuration file.",
|
279
|
+
"in": "path",
|
280
|
+
"name": "vocab",
|
281
|
+
"required": true,
|
282
|
+
"schema": {
|
283
|
+
"default": "oclc_fast",
|
284
|
+
"type": "string"
|
285
|
+
}
|
286
|
+
},
|
287
|
+
{
|
288
|
+
"description": "Name of the subauthority.",
|
289
|
+
"in": "path",
|
290
|
+
"name": "subauthority",
|
291
|
+
"required": true,
|
292
|
+
"schema": {
|
293
|
+
"default": "personal_name",
|
294
|
+
"type": "string"
|
295
|
+
}
|
296
|
+
},
|
297
|
+
{
|
298
|
+
"description": "The query string",
|
299
|
+
"in": "query",
|
300
|
+
"name": "q",
|
301
|
+
"required": true,
|
302
|
+
"schema": {
|
303
|
+
"default": "twain",
|
304
|
+
"type": "string"
|
305
|
+
}
|
306
|
+
},
|
307
|
+
{
|
308
|
+
"description": "Limit number of returned results. NOTE: Most authorities use maxRecords instead of maximumRecords for this parameter.",
|
309
|
+
"in": "query",
|
310
|
+
"name": "maximumRecords",
|
311
|
+
"required": false,
|
312
|
+
"schema": {
|
313
|
+
"default": 4,
|
314
|
+
"type": "integer"
|
315
|
+
}
|
316
|
+
},
|
317
|
+
{
|
318
|
+
"description": "Limit string values to this language when multiple languages are provided.",
|
319
|
+
"in": "query",
|
320
|
+
"name": "lang",
|
321
|
+
"required": false,
|
322
|
+
"schema": {
|
323
|
+
"default": "en",
|
324
|
+
"type": "string"
|
325
|
+
}
|
326
|
+
}
|
327
|
+
],
|
328
|
+
"responses": {
|
329
|
+
"200": {
|
330
|
+
"description": "Successfully accessed subauthority in an authority and received results.",
|
331
|
+
"headers": {
|
332
|
+
"Access-Control-Allow-Origin": {
|
333
|
+
"description": "CORS header will be * if CORS headers are enabled",
|
334
|
+
"schema": {
|
335
|
+
"type": "string"
|
336
|
+
}
|
337
|
+
}
|
338
|
+
},
|
339
|
+
"content": {
|
340
|
+
"application/json": {
|
341
|
+
"schema": {
|
342
|
+
"$ref": "#/components/schemas/linked_data_query_results"
|
343
|
+
}
|
344
|
+
}
|
345
|
+
}
|
346
|
+
},
|
347
|
+
"400": {
|
348
|
+
"description": "Bad Request - occurs when required params are missing (e.g. q)",
|
349
|
+
"content": {
|
350
|
+
"text/plain": {
|
351
|
+
"schema": {
|
352
|
+
"type": "string",
|
353
|
+
"example": ""
|
354
|
+
}
|
355
|
+
}
|
356
|
+
}
|
357
|
+
},
|
358
|
+
"500": {
|
359
|
+
"description": "Internal Server Error - can be raised while attempting to access the external authority OR during processing of results when results are not a valid RDF Format",
|
360
|
+
"content": {
|
361
|
+
"text/plain": {
|
362
|
+
"schema": {
|
363
|
+
"type": "string",
|
364
|
+
"example": ""
|
365
|
+
}
|
366
|
+
}
|
367
|
+
}
|
368
|
+
},
|
369
|
+
"503": {
|
370
|
+
"description": "Service Unavailable - can be raised while attempting to access the external authority",
|
371
|
+
"content": {
|
372
|
+
"text/plain": {
|
373
|
+
"schema": {
|
374
|
+
"type": "string",
|
375
|
+
"example": ""
|
376
|
+
}
|
377
|
+
}
|
378
|
+
}
|
379
|
+
}
|
380
|
+
}
|
381
|
+
},
|
382
|
+
"options": {
|
383
|
+
"summary": "CORS preflight request",
|
384
|
+
"operationId": "OPTIONS_searchSubauthority",
|
385
|
+
"tags": [
|
386
|
+
"Search Query"
|
387
|
+
],
|
388
|
+
"parameters": [
|
389
|
+
{
|
390
|
+
"description": "Name of the authority's configuration file.",
|
391
|
+
"in": "path",
|
392
|
+
"name": "vocab",
|
393
|
+
"required": true,
|
394
|
+
"schema": {
|
395
|
+
"default": "oclc_fast",
|
396
|
+
"type": "string"
|
397
|
+
}
|
398
|
+
},
|
399
|
+
{
|
400
|
+
"description": "Name of the subauthority.",
|
401
|
+
"in": "path",
|
402
|
+
"name": "subauthority",
|
403
|
+
"required": true,
|
404
|
+
"schema": {
|
405
|
+
"default": "personal_name",
|
406
|
+
"type": "string"
|
407
|
+
}
|
408
|
+
}
|
409
|
+
],
|
410
|
+
"responses": {
|
411
|
+
"204": {
|
412
|
+
"description": "Perform CORS preflight for searching a subauthoroity in an authority",
|
413
|
+
"headers": {
|
414
|
+
"Access-Control-Allow-Origin": {
|
415
|
+
"description": "CORS header will be * if CORS headers are enabled",
|
416
|
+
"schema": {
|
417
|
+
"type": "string"
|
418
|
+
}
|
419
|
+
},
|
420
|
+
"Access-Control-Allow-Methods": {
|
421
|
+
"description": "Indicates which method a future CORS request to the same resource might use.",
|
422
|
+
"schema": {
|
423
|
+
"type": "string"
|
424
|
+
}
|
425
|
+
}
|
426
|
+
},
|
427
|
+
"content": {
|
428
|
+
"text/plain": {
|
429
|
+
"schema": {
|
430
|
+
"type": "string",
|
431
|
+
"example": ""
|
432
|
+
}
|
433
|
+
}
|
434
|
+
}
|
435
|
+
},
|
436
|
+
"501": {
|
437
|
+
"description": "OPTIONS action is not implement when CORS headers are not enabled",
|
438
|
+
"content": {
|
439
|
+
"text/plain": {
|
440
|
+
"schema": {
|
441
|
+
"type": "string",
|
442
|
+
"example": ""
|
443
|
+
}
|
444
|
+
}
|
445
|
+
}
|
446
|
+
}
|
447
|
+
}
|
448
|
+
}
|
449
|
+
},
|
450
|
+
"/show/linked_data/{vocab}/{id}": {
|
451
|
+
"get": {
|
452
|
+
"operationId": "GET_fetchByIDFromAuthority",
|
453
|
+
"summary": "Get a single term from an authority. Generally there are no additional parameters. See the authority's configuration file to be sure. Some authorities support `lang` which can be used to filter the language of returned strings.",
|
454
|
+
"tags": [
|
455
|
+
"Fetch Term"
|
456
|
+
],
|
457
|
+
"parameters": [
|
458
|
+
{
|
459
|
+
"description": "Name of the authority's configuration file.",
|
460
|
+
"in": "path",
|
461
|
+
"name": "vocab",
|
462
|
+
"required": true,
|
463
|
+
"schema": {
|
464
|
+
"default": "oclc_fast",
|
465
|
+
"type": "string"
|
466
|
+
}
|
467
|
+
},
|
468
|
+
{
|
469
|
+
"description": "The ID or URI for the term being retrieved.",
|
470
|
+
"in": "path",
|
471
|
+
"name": "id",
|
472
|
+
"required": true,
|
473
|
+
"schema": {
|
474
|
+
"default": "1914919",
|
475
|
+
"type": "string"
|
476
|
+
}
|
477
|
+
},
|
478
|
+
{
|
479
|
+
"description": "The format of the returned result.",
|
480
|
+
"in": "query",
|
481
|
+
"name": "format",
|
482
|
+
"required": false,
|
483
|
+
"schema": {
|
484
|
+
"default": "json",
|
485
|
+
"type": "string",
|
486
|
+
"enum": [
|
487
|
+
"json",
|
488
|
+
"jsonld"
|
489
|
+
]
|
490
|
+
}
|
491
|
+
}
|
492
|
+
],
|
493
|
+
"responses": {
|
494
|
+
"200": {
|
495
|
+
"description": "Successfully accessed authority and received term.",
|
496
|
+
"headers": {
|
497
|
+
"Access-Control-Allow-Origin": {
|
498
|
+
"description": "CORS header will be * if CORS headers are enabled",
|
499
|
+
"schema": {
|
500
|
+
"type": "string"
|
501
|
+
}
|
502
|
+
}
|
503
|
+
},
|
504
|
+
"content": {
|
505
|
+
"application/json": {
|
506
|
+
"schema": {
|
507
|
+
"$ref": "#/components/schemas/linked_data_term_json_result"
|
508
|
+
}
|
509
|
+
},
|
510
|
+
"application/ld+json": {
|
511
|
+
"schema": {
|
512
|
+
"$ref": "#/components/schemas/linked_data_term_jsonld_result"
|
513
|
+
}
|
514
|
+
}
|
515
|
+
}
|
516
|
+
},
|
517
|
+
"400": {
|
518
|
+
"description": "Bad Request - occurs when required params are missing (e.g. id)",
|
519
|
+
"content": {
|
520
|
+
"text/plain": {
|
521
|
+
"schema": {
|
522
|
+
"type": "string",
|
523
|
+
"example": ""
|
524
|
+
}
|
525
|
+
}
|
526
|
+
}
|
527
|
+
},
|
528
|
+
"404": {
|
529
|
+
"description": "Not Found",
|
530
|
+
"content": {
|
531
|
+
"text/plain": {
|
532
|
+
"schema": {
|
533
|
+
"type": "string",
|
534
|
+
"example": ""
|
535
|
+
}
|
536
|
+
}
|
537
|
+
}
|
538
|
+
},
|
539
|
+
"500": {
|
540
|
+
"description": "Internal Server Error - can be raised while attempting to access the external authority OR during processing of results when results are not a valid RDF Format",
|
541
|
+
"content": {
|
542
|
+
"text/plain": {
|
543
|
+
"schema": {
|
544
|
+
"type": "string",
|
545
|
+
"example": ""
|
546
|
+
}
|
547
|
+
}
|
548
|
+
}
|
549
|
+
},
|
550
|
+
"503": {
|
551
|
+
"description": "Service Unavailable - can be raised while attempting to access the external authority",
|
552
|
+
"content": {
|
553
|
+
"text/plain": {
|
554
|
+
"schema": {
|
555
|
+
"type": "string",
|
556
|
+
"example": ""
|
557
|
+
}
|
558
|
+
}
|
559
|
+
}
|
560
|
+
}
|
561
|
+
}
|
562
|
+
},
|
563
|
+
"options": {
|
564
|
+
"summary": "CORS preflight request",
|
565
|
+
"operationId": "OPTIONS_fetchFromAuthority",
|
566
|
+
"tags": [
|
567
|
+
"Fetch Term"
|
568
|
+
],
|
569
|
+
"parameters": [
|
570
|
+
{
|
571
|
+
"description": "Name of the authority's configuration file.",
|
572
|
+
"in": "path",
|
573
|
+
"name": "vocab",
|
574
|
+
"required": true,
|
575
|
+
"schema": {
|
576
|
+
"default": "oclc_fast",
|
577
|
+
"type": "string"
|
578
|
+
}
|
579
|
+
},
|
580
|
+
{
|
581
|
+
"description": "The ID or URI for the term being retrieved.",
|
582
|
+
"in": "path",
|
583
|
+
"name": "id",
|
584
|
+
"required": true,
|
585
|
+
"schema": {
|
586
|
+
"default": "1914919",
|
587
|
+
"type": "string"
|
588
|
+
}
|
589
|
+
}
|
590
|
+
],
|
591
|
+
"responses": {
|
592
|
+
"204": {
|
593
|
+
"description": "Perform CORS preflight for fetching a term from an authority",
|
594
|
+
"headers": {
|
595
|
+
"Access-Control-Allow-Origin": {
|
596
|
+
"description": "CORS header will be * if CORS headers are enabled",
|
597
|
+
"schema": {
|
598
|
+
"type": "string"
|
599
|
+
}
|
600
|
+
},
|
601
|
+
"Access-Control-Allow-Methods": {
|
602
|
+
"description": "Indicates which method a future CORS request to the same resource might use.",
|
603
|
+
"schema": {
|
604
|
+
"type": "string"
|
605
|
+
}
|
606
|
+
}
|
607
|
+
},
|
608
|
+
"content": {
|
609
|
+
"text/plain": {
|
610
|
+
"schema": {
|
611
|
+
"type": "string",
|
612
|
+
"example": ""
|
613
|
+
}
|
614
|
+
}
|
615
|
+
}
|
616
|
+
},
|
617
|
+
"501": {
|
618
|
+
"description": "OPTIONS action is not implement when CORS headers are not enabled",
|
619
|
+
"content": {
|
620
|
+
"text/plain": {
|
621
|
+
"schema": {
|
622
|
+
"type": "string",
|
623
|
+
"example": ""
|
624
|
+
}
|
625
|
+
}
|
626
|
+
}
|
627
|
+
}
|
628
|
+
}
|
629
|
+
}
|
630
|
+
},
|
631
|
+
"/show/linked_data/{vocab}/{subauthority}/{id}": {
|
632
|
+
"get": {
|
633
|
+
"operationId": "GET_fetchByIDFromSubauthority",
|
634
|
+
"summary": "Get a single term from a subauthority in an authority. Generally there are no additional parameters. See the authority's configuration file to be sure. Some authorities support `lang` which can be used to filter the language of returned strings.",
|
635
|
+
"tags": [
|
636
|
+
"Fetch Term"
|
637
|
+
],
|
638
|
+
"parameters": [
|
639
|
+
{
|
640
|
+
"description": "Name of the authority's configuration file.",
|
641
|
+
"in": "path",
|
642
|
+
"name": "vocab",
|
643
|
+
"required": true,
|
644
|
+
"schema": {
|
645
|
+
"default": "loc",
|
646
|
+
"type": "string"
|
647
|
+
}
|
648
|
+
},
|
649
|
+
{
|
650
|
+
"description": "Name of the subauthority.",
|
651
|
+
"in": "path",
|
652
|
+
"name": "subauthority",
|
653
|
+
"required": true,
|
654
|
+
"schema": {
|
655
|
+
"default": "names",
|
656
|
+
"type": "string"
|
657
|
+
}
|
658
|
+
},
|
659
|
+
{
|
660
|
+
"description": "The ID or URI for the term being retrieved.",
|
661
|
+
"in": "path",
|
662
|
+
"name": "id",
|
663
|
+
"required": true,
|
664
|
+
"schema": {
|
665
|
+
"default": "n92016188",
|
666
|
+
"type": "string"
|
667
|
+
}
|
668
|
+
},
|
669
|
+
{
|
670
|
+
"description": "The format of the returned result.",
|
671
|
+
"in": "query",
|
672
|
+
"name": "format",
|
673
|
+
"required": false,
|
674
|
+
"schema": {
|
675
|
+
"default": "json",
|
676
|
+
"type": "string",
|
677
|
+
"enum": [
|
678
|
+
"json",
|
679
|
+
"jsonld"
|
680
|
+
]
|
681
|
+
}
|
682
|
+
}
|
683
|
+
],
|
684
|
+
"responses": {
|
685
|
+
"200": {
|
686
|
+
"description": "Successfully accessed subauthority in the authority and received term.",
|
687
|
+
"headers": {
|
688
|
+
"Access-Control-Allow-Origin": {
|
689
|
+
"description": "CORS header will be * if CORS headers are enabled",
|
690
|
+
"schema": {
|
691
|
+
"type": "string"
|
692
|
+
}
|
693
|
+
}
|
694
|
+
},
|
695
|
+
"content": {
|
696
|
+
"application/json": {
|
697
|
+
"schema": {
|
698
|
+
"$ref": "#/components/schemas/linked_data_term_json_result"
|
699
|
+
}
|
700
|
+
},
|
701
|
+
"application/ld+json": {
|
702
|
+
"schema": {
|
703
|
+
"$ref": "#/components/schemas/linked_data_term_jsonld_result"
|
704
|
+
}
|
705
|
+
}
|
706
|
+
}
|
707
|
+
},
|
708
|
+
"400": {
|
709
|
+
"description": "Bad Request - occurs when required params are missing (e.g. id)",
|
710
|
+
"content": {
|
711
|
+
"text/plain": {
|
712
|
+
"schema": {
|
713
|
+
"type": "string",
|
714
|
+
"example": ""
|
715
|
+
}
|
716
|
+
}
|
717
|
+
}
|
718
|
+
},
|
719
|
+
"404": {
|
720
|
+
"description": "Not Found",
|
721
|
+
"content": {
|
722
|
+
"text/plain": {
|
723
|
+
"schema": {
|
724
|
+
"type": "string",
|
725
|
+
"example": ""
|
726
|
+
}
|
727
|
+
}
|
728
|
+
}
|
729
|
+
},
|
730
|
+
"500": {
|
731
|
+
"description": "Internal Server Error - can be raised while attempting to access the external authority OR during processing of results when results are not a valid RDF Format",
|
732
|
+
"content": {
|
733
|
+
"text/plain": {
|
734
|
+
"schema": {
|
735
|
+
"type": "string",
|
736
|
+
"example": ""
|
737
|
+
}
|
738
|
+
}
|
739
|
+
}
|
740
|
+
},
|
741
|
+
"503": {
|
742
|
+
"description": "Service Unavailable - can be raised while attempting to access the external authority",
|
743
|
+
"content": {
|
744
|
+
"text/plain": {
|
745
|
+
"schema": {
|
746
|
+
"type": "string",
|
747
|
+
"example": ""
|
748
|
+
}
|
749
|
+
}
|
750
|
+
}
|
751
|
+
}
|
752
|
+
}
|
753
|
+
},
|
754
|
+
"options": {
|
755
|
+
"summary": "CORS preflight request",
|
756
|
+
"operationId": "OPTIONS_fetchFromSubauthority",
|
757
|
+
"tags": [
|
758
|
+
"Fetch Term"
|
759
|
+
],
|
760
|
+
"parameters": [
|
761
|
+
{
|
762
|
+
"description": "Name of the authority's configuration file.",
|
763
|
+
"in": "path",
|
764
|
+
"name": "vocab",
|
765
|
+
"required": true,
|
766
|
+
"schema": {
|
767
|
+
"default": "loc",
|
768
|
+
"type": "string"
|
769
|
+
}
|
770
|
+
},
|
771
|
+
{
|
772
|
+
"description": "Name of the subauthority.",
|
773
|
+
"in": "path",
|
774
|
+
"name": "subauthority",
|
775
|
+
"required": true,
|
776
|
+
"schema": {
|
777
|
+
"default": "names",
|
778
|
+
"type": "string"
|
779
|
+
}
|
780
|
+
},
|
781
|
+
{
|
782
|
+
"description": "The ID or URI for the term being retrieved.",
|
783
|
+
"in": "path",
|
784
|
+
"name": "id",
|
785
|
+
"required": true,
|
786
|
+
"schema": {
|
787
|
+
"default": "n92016188",
|
788
|
+
"type": "string"
|
789
|
+
}
|
790
|
+
}
|
791
|
+
],
|
792
|
+
"responses": {
|
793
|
+
"204": {
|
794
|
+
"description": "Perform CORS preflight for fetching a term from a subauthority in an authority",
|
795
|
+
"headers": {
|
796
|
+
"Access-Control-Allow-Origin": {
|
797
|
+
"description": "CORS header will be * if CORS headers are enabled",
|
798
|
+
"schema": {
|
799
|
+
"type": "string"
|
800
|
+
}
|
801
|
+
},
|
802
|
+
"Access-Control-Allow-Methods": {
|
803
|
+
"description": "Indicates which method a future CORS request to the same resource might use.",
|
804
|
+
"schema": {
|
805
|
+
"type": "string"
|
806
|
+
}
|
807
|
+
}
|
808
|
+
},
|
809
|
+
"content": {
|
810
|
+
"text/plain": {
|
811
|
+
"schema": {
|
812
|
+
"type": "string",
|
813
|
+
"example": ""
|
814
|
+
}
|
815
|
+
}
|
816
|
+
}
|
817
|
+
},
|
818
|
+
"501": {
|
819
|
+
"description": "OPTIONS action is not implement when CORS headers are not enabled",
|
820
|
+
"content": {
|
821
|
+
"text/plain": {
|
822
|
+
"schema": {
|
823
|
+
"type": "string",
|
824
|
+
"example": ""
|
825
|
+
}
|
826
|
+
}
|
827
|
+
}
|
828
|
+
}
|
829
|
+
}
|
830
|
+
}
|
831
|
+
},
|
832
|
+
"/fetch/linked_data/{vocab}": {
|
833
|
+
"get": {
|
834
|
+
"operationId": "GET_fetchURIFromAuthority",
|
835
|
+
"summary": "Get a single term from an authority given the term's URI. Generally there are no additional parameters. See the authority's configuration file to be sure. Some authorities support `lang` which can be used to filter the language of returned strings. NOTE: The authorities provided with QA do not support fetch by URI. See more authority configs at: https://github.com/LD4P/linked_data_authorities",
|
836
|
+
"tags": [
|
837
|
+
"Fetch Term"
|
838
|
+
],
|
839
|
+
"parameters": [
|
840
|
+
{
|
841
|
+
"description": "Name of the authority's configuration file.",
|
842
|
+
"in": "path",
|
843
|
+
"name": "vocab",
|
844
|
+
"required": true,
|
845
|
+
"schema": {
|
846
|
+
"default": "loc",
|
847
|
+
"type": "string"
|
848
|
+
}
|
849
|
+
},
|
850
|
+
{
|
851
|
+
"description": "The URI for the term being retrieved.",
|
852
|
+
"in": "query",
|
853
|
+
"name": "uri",
|
854
|
+
"required": true,
|
855
|
+
"schema": {
|
856
|
+
"default": "http://id.loc.gov/authorities/genreForms/gf2011026141",
|
857
|
+
"type": "string"
|
858
|
+
}
|
859
|
+
},
|
860
|
+
{
|
861
|
+
"description": "The format of the returned result.",
|
862
|
+
"in": "query",
|
863
|
+
"name": "format",
|
864
|
+
"required": false,
|
865
|
+
"schema": {
|
866
|
+
"default": "json",
|
867
|
+
"type": "string",
|
868
|
+
"enum": [
|
869
|
+
"json",
|
870
|
+
"jsonld"
|
871
|
+
]
|
872
|
+
}
|
873
|
+
}
|
874
|
+
],
|
875
|
+
"responses": {
|
876
|
+
"200": {
|
877
|
+
"description": "Successfully accessed authority and received term.",
|
878
|
+
"headers": {
|
879
|
+
"Access-Control-Allow-Origin": {
|
880
|
+
"description": "CORS header will be * if CORS headers are enabled",
|
881
|
+
"schema": {
|
882
|
+
"type": "string"
|
883
|
+
}
|
884
|
+
}
|
885
|
+
},
|
886
|
+
"content": {
|
887
|
+
"application/json": {
|
888
|
+
"schema": {
|
889
|
+
"$ref": "#/components/schemas/linked_data_term_json_result"
|
890
|
+
}
|
891
|
+
},
|
892
|
+
"application/ld+json": {
|
893
|
+
"schema": {
|
894
|
+
"$ref": "#/components/schemas/linked_data_term_jsonld_result"
|
895
|
+
}
|
896
|
+
}
|
897
|
+
}
|
898
|
+
},
|
899
|
+
"400": {
|
900
|
+
"description": "Bad Request - occurs when required params are missing (e.g. uri)",
|
901
|
+
"content": {
|
902
|
+
"text/plain": {
|
903
|
+
"schema": {
|
904
|
+
"type": "string",
|
905
|
+
"example": ""
|
906
|
+
}
|
907
|
+
}
|
908
|
+
}
|
909
|
+
},
|
910
|
+
"404": {
|
911
|
+
"description": "Not Found",
|
912
|
+
"content": {
|
913
|
+
"text/plain": {
|
914
|
+
"schema": {
|
915
|
+
"type": "string",
|
916
|
+
"example": ""
|
917
|
+
}
|
918
|
+
}
|
919
|
+
}
|
920
|
+
},
|
921
|
+
"500": {
|
922
|
+
"description": "Internal Server Error - can be raised while attempting to access the external authority OR during processing of results when results are not a valid RDF Format",
|
923
|
+
"content": {
|
924
|
+
"text/plain": {
|
925
|
+
"schema": {
|
926
|
+
"type": "string",
|
927
|
+
"example": ""
|
928
|
+
}
|
929
|
+
}
|
930
|
+
}
|
931
|
+
},
|
932
|
+
"503": {
|
933
|
+
"description": "Service Unavailable - can be raised while attempting to access the external authority",
|
934
|
+
"content": {
|
935
|
+
"text/plain": {
|
936
|
+
"schema": {
|
937
|
+
"type": "string",
|
938
|
+
"example": ""
|
939
|
+
}
|
940
|
+
}
|
941
|
+
}
|
942
|
+
}
|
943
|
+
}
|
944
|
+
},
|
945
|
+
"options": {
|
946
|
+
"summary": "CORS preflight request",
|
947
|
+
"operationId": "OPTIONS_fetchFromAuthority",
|
948
|
+
"tags": [
|
949
|
+
"Fetch Term"
|
950
|
+
],
|
951
|
+
"parameters": [
|
952
|
+
{
|
953
|
+
"description": "Name of the authority's configuration file.",
|
954
|
+
"in": "path",
|
955
|
+
"name": "vocab",
|
956
|
+
"required": true,
|
957
|
+
"schema": {
|
958
|
+
"default": "loc",
|
959
|
+
"type": "string"
|
960
|
+
}
|
961
|
+
},
|
962
|
+
{
|
963
|
+
"description": "The ID or URI for the term being retrieved.",
|
964
|
+
"in": "path",
|
965
|
+
"name": "id",
|
966
|
+
"required": true,
|
967
|
+
"schema": {
|
968
|
+
"default": "http://id.loc.gov/authorities/genreForms/gf2011026141",
|
969
|
+
"type": "string"
|
970
|
+
}
|
971
|
+
}
|
972
|
+
],
|
973
|
+
"responses": {
|
974
|
+
"204": {
|
975
|
+
"description": "Perform CORS preflight for fetching a term from an authority",
|
976
|
+
"headers": {
|
977
|
+
"Access-Control-Allow-Origin": {
|
978
|
+
"description": "CORS header will be * if CORS headers are enabled",
|
979
|
+
"schema": {
|
980
|
+
"type": "string"
|
981
|
+
}
|
982
|
+
},
|
983
|
+
"Access-Control-Allow-Methods": {
|
984
|
+
"description": "Indicates which method a future CORS request to the same resource might use.",
|
985
|
+
"schema": {
|
986
|
+
"type": "string"
|
987
|
+
}
|
988
|
+
}
|
989
|
+
},
|
990
|
+
"content": {
|
991
|
+
"text/plain": {
|
992
|
+
"schema": {
|
993
|
+
"type": "string",
|
994
|
+
"example": ""
|
995
|
+
}
|
996
|
+
}
|
997
|
+
}
|
998
|
+
},
|
999
|
+
"501": {
|
1000
|
+
"description": "OPTIONS action is not implement when CORS headers are not enabled",
|
1001
|
+
"content": {
|
1002
|
+
"text/plain": {
|
1003
|
+
"schema": {
|
1004
|
+
"type": "string",
|
1005
|
+
"example": ""
|
1006
|
+
}
|
1007
|
+
}
|
1008
|
+
}
|
1009
|
+
}
|
1010
|
+
}
|
1011
|
+
}
|
1012
|
+
},
|
1013
|
+
"/fetch/linked_data/{vocab}/{subauthority}": {
|
1014
|
+
"get": {
|
1015
|
+
"operationId": "GET_fetchByURIFromSubauthority",
|
1016
|
+
"summary": "Get a single term from a subauthority in an authority given the term's URI. Generally there are no additional parameters. See the authority's configuration file to be sure. Some authorities support `lang` which can be used to filter the language of returned strings. NOTE: There currently aren't any authorities configured that support subauthorities and access terms using a URI instead of an ID. The default values in this example show what you might see but DO NOT WORK with the current LOC config.",
|
1017
|
+
"tags": [
|
1018
|
+
"Fetch Term"
|
1019
|
+
],
|
1020
|
+
"parameters": [
|
1021
|
+
{
|
1022
|
+
"description": "Name of the authority's configuration file.",
|
1023
|
+
"in": "path",
|
1024
|
+
"name": "vocab",
|
1025
|
+
"required": true,
|
1026
|
+
"schema": {
|
1027
|
+
"default": "loc",
|
1028
|
+
"type": "string"
|
1029
|
+
}
|
1030
|
+
},
|
1031
|
+
{
|
1032
|
+
"description": "Name of the subauthority.",
|
1033
|
+
"in": "path",
|
1034
|
+
"name": "subauthority",
|
1035
|
+
"required": true,
|
1036
|
+
"schema": {
|
1037
|
+
"default": "names",
|
1038
|
+
"type": "string"
|
1039
|
+
}
|
1040
|
+
},
|
1041
|
+
{
|
1042
|
+
"description": "The URI for the term being retrieved.",
|
1043
|
+
"in": "query",
|
1044
|
+
"name": "uri",
|
1045
|
+
"required": true,
|
1046
|
+
"schema": {
|
1047
|
+
"default": "http://id.loc.gov/authorities/names/n92016188",
|
1048
|
+
"type": "string"
|
1049
|
+
}
|
1050
|
+
},
|
1051
|
+
{
|
1052
|
+
"description": "The format of the returned result.",
|
1053
|
+
"in": "query",
|
1054
|
+
"name": "format",
|
1055
|
+
"required": false,
|
1056
|
+
"schema": {
|
1057
|
+
"default": "json",
|
1058
|
+
"type": "string",
|
1059
|
+
"enum": [
|
1060
|
+
"json",
|
1061
|
+
"jsonld"
|
1062
|
+
]
|
1063
|
+
}
|
1064
|
+
}
|
1065
|
+
],
|
1066
|
+
"responses": {
|
1067
|
+
"200": {
|
1068
|
+
"description": "Successfully accessed subauthority in the authority and received term.",
|
1069
|
+
"headers": {
|
1070
|
+
"Access-Control-Allow-Origin": {
|
1071
|
+
"description": "CORS header will be * if CORS headers are enabled",
|
1072
|
+
"schema": {
|
1073
|
+
"type": "string"
|
1074
|
+
}
|
1075
|
+
}
|
1076
|
+
},
|
1077
|
+
"content": {
|
1078
|
+
"application/json": {
|
1079
|
+
"schema": {
|
1080
|
+
"$ref": "#/components/schemas/linked_data_term_json_result"
|
1081
|
+
}
|
1082
|
+
},
|
1083
|
+
"application/ld+json": {
|
1084
|
+
"schema": {
|
1085
|
+
"$ref": "#/components/schemas/linked_data_term_jsonld_result"
|
1086
|
+
}
|
1087
|
+
}
|
1088
|
+
}
|
1089
|
+
},
|
1090
|
+
"400": {
|
1091
|
+
"description": "Bad Request - occurs when required params are missing (e.g. uri)",
|
1092
|
+
"content": {
|
1093
|
+
"text/plain": {
|
1094
|
+
"schema": {
|
1095
|
+
"type": "string",
|
1096
|
+
"example": ""
|
1097
|
+
}
|
1098
|
+
}
|
1099
|
+
}
|
1100
|
+
},
|
1101
|
+
"404": {
|
1102
|
+
"description": "Not Found",
|
1103
|
+
"content": {
|
1104
|
+
"text/plain": {
|
1105
|
+
"schema": {
|
1106
|
+
"type": "string",
|
1107
|
+
"example": ""
|
1108
|
+
}
|
1109
|
+
}
|
1110
|
+
}
|
1111
|
+
},
|
1112
|
+
"500": {
|
1113
|
+
"description": "Internal Server Error - can be raised while attempting to access the external authority OR during processing of results when results are not a valid RDF Format",
|
1114
|
+
"content": {
|
1115
|
+
"text/plain": {
|
1116
|
+
"schema": {
|
1117
|
+
"type": "string",
|
1118
|
+
"example": ""
|
1119
|
+
}
|
1120
|
+
}
|
1121
|
+
}
|
1122
|
+
},
|
1123
|
+
"503": {
|
1124
|
+
"description": "Service Unavailable - can be raised while attempting to access the external authority",
|
1125
|
+
"content": {
|
1126
|
+
"text/plain": {
|
1127
|
+
"schema": {
|
1128
|
+
"type": "string",
|
1129
|
+
"example": ""
|
1130
|
+
}
|
1131
|
+
}
|
1132
|
+
}
|
1133
|
+
}
|
1134
|
+
}
|
1135
|
+
},
|
1136
|
+
"options": {
|
1137
|
+
"summary": "CORS preflight request",
|
1138
|
+
"operationId": "OPTIONS_fetchFromSubauthority",
|
1139
|
+
"tags": [
|
1140
|
+
"Fetch Term"
|
1141
|
+
],
|
1142
|
+
"parameters": [
|
1143
|
+
{
|
1144
|
+
"description": "Name of the authority's configuration file.",
|
1145
|
+
"in": "path",
|
1146
|
+
"name": "vocab",
|
1147
|
+
"required": true,
|
1148
|
+
"schema": {
|
1149
|
+
"default": "loc",
|
1150
|
+
"type": "string"
|
1151
|
+
}
|
1152
|
+
},
|
1153
|
+
{
|
1154
|
+
"description": "Name of the subauthority.",
|
1155
|
+
"in": "path",
|
1156
|
+
"name": "subauthority",
|
1157
|
+
"required": true,
|
1158
|
+
"schema": {
|
1159
|
+
"default": "names",
|
1160
|
+
"type": "string"
|
1161
|
+
}
|
1162
|
+
},
|
1163
|
+
{
|
1164
|
+
"description": "The URI for the term being retrieved.",
|
1165
|
+
"in": "path",
|
1166
|
+
"name": "id",
|
1167
|
+
"required": true,
|
1168
|
+
"schema": {
|
1169
|
+
"default": "http://id.loc.gov/authorities/names/n92016188",
|
1170
|
+
"type": "string"
|
1171
|
+
}
|
1172
|
+
}
|
1173
|
+
],
|
1174
|
+
"responses": {
|
1175
|
+
"204": {
|
1176
|
+
"description": "Perform CORS preflight for fetching a term from a subauthority in an authority",
|
1177
|
+
"headers": {
|
1178
|
+
"Access-Control-Allow-Origin": {
|
1179
|
+
"description": "CORS header will be * if CORS headers are enabled",
|
1180
|
+
"schema": {
|
1181
|
+
"type": "string"
|
1182
|
+
}
|
1183
|
+
},
|
1184
|
+
"Access-Control-Allow-Methods": {
|
1185
|
+
"description": "Indicates which method a future CORS request to the same resource might use.",
|
1186
|
+
"schema": {
|
1187
|
+
"type": "string"
|
1188
|
+
}
|
1189
|
+
}
|
1190
|
+
},
|
1191
|
+
"content": {
|
1192
|
+
"text/plain": {
|
1193
|
+
"schema": {
|
1194
|
+
"type": "string",
|
1195
|
+
"example": ""
|
1196
|
+
}
|
1197
|
+
}
|
1198
|
+
}
|
1199
|
+
},
|
1200
|
+
"501": {
|
1201
|
+
"description": "OPTIONS action is not implement when CORS headers are not enabled",
|
1202
|
+
"content": {
|
1203
|
+
"text/plain": {
|
1204
|
+
"schema": {
|
1205
|
+
"type": "string",
|
1206
|
+
"example": ""
|
1207
|
+
}
|
1208
|
+
}
|
1209
|
+
}
|
1210
|
+
}
|
1211
|
+
}
|
1212
|
+
}
|
1213
|
+
}
|
1214
|
+
},
|
1215
|
+
"components": {
|
1216
|
+
"schemas": {
|
1217
|
+
"linked_data_authorities_list_result": {
|
1218
|
+
"type": "array",
|
1219
|
+
"items": {
|
1220
|
+
"type": "string"
|
1221
|
+
}
|
1222
|
+
},
|
1223
|
+
"linked_data_query_results": {
|
1224
|
+
"type": "array",
|
1225
|
+
"items": {
|
1226
|
+
"required": [
|
1227
|
+
"id",
|
1228
|
+
"uri",
|
1229
|
+
"label"
|
1230
|
+
],
|
1231
|
+
"properties": {
|
1232
|
+
"id": {
|
1233
|
+
"type": "string"
|
1234
|
+
},
|
1235
|
+
"uri": {
|
1236
|
+
"type": "string"
|
1237
|
+
},
|
1238
|
+
"label": {
|
1239
|
+
"type": "string"
|
1240
|
+
},
|
1241
|
+
"context": {
|
1242
|
+
"type": "object"
|
1243
|
+
}
|
1244
|
+
}
|
1245
|
+
}
|
1246
|
+
},
|
1247
|
+
"linked_data_term_json_result": {
|
1248
|
+
"required": [
|
1249
|
+
"id",
|
1250
|
+
"uri",
|
1251
|
+
"label"
|
1252
|
+
],
|
1253
|
+
"properties": {
|
1254
|
+
"id": {
|
1255
|
+
"type": "string"
|
1256
|
+
},
|
1257
|
+
"uri": {
|
1258
|
+
"type": "string"
|
1259
|
+
},
|
1260
|
+
"label": {
|
1261
|
+
"type": "string"
|
1262
|
+
},
|
1263
|
+
"altlabel": {
|
1264
|
+
"type": "array",
|
1265
|
+
"items": {
|
1266
|
+
"type": "string"
|
1267
|
+
}
|
1268
|
+
},
|
1269
|
+
"broader": {
|
1270
|
+
"type": "array",
|
1271
|
+
"items": {
|
1272
|
+
"type": "string"
|
1273
|
+
}
|
1274
|
+
},
|
1275
|
+
"narrower": {
|
1276
|
+
"type": "array",
|
1277
|
+
"items": {
|
1278
|
+
"type": "string"
|
1279
|
+
}
|
1280
|
+
},
|
1281
|
+
"sameas": {
|
1282
|
+
"type": "array",
|
1283
|
+
"items": {
|
1284
|
+
"type": "string"
|
1285
|
+
}
|
1286
|
+
},
|
1287
|
+
"predicates": {
|
1288
|
+
"type": "object",
|
1289
|
+
}
|
1290
|
+
}
|
1291
|
+
},
|
1292
|
+
"linked_data_term_jsonld_result": {
|
1293
|
+
"required": [
|
1294
|
+
"@context",
|
1295
|
+
"@graph"
|
1296
|
+
],
|
1297
|
+
"properties": {
|
1298
|
+
"@context": {
|
1299
|
+
"type": "object"
|
1300
|
+
},
|
1301
|
+
"@graph": {
|
1302
|
+
"type": "object"
|
1303
|
+
}
|
1304
|
+
}
|
1305
|
+
}
|
1306
|
+
}
|
1307
|
+
},
|
1308
|
+
"tags": [
|
1309
|
+
{
|
1310
|
+
"name": "Authority Management",
|
1311
|
+
"description": "Services managing all authorities."
|
1312
|
+
},
|
1313
|
+
{
|
1314
|
+
"name": "Search Query",
|
1315
|
+
"description": "Services sending a search query to an authority to retrieve multiple results."
|
1316
|
+
},
|
1317
|
+
{
|
1318
|
+
"name": "Fetch Term",
|
1319
|
+
"description": "Services to fetch a single term from an authority."
|
1320
|
+
}
|
1321
|
+
]
|
1322
|
+
}
|