Closed acka47 closed 6 years ago
In resources and organisations we have a customizable suggestions format that works well with the jQuery autocomplete widget. For consistency, I think we should use the same format in authorities too.
Actual suggestions should include useful GND-specific labels, see https://github.com/hbz/lobid-gnd/issues/7#issuecomment-329107362: search?q=preferredName:Goethe+AND+variantName:Goethe&format=json:preferredName,dateOfBirth,dateOfDeath,professionOrOccupation.preferredName
The suggestions should be used in the search UI and be documented in the API page.
+1
In https://github.com/lobid/lodmill/issues/801#issuecomment-327780679, @jschnasse wrties how he uses the 1.x API for auto suggestion.
See http://ws.gbv.de/suggest/gnd/ for another GND autocomplete API. We should better agree on a common API (request and response format).
GBV uses OpenSearch Suggestions format, lobid uses JSON arrays with objects having three keys label
, id
, category
. For response with label
being a plain string (depends on the query) both formats can losslessly be converted into each other. We could add a query parameter to select response format for compatibility.
See http://ws.gbv.de/suggest/gnd/ for another GND autocomplete API. We should better agree on a common API (request and response format).
@nichtich So the idea here would be that API users could use both APIs without code changes or specific code? Like setting up the other API as a fallback if the main API is down?
@acka47 Deployed to test.
Enabled for search UI: https://test.lobid.org/gnd/search
API documentation: https://test.lobid.org/gnd/api#auto-complete
I tried it out [and edited this comment after a longer talk with @fsteeg].
preferredName
and variantName
so that I get feedback with every key I hitid
query but it isn't send. The best thing would be to directly go to the entry page skipping the result list with one entry.Deployed to test, with some changes to https://github.com/hbz/lobid-gnd/issues/6#issuecomment-389775128, some of which we discussed offline:
API sample: https://test.lobid.org/gnd/search?q=Twain&format=json:suggest
Enabled for search UI: https://test.lobid.org/gnd
API documentation: https://test.lobid.org/gnd/api#auto-complete
This is much better. Two minor things:
*
in the beginning.)Deployed to test: https://test.lobid.org/gnd/search?q=Twain&format=json:suggest
I think it would be good to also show the birth date like "1889-1951"
Implemented like in the result list, with 1889-
if we only have the birth date.
I think we should only show the most general or the most specific type.
Using sub types only, keeping top level types only if we have no sub types.
+1 - looks already very good. I will give it a try.
Maybe add a ; charset=utf-8
to your content-type
header.
+1 This is really very nice now! And the ranking has already improved a lot due to the recent adjustments so that I think we don't have to change that much. The suggestions could come quicker, though, but this will hopefully be the case when we finally get the SSDs...
Maybe add a ; charset=utf-8 to your content-type header
Oh, interesting. I'm actually setting it, but Play 2.6 removes it, because by spec, application/json
takes no charset, see note at the bottom of https://www.iana.org/assignments/media-types/application/json (clients are expected to check the content to determine which Unicode encoding is used, see section 3 in https://tools.ietf.org/html/rfc4627).
See also: https://groups.google.com/d/msg/play-framework/9FESgLrycAQ/XRCv82euBQAJ
wow - I'm only mentioning it because my firefox insists to use "western" as encoding which results in an "umlaut problem". I don't think it is a serious problem, it only occurs when calling format=json:suggest
directly from browser.
my firefox insists to use "western" as encoding which results in an "umlaut problem".
Yes I also noticed broken umlauts yesterday when looking at the JSON in mobile Safari. In Firefox (60.0) it works fine for me. Maybe it's an issue with some JSON plugin you're using? So obviously there are clients that don't handle the UTF-8 default for JSON correctly, but I also think it's OK to leave it like this.
@nichtich, we now have deployed this for lobid-gnd similarly to how we did it with the other lobid services. Re. additionally offering a standard way for auto-suggest, we can continue the discussion in #106.
Copied from https://github.com/lobid/lodmill/issues/468, originally opened by @nichtich. We should consider this for the new implementation of GND lookup. (I think, @jschnasse also mentioned this.)