Skip to content

Implement built-in Z6930/Find lexemes for a Wikidata item

This MR is driven by T383631, which is implemented by findLexemesForItem at the end of db.js. findLexemesForItem depends on retrieveWikidataEntities, and uses its results without converting them into ZObjects. When T271776 is completed, this dependency will no longer exist, but retrieveWikidataEntities will continue to be used by dereferenceWikidataEntities.

In future we could consider caching the raw JSON returned from retrieveWikidataEntities, but at present this does not appear to be warranted.

If we find out retrieveWikidataEntities will frequently be fetching > 50 entities at a time, we might consider a further optimization in which the promises are constructed in fetchWikidataEntities instead of retrieveWikidataEntities, and arrange it so that each promise result can start to be used sooner.

Renamed findRelatedEntities to findEntitiesByStatements; Renamed retrieveWikidataEntity to retrieveWikidataEntityFromLODAPI; Renamed fetchWikidataEntity to fetchWikidataEntityFromLODAPI; Renamed fetchWikidataEntities to fetchWikidataEntitiesFromLODAPI; Added retrieveWikidataEntities & fetchWikidataEntities & dereferenceWikidataEntities; Added findEntitiesByStatements & findLexemesForItem; Added throwInvalidJsonError & conversionFunctionForWikidataID

Bug: T383631 Bug: T383644

Closes T383631

Edited by David Martin

Merge request reports

Loading