v2.2.0
Actions Required to Upgrade
You do not need to take any actions to start using this release of questioning authority. It is backward compatible. There are steps to take if you want to use the new reload action. See the instructions below.
Optional New Functionality
Extended linked data API
list
List the installed linked data authorities.
Usage
http://localhost:3000/qa/list/linked_data/authorities
returns json
[
"AGROVOC",
"LOC",
"OCLC_FAST"
]
NOTE: The above list are authorities supplied with QA. Additional configurations that work with the linked data module of QA can be copied from LD4P Linked Data Authorities. The README of that project provides directions of how to install the configs in your app.
reload
To make use of the new linked data authorities reload
action, you will need to configure an auth_token. This limits who can take this action.
Enabling in an existing app
- copy
/lib/qa/install/templates/config/initializers/qa.rb
to/config/initializers/qa.rb
(optional, copy only if you have not already copied this file to your app) - edit this file and uncomment the line setting
config.authorized_reload_token
and changeYOUR_AUTH_TOKEN_DEFINED_HERE
to the value you want to use for the auth token
Enabling in a new app
- run
rails generate qa:install
- edit this file and uncomment the line setting
config.authorized_reload_token
and changeYOUR_AUTH_TOKEN_DEFINED_HERE
to the value you want to use for the auth token
Usage
http://localhost:3000/qa/reload/linked_data/authorities?auth_token=YOUR_AUTH_TOKEN
returns the updated list of authorities as json if successful
[
"AGROVOC",
"LOC",
"OCLC_FAST"
]
fetch
This is the same as the existing show
action except the URI is passed as a parameter instead of as part of the path.
Usage
- show: http://localhost:3000/qa/show/linked_data/locgenres_ld4l_cache/http%3A%2F%2Fid%2Eloc%2Egov%2Fauthorities%2FgenreForms%2Fgf2011026141
- fetch: http://localhost:3000/qa/fetch/linked_data/locgenres_ld4l_cache?uri=http://id.loc.gov/authorities/genreForms/gf2011026141
NOTES:
- The reason for supporting both actions is that some browsers will convert the encoded %2E back into a period which fails when attempting to request a term through a browser.
- The examples use the locgenres_ld4l_cache authority which is not part of the QA engine. None of the included authorities are configured to request a term by URI. The locgenres_ld4l_cache_authority can be copied into
/config/authorities/linked_data
to use the example show and fetch requests.
Return json-ld for a single term
For linked data, you can select to have the term data returned as normalized json (default for backward compatibility) or as json-ld. To get data as json-ld, append ?format=jsonld
to a show
or fetch
API call.
Usage
- show: http://localhost:3000/qa/show/linked_data/locgenres_ld4l_cache/http%3A%2F%2Fid%2Eloc%2Egov%2Fauthorities%2FgenreForms%2Fgf2011026141?format=jsonld
- fetch: http://localhost:3000/qa/fetch/linked_data/locgenres_ld4l_cache?format=jsonld&uri=http://id.loc.gov/authorities/genreForms/gf2011026141
See NOTES for fetch above to see how to test the example show and fetch requests.