gbv / cocoda-sdk

SDK for Cocoda and coli-conc services
https://gbv.github.io/cocoda-sdk/
MIT License
5 stars 1 forks source link

LabelSearchSuggestionProvider: Fallback to broader concept(s) if no results are found #53

Closed stefandesu closed 1 year ago

stefandesu commented 1 year ago

In LabelSearchSuggestionProvider, we could add a fallback to the broader concepts' labels if there are no results. This would improve utility of the suggestions since sometimes the concept itself is too specific for the target vocabulary.

Example: GND "Fußball" is too specific for BK. But its broader term "Ballspiel" occurs as an alternative label for BK 76.14 Sportspiele which would be the right target concept if you wanted to create a mapping.

This could be extended to iterate over all ancestors (for classifications), but for now, I'd only use broader concepts.

stefandesu commented 1 year ago

Note that the labels of broader concepts need to be loaded in order for this to work. Currently in Cocoda, since the broader concepts are loaded asynchronously, the first try will lead to no results, but in the second try (by default after 10 seconds) it will use the broader concepts since they'll be loaded. I guess that's good enough for now.