Skip to content

Releases: samvera/questioning_authority

v5.9.0

27 Jul 16:27
5683824
Compare
Choose a tag to compare

v5.8.1

07 Feb 17:38
Compare
Choose a tag to compare
  • Revert "wrap initialization in reloader.to_prepare to avoid autoload deprecation warning in some cases" #350

See Issue #351 which describes the reason for the revert and the need to still address the underlying issue.

This release fixes an issue in Hyrax where QA 5.8.0 was preventing Hyrax from fully loading during application startup.

v5.8.0

04 Feb 13:12
Compare
Choose a tag to compare

Steps to update

bundle update qa

No additional steps are required.

Notable changes

  • Faraday gem is temporarily pinned to < 2.0. Additional work is required to support v2.0.
  • New feature: Pagination (see details below)

New features

Pagination (optional)

NOTE: For backward compatibility, if new parameters are not passed in with the request, the pagination information is not returned as part of the result.

When used, pagination requests and results follow the JSON API standard.

References:

To request pagination

Request Parameter Default Possible Values Description
format :json | :jsonapi see rules below if :json, return values as [Array<Hash>]; if :jsonapi, return as [Hash] following JSON API standard
page_offset positive integer < total number of results 11 1
page_limit positive integer > 0 5 see rules below

Rules for default format:

  • :json - if none of the new parameters are included
  • :json - if a valid value for format (e.g. :json | :jsonapi) is not specified
  • :jsonapi - if either page_offset or page_limit is specified

Rules for default page_limit:

  • all results - if none of the new parameters are included
  • all results - if only new parameter format=:json is included
  • otherwise, 10

Results for :json

Example:

[
    { "id": "1", "label": "term 1" },
    { "id": "2", "label": "term 2" },
    ...
    { "id": "10", "label": "term 10" }
]

Results for :jsonapi

Example:

{
  "data": [
    { "id": "1", "label": "term 1" },
    { "id": "2", "label": "term 2" },
    ...
    { "id": "10", "label": "term 10" }
  ],
  "meta": {
    "page": {
      "page_offset": "1",
      "page_limit": "10",
      "actual_page_size": "10",
      "total_num_found": "28",
    }
  }
  "links": {
    "self_url": "http://example.com/qa/search/local/states?q=new&format=json-api&page_limit=10&page_offset=1",
    "first_url": "http://example.com/qa/search/local/states?q=new&format=json-api&page_limit=10&page_offset=1",
    "prev_url": nil,
    "next_url": "http://example.com/qa/search/local/states?q=new&format=json-api&page_limit=10&page_offset=11",
    "last_url": "http://example.com/qa/search/local/states?q=new&format=json-api&page_limit=10&page_offset=21"
  }
}

See more examples in the documentation of the #build_response method.

How page_offset is calculated for pagination links

expected page boundaries

Expected page boundaries are always calculated starting from page_offset=1
and the current page_limit. The page boundaries will include the page_offsets
that cover all results. For example, page_limit=10 with 36 results will have
page boundaries 1, 11, 21, 31.

self url
  • The self url always has the page_offset for the current page, which defaults
    to 1 if not passed in.
first page url
  • The first page url always has page_offset=1.
last page url
  • The last page url always has page_offset equal to the last of the expected page
    boundaries regardless of the passed in page_offset. For the example where
    page_limit=10 with 36 results, the last page will always have page_offset=31.
prev page url
  • Previous' page_offset is calculated from the passed in page_offset whether or
    not it is on an expected page boundary.

  • For prev, page_offset = passed in page_offset - page_limit || nil if calculated as < 1

    • when current page_offset (e.g. 1) is less than page_limit (e.g. 10), then page_offset
      for prev will be nil (e.g. 1 - 10 = -9 which is < 1)
    • when current page_offset is an expected page boundary (e.g. 21), then
      page_offset for prev will also be a page boundary (e.g. 21 - 10 = 11
      which is an expected page boundary)
    • when current page_offset is not on an expected page boundary (e.g. 13), then
      page_offset for prev will not be on an expected page boundary (e.g. 13 - 10 = 3
      which is not an expected page boundary)
next page url
  • Next's page_offset is calculated from the passed in page_offset whether or
    not it is on an expected page boundary.

  • For next, page_offset = passed in page_offset + page_limit || nil if calculated > total number of results found

    • when current page_offset (e.g. 31) is greater than total number of results (e.g. 36),
      then page_offset for next will be nil (e.g. 31 + 10 = 41 which is > 36)
    • when current page_offset is an expected page boundary (e.g. 21), then
      page_offset for next will also be a page boundary (e.g. 21 + 10 = 31
      which is an expected page boundary)
    • when current page_offset is not on an expected page boundary (e.g. 13), then
      page_offset for next will not be on an expected page boundary (e.g. 13 + 10 = 23
      which is not an expected page boundary)

Change Log

Full Changelog: v5.7.0...v5.8.0

Merged pull requests:

  • wrap initialization in reloader.to_prepare to avoid autoload deprecation warning in some cases #349 (jrochkind)
  • add pagination service for non-linked data authorities following jsonapi standard #348 (elrayle)
  • temporarily pin Faraday gem to < 2.0 #347 (elrayle)

v5.7.0

04 Nov 15:49
Compare
Choose a tag to compare

Steps to update

bundle update qa

No additional steps are required.

New features

Include URI in results

You can include a URI as part of the term attributes in yml defined local authorities.

:terms:
    - :id: A1
      :term: My Term Label
      :uri: http://my.domain/terms/a1

Search for q=My Term will return results...

[ { "id": "A1", "term": "My Term Label", "uri": "http://my.domain/terms/a1" } ]

Use fetch for IDs that are URIs

You can find a term by URI when the term ID is a URI.

If config/authorities/my_terms.yml has...

:terms:
    - :id: http://my.domain/terms/a1
      :term: My Term Label
      :uri: http://my.domain/terms/a1

You can fetch a term using...

http://localhost/qa/fetch/local/my_terms?uri=http://my.domain/terms/a1

Changelog

Full Changelog

Closed issues:

  • RENAME: Update CONTRIBUTING.md to match the maintenance template #340
  • RENAME: Add language to README about branch naming #337
  • RENAME: Add Circle CI step that fails if branch name is master #336
  • RENAME master branch to main #335
  • Rails 6.0? #287

Merged pull requests:

  • add fetch action allowing for uri parameter #343 (elrayle)
  • add optional URI to locally defined yml file authorities #342 (elrayle)
  • Update CONTRIBUTING.md to match the maintenance template #341 (elrayle)
  • prevent master branch; provide info on branch naming in README #339 (elrayle)

v5.6.0

11 Jan 18:51
Compare
Choose a tag to compare

The only update in this release is the support of Rails 6.1. This did not require code changes.

NOTE: One of the commits states that it allows for Rails 6.2 and is recorded automatically in the CHANGELOG. This is incorrect. It allows for use with Rails 6.1

v5.5.2

08 Dec 15:47
Compare
Choose a tag to compare

Full Changelog

Closed issues:

  • OCLC_FAST linked data connection times out #327
  • generated sample URL has extra parameters #326

Merged pull requests:

  • do not overwrite passed in replacements hash #329 (elrayle)
  • encode query for linked data access to OCLC FAST #328 (elrayle)

v5.5.1

14 Aug 16:58
Compare
Choose a tag to compare

Adjust URLs for Library of Congress

Although the main API URLs switched to https, the URLs passed as parameters to identify subauthority, vocabulary, etc. continue to use http. This release reinstates these URLs back to http while keeping the API URLs using https.

v4.3.0

14 Aug 17:48
Compare
Choose a tag to compare

REQUIRED UPDATE for sites using QA for accessing Library of Congress


This release addresses a change in the Library of Congress API URL to use https instead of http. Update to this release to restore access to Library of Congress.


Backport from v5.5.1 fix for LOC change to use https for API.

Ref:

  • PR #321 - Changes LoC authorities to use https
  • PR #323 - Fixes issue limiting LoC results to an authority

v3.1.0

14 Aug 17:57
Compare
Choose a tag to compare

REQUIRED UPDATE for sites using QA for accessing Library of Congress


This release addresses a change in the Library of Congress API URL to use https instead of http. Update to this release to restore access to Library of Congress.


Backport from v5.5.1 fix for LOC change to use https for API.

Ref:

  • PR #321 - Changes LoC authorities to use https
  • PR #323 - Fixes issue limiting LoC results to an authority

v2.3.0

14 Aug 17:57
868237c
Compare
Choose a tag to compare

REQUIRED UPDATE for sites using QA for accessing Library of Congress


This release addresses a change in the Library of Congress API URL to use https instead of http. Update to this release to restore access to Library of Congress.


Backport from v5.5.1 fix for LOC change to use https for API.

Ref:

  • PR #321 - Changes LoC authorities to use https
  • PR #323 - Fixes issue limiting LoC results to an authority