Skip to content

v2.2.0

Compare
Choose a tag to compare
@elrayle elrayle released this 16 Nov 19:43

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 change YOUR_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 change YOUR_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

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

See NOTES for fetch above to see how to test the example show and fetch requests.

Change Log

  • extend linked data API to include the ability to 'list' authorities, 'reload' authorities, and 'fetch' (PR #180)
  • allow fetch of a single linked data term to be returned with format json or jsonld (PR #182)
  • performance and accuracy enhancements to Getty vocabs query (PR #178, PR #181)