v4.1.0
Actions Required to Upgrade
There are no required actions for this upgrade other than adjusting your gem file to allow for version 4.1.0 to be included by bundler. There are a few recommended steps that apply only if you are accessing linked data authorities. See the New Features section for details.
New Authority
NEW Discogs authority
This is optional and no action is required.
Action is required only if you want to use the Discogs authority. See Connecting to Discogs for usage information on the new Discogs Authority (music database).
New Features
Force ldpath to only use passed context graph
This is recommended, but not required. Action recommended if you access linked data authorities.
The ldpath gem is used to extract primary results and extended context from the results graph. If not told to only use the passed in graph, ldpath will potentially perform multiple network calls for each search result to gather the specificed extended context. This can deteriorate the performance of a search query. It is recommended that the ability to look outside the passed in graph be turned off, and it is off by default.
To configure ldpath's access to external data:
- Edit
/config/initializers/qa.rb
- If this file doesn't exist in your app, you can copy it from /lib/generators/qa/install/templates/config/initializers/qa.rb
- If it exists from an earlier release, you can copy in the new configs by comparing your version of the file to the generator version.
- Uncomment and set the value of
config.limit_ldpath_to_context
. If true, ldpath will not do any additional network calls and will only extract values from the passed in graph (default). If false, ldpath may make additional network calls in an attempt to resolve requested values.
Deprecation of results predicates -- use ldpaths instead:
This is recommended, but not required. Action recommended if you access linked data authorities to avoid deprecation warnings.
For linked data configurations, defining results to extract using predicates is deprecated. Identify results to extract with ldpaths instead.
To address the deprecations, modify all linked data authorities defined in your app at config/authorities/linked_data
. Edit the results:
section of both search and term. Change predicates to ldpaths. Update the prefixes:
section as needed.
Example:
BEFORE
{
"term": {
...
"results": {
"id_predicate": "http://purl.org/dc/terms/identifier",
"label_predicate": "http://www.w3.org/2004/02/skos/core#prefLabel",
"altlabel_predicate": "http://www.w3.org/2004/02/skos/core#altLabel",
"sameas_predicate": "http://schema.org/sameAs"
}
}
...
}
AFTER
{
"prefixes": {
"dcterms": "http://purl.org/dc/terms/",
"skos": "http://www.w3.org/2004/02/skos/core#",
"schema": "http://schema.org/"
},
"term": {
...
"results": {
"id_ldpath": "dcterms:identifier",
"label_ldpath": "skos:prefLabel",
"altlabel_ldpath": "skos:altLabel",
"sameas_ldpath": "schema:sameAs"
}
}
...
}
A similar change needs to be made to "search": -> "results":
.
Language support for linked data requests
This is optional and no action is required.
The linked data processing module has language support. Documentation: Language processing in Linked Data authorities
New in this release is the ability to pass the desired language in the http accept_language header and the ability to set a site wide language preference that is used when the language is not specified another way.
To configure the site wide default:
- Edit
/config/initializers/qa.rb
- If this file doesn't exist in your app, you can copy it from /lib/generators/qa/install/templates/config/initializers/qa.rb
- If it exists from an earlier release, you can copy in the new configs by comparing your version of the file to the generator version.
- Uncomment and set the value of
config.default_language
By default, this is set to:en
. If you want the default to be:en
, then you do not need to take any action.
To use optional performance statistics for linked data requests
This is optional and no action is required.
To get results without performance data, either set performance_data=false
or do not include the parameter on the request.
http://localhost:3000/qa/search/linked_data/oclc_fast?q=sam%20taylor&maximumRecords=1
[
{
"uri":"http://id.worldcat.org/fast/488963",
"id":"488963",
"label":"Taylor, Samuel, 1872-1958"
}
]
To include performance data, append performance_data=true
to the end of search query and term fetch requests.
{
"performance":{
"result_count":1,
"fetch_time_s":0.1253,
"normalization_time_s":0.122574,
"total_time_s":0.24787399999999998
},
"results":[
{
"uri":"http://id.worldcat.org/fast/488963",
"id":"488963",
"label":"Taylor, Samuel, 1872-1958"
}
]
}
To use optional details listing of loaded linked data authorities
This is optional and no action is required.
To view the list of linked data authorities without details, either set details=false
or do not include the parameter on the request.
http://localhost:3000/qa/list/linked_data/authorities
[
"LOC",
"OCLC_FAST"
]
To view the list of linked data authorities and subauthorities, append performance_data=true
to the end authority list request request.
http://localhost:3000/qa/list/linked_data/authorities?details=true
[
{
label: "loc term (QA)",
uri: "urn:qa:term:loc",
authority: "loc",
action: "term"
},
{
"label":"oclc_fast search topic (QA)",
"uri":"urn:qa:search:oclc_fast:topic",
"authority":"oclc_fast",
"subauthority":"topic",
"action":"search",
"language":["en"]
},
{
"label":"oclc_fast search geographic (QA)",
"uri":"urn:qa:search:oclc_fast:geographic",
"authority":"oclc_fast",
"subauthority":"geographic",
"action":"search",
"language":["en"]
},
{
"label":"oclc_fast search event_name (QA)",
"uri":"urn:qa:search:oclc_fast:event_name",
"authority":"oclc_fast",
"subauthority":"event_name",
"action":"search",
"language":["en"]
},
{
"label":"oclc_fast search personal_name (QA)",
"uri":"urn:qa:search:oclc_fast:personal_name",
"authority":"oclc_fast",
"subauthority":"personal_name",
"action":"search",
"language":["en"]
},
{
"label":"oclc_fast search corporate_name (QA)",
"uri":"urn:qa:search:oclc_fast:corporate_name",
"authority":"oclc_fast",
"subauthority":"corporate_name",
"action":"search",
"language":["en"]
},
{
"label":"oclc_fast search uniform_title (QA)",
"uri":"urn:qa:search:oclc_fast:uniform_title",
"authority":"oclc_fast",
"subauthority":"uniform_title",
"action":"search",
"language":["en"]
},
{
"label":"oclc_fast search period (QA)",
"uri":"urn:qa:search:oclc_fast:period",
"authority":"oclc_fast",
"subauthority":"period",
"action":"search",
"language":["en"]
},
{
"label":"oclc_fast search form (QA)",
"uri":"urn:qa:search:oclc_fast:form",
"authority":"oclc_fast",
"subauthority":"form",
"action":"search",
"language":["en"]
},
{
"label":"oclc_fast search alt_lc (QA)",
"uri":"urn:qa:search:oclc_fast:alt_lc",
"authority":"oclc_fast",
"subauthority":"alt_lc",
"action":"search",
"language":["en"]
},
{
"label":"oclc_fast term (QA)",
"uri":"urn:qa:term:oclc_fast",
"authority":"oclc_fast",
"action":"term",
"language":["en"]
}
]
Change Log
- add option to include performance statistics in the returned result for linked data search query and term fetch
- add option to include authority details when getting list of linked data authorities
- add support for main results to be specified as ldpath or predicate (one or the other, not mixed)
- add Discogs authority
- allow language for linked data processing to be specified in the http accept_language header
- Remove support of Rails 5.0
- Add CircleCI Support