Skip to content

Commit

Permalink
Merge pull request #83 from LD4P/wikidata-search-fix
Browse files Browse the repository at this point in the history
Just return term list in wikidata search response
  • Loading branch information
sfolsom authored Nov 29, 2023
2 parents f3f350b + dad999b commit 1ad6aa0
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions app/authorities/qa/authorities/wikidata/generic_authority.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,9 @@ def build_query_url(q)
# @note WARNING: If this is moved to QA, it should NOT return json with results: and response_header: keys
# unless code is put in place to process a request for the response_header data.
def parse_authority_response(raw_response)
formatted_response = raw_response['search'].map do |doc|
raw_response['search'].map do |doc|
{ id: doc['id'], uri: doc['concepturi'], label: doc['label'], context: extended_context(doc) }
end
{
results: formatted_response,
response_header: {
start_record: 1,
requested_records: "UNKNOWN",
retrieved_records: raw_response.count,
total_records: "UNKNOWN"
}
}
end

def extended_context(doc)
Expand Down

0 comments on commit 1ad6aa0

Please sign in to comment.