Skip to content

Understanding Existing Authorities

E. Lynette Rayle edited this page Mar 4, 2019 · 1 revision

Support Classes

Base

Qa::Authorities::Base

  • defines the abstract interface with methods
    • all
    • find(id)

WebServiceBase

Qa::Authorities::WebServiceBase

  • defines json(url) which calls response(url) and parses the response with JSON.parse(response)
  • defines response(url) which uses Faraday to request a response from the url
  • defines attr_accessor :raw_response (which is not set by either json or response methods)

Authorities

Assign Fast (aka OCLC FAST)

Qa::Authorities::AssignFast

  • extend AuthorityWithSubAuthority
  • extend AssignFastSubauthority
  • requires lib/qa/authorities/assign_fast/generic_authority
  • defines subauthority_for which creates an instance of Qa::Authorities::AssignFast::GenericAuthority for the requested subauthority

Qa::Authorities::AssignFastSubauthority

  • defines subauthorities which returns an array of supported subauthorities
  • converts English subauthority name into the required subauthority code to use in the request URL

Qa::Authorities::AssignFast::GenericAuthority

  • inherits from Base
  • includes WebServiceBase
  • defines attr_reader :subauthority with @subauthority set in initialize(subauthority) method
  • search
    • defines search(q) which uses WebServiceBase's json(url) method to access the authority
    • defines build_query_url(q) used by search(q)
    • defines private parse_authority_response(raw_response) used by search(q)
    • defines response(url) which overrides WebServiceBase's response(url)

NOT SUPPORTED

  • list terms
  • fetch term (unclear whether or not this works; couldn't locate the find method)

Geonames

Qa::Authorities::Geonames

  • inherits from Base
  • includes WebServiceBase
  • search
    • defines search(q) which uses WebServiceBase's json(url) method to access the authority
    • defines build_query_url(q) used by search(q)
    • defines private parse_authority_response(response) used by search(q)
  • find
    • defines find(id) which uses WebServiceBase's json(url) method to access the authority
    • defines find_url(id) used by find(id)

NOT SUPPORTED

  • list terms

Getty

TBD

LOC

Qa::Authorities::Loc

  • extend AuthorityWithSubAuthority
  • extend LocSubauthority
  • requires lib/qa/authorities/loc/generic_authority
  • defines subauthority_for which creates an instance of Qa::Authorities::Loc::GenericAuthority for the requested subauthority
  • defines subauthorities which returns an array of supported subauthority names

Qa::Authorities::LocSubauthority

  • defines multiple sets of subauthorities and determins the base_url to use based on the type of subauthority

Qa::Authorities::Loc::GenericAuthority

  • inherits from Base
  • includes WebServiceBase
  • defines attr_reader :subauthority with @subauthority set in initialize(subauthority) method
  • search
    • defines search(q) which uses WebServiceBase's json(url) method to access the authority & setting @raw_response
    • defines build_query_url(q) used by search(q)
    • defines private parse_authority_response used by search(q) and using @raw_response as the response instead of passing it in
    • defines additional private methods for parsing
    • defines response(url) which overrides WebServiceBase's response(url)
  • find
    • defines find(id) which uses WebServiceBase's json(url) method to access the authority
    • defines find_url(id) used by find(id)

NOT SUPPORTED

  • list terms

MeSH

TBD

Clone this wiki locally