netwerk-digitaal-erfgoed / network-of-terms

Search engine for finding terms in terminology sources (such as thesauri, classification systems and reference lists)
https://termennetwerk-api.netwerkdigitaalerfgoed.nl
European Union Public License 1.2
15 stars 3 forks source link

Bug: empty result set if source contains one term #13

Closed sdevalk closed 3 years ago

sdevalk commented 4 years ago

If a source returns just one term, this term is ignored by the TermsTransformer, yielding an empty result set. For example:

./bin/run sources:query --identifiers cht --query rembrandt --loglevel info

The TermsTransformer wrongly assumes that the source contains more terms:

https://github.com/netwerk-digitaal-erfgoed/network-of-terms-comunica/blob/master/src/services/terms.ts#L37

We need to refactor this code a bit. Point of attention: terms arrive in a stream, so we don't know beforehand how many terms there are.

ddeboer commented 3 years ago

This was resolved in #30:

bin/run sources:query --uris https://data.cultureelerfgoed.nl/PoolParty/sparql/term/id/cht --query "rembrandt"
Source Name                  Term URI                                                                          Preferred Labels Alternative Labels
Cultuurhistorische Thesaurus https://data.cultureelerfgoed.nl/term/id/cht/89ce37a3-8bd2-4172-9bff-f95243f72c11 Rembrandtbijbels Rembrandtbijbel