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
Closes T383631