Module: Qa

Extended by:
ActiveSupport::Autoload
Defined in:
app/services/qa/iri_template_service.rb,
lib/qa.rb,
lib/qa/engine.rb,
lib/qa/version.rb,
lib/qa/configuration.rb,
lib/qa/authority_wrapper.rb,
lib/qa/authority_request_context.rb,
app/services/qa/pagination_service.rb,
lib/qa/linked_data/authority_service.rb,
lib/qa/services/rdf_authority_parser.rb,
app/models/qa/iri_template/url_config.rb,
app/models/qa/iri_template/variable_map.rb,
app/models/qa/linked_data/config/helper.rb,
app/controllers/qa/application_controller.rb,
app/services/qa/linked_data/graph_service.rb,
app/services/qa/linked_data/ldpath_service.rb,
app/models/qa/linked_data/config/context_map.rb,
app/services/qa/linked_data/language_service.rb,
app/services/qa/linked_data/deep_sort_service.rb,
app/services/qa/linked_data/authority_url_service.rb,
app/services/qa/linked_data/language_sort_service.rb,
app/services/qa/linked_data/request_header_service.rb,
app/services/qa/linked_data/response_header_service.rb,
app/services/qa/linked_data/performance_data_service.rb,
lib/qa/authorities/local/mysql_table_based_authority.rb,
app/models/qa/linked_data/config/context_property_map.rb,
app/services/qa/linked_data/mapper/graph_mapper_service.rb,
app/services/qa/linked_data/mapper/context_mapper_service.rb,
app/services/qa/linked_data/mapper/graph_ldpath_mapper_service.rb,
app/services/qa/linked_data/mapper/term_results_mapper_service.rb,
app/services/qa/linked_data/mapper/search_results_mapper_service.rb,
app/services/qa/linked_data/mapper/graph_predicate_mapper_service.rb

Overview

Provide service for mapping predicates to object values.

Defined Under Namespace

Modules: ApplicationHelper, Authorities, IriTemplate, LinkedData, Local, Services Classes: ApidocGenerator, ApplicationController, AuthorityRequestContext, AuthorityWrapper, ConfigDirectoryNotFound, Configuration, DataNormalizationError, DiscogsGenerator, Engine, InstallGenerator, InvalidAuthorityError, InvalidConfiguration, InvalidLinkedDataAuthority, InvalidSubAuthority, IriTemplateService, LinkedDataTermsController, MeshTree, MissingSubAuthority, PaginationService, ServiceError, ServiceUnavailable, SubjectMeshTerm, TermNotFound, TermsController, UnsupportedAction, UnsupportedFormat

Constant Summary collapse

VERSION =
"5.14.0".freeze

Class Method Summary collapse

Class Method Details

.authority_for(vocab:, context:, subauthority: nil, try_linked_data_config: true) ⇒ #search, #find

Note:

:try_linked_data_config is included to preserve error message text; something which is extensively tested in this gem.

Returns an authority that will respond to #search and #find; and in some cases #fetch. This is provided as a means of normalizing how we initialize an authority. And to provide a means to request an authority both within a controller request cycle as well as outside of that cycle.

Parameters:

  • vocab (String)
  • subauthority (String) (defaults to: nil)
  • context (#params, #search_header, #fetch_header)
  • try_linked_data_config (Boolean) (defaults to: true)

    when true attempt to check for a linked data authority; this is included as an option to help preserve error messaging from the 5.10.0 branch. Unless you want to mirror the error messages of ‘Qa::TermsController#init_authority` then use the default value.

Returns:

  • (#search, #find)

    an authority that will respond to #search and #find; and in some cases #fetch. This is provided as a means of normalizing how we initialize an authority. And to provide a means to request an authority both within a controller request cycle as well as outside of that cycle.

Since:

  • 5.11.0



97
98
99
100
101
102
# File 'lib/qa.rb', line 97

def self.authority_for(vocab:, context:, subauthority: nil, try_linked_data_config: true)
  authority = build_authority_for(vocab: vocab,
                                  subauthority: subauthority,
                                  try_linked_data_config: try_linked_data_config)
  AuthorityWrapper.new(authority: authority, subauthority: subauthority, context: context)
end

.config {|Qa::Configuration| ... } ⇒ Qa::Configuration

Exposes the Questioning Authority configuration

Yields:

Returns:

See Also:



20
21
22
23
24
25
26
# File 'lib/qa.rb', line 20

def self.config(&block)
  @config ||= Qa::Configuration.new

  yield @config if block

  @config
end

.deprecation_warning(in_msg: nil, msg:) ⇒ Object



28
29
30
31
32
# File 'lib/qa.rb', line 28

def self.deprecation_warning(in_msg: nil, msg:)
  return if Rails.env == 'test'
  in_msg = in_msg.present? ? "In #{in_msg}, " : ''
  warn "[DEPRECATED] #{in_msg}#{msg}  It will be removed in the next major release."
end