questioning_authority icon indicating copy to clipboard operation
questioning_authority copied to clipboard

LOC bug when using "--"

Open scande3 opened this issue 11 years ago • 5 comments

Setup / Expected

The documentation gives the following example:

/qa/search/loc/subjects?q=History--

QA then presents this data to you in JSON format:

[
    {"id":"info:lc/authorities/subjects/sh2008121753","label":"History--Philosophy--History--20th century"},
    {"id":"info:lc/authorities/subjects/sh2008121752","label":"History--Philosophy--History--19th century"},
    etc...
]

Actual

The data actually returned is more like the following

[
    {"id":"info:lc/authorities/subjects/sh85111862","label":"Reconstruction (U.S. history, 1865-1877)"},
    {"id":"info:lc/authorities/subjects/sh85061255","label":"History publishing"},
    etc...
    {"id":"info:lc/authorities/subjects/sh85068444","label":"Islamic Empire"},
]

The Issue

A "--" does not seem to be processed correctly. For example, searching for "History Philosophy" will return results more like the first example. As is, about half of the results currently do not contain the word "history" nor any "--". I have no yet done appropriate research into details of this behavior besides noticing it during recent testing.

scande3 avatar Jun 27 '14 14:06 scande3

Related unit test that doesn't work:

it "should be retrieved via search" do
  @authority.search("History--", "subjects")
  @authority.results.first["label"].should == "History--Philosophy--History--20th century"
end

scande3 avatar Jun 27 '14 15:06 scande3

The problem seems to lie with LOC itself. This returns the same result http://id.loc.gov/search/?q=History--&q= However, if you add a wildcard to the query it works: History--* We could automatically append the wildcard to all searches.

awead avatar Jul 17 '14 20:07 awead

We automatically appended the wildcard in the past but that seemed to cause other issues. See the discussion over the removal of the wildcard in pull request #49 . Possibly need some logic to only append it in certain cases? Or make it a setting of some sort?

scande3 avatar Jul 17 '14 20:07 scande3

Ah, thanks for pointing that out... completely forgot about it. I guess I'd lean towards an option to pass via the url or something, as it will vary per authority.

awead avatar Jul 17 '14 21:07 awead

Hi, I saw in the documentation this uri : qa/search/getty/aat?q=amphora do you have the full URL to get this result : {"id":"http://vocab.getty.edu/aat/300198849","label":"Nolan amphorae"}, {"id":"http://vocab.getty.edu/aat/300200366","label":"Panathenaic amphorae"} I try with : http://vocab.getty.edu/qa/search/getty/aat?q=amphora or https://vocab.getty.edu/qa/search/getty/aat?q=amphora but, no result ! Can you help me please ? thank you

miledrousset avatar Jul 25 '19 12:07 miledrousset