Page MenuHomePhabricator

Implement FallbackLabelDescriptionLookup that supports federated properties
Closed, ResolvedPublic

Description

CachingFallbackLabelDescriptionLookup doesn’t support federated properties, because they don’t have a working implementation of getLatestRevisionId(). (See T312780 for some more context.) Instead, create a new FallbackLabelDescriptionLookup implementation, which wraps both a LanguageFallbackLabelDescriptionLookup and a CachingFallbackLabelDescriptionLookup (not necessarily requiring these interfaces), and forwards most calls to the Caching one, but calls for federated property IDs to the Language one.

The FallbackLabelDescriptionLookupFactory should return this new class, so that both the factory and its output can be used with any entity type, even if federated properties don’t have a working entity revision lookup yet. (This loses caching for federated properties, but that should be okay; properties can’t be redirects anyways, so that part doesn’t matter.)

Later, this implementation could be removed once there is a working EntityRevisionLookup for federated properties. (It wouldn’t need to support looking up arbitrary entity IDs, only getLatestRevisionId() in fact.)

Event Timeline

We (@Tarrow, @Michael and I) considered making this configurable per entity source and type, via a new entry in the entity type definitions, but I think we agreed in the end that this would be overkill – a simple instanceof FederatedPropertyId check should be okay.

Change 813211 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Introduce DispatchingFallbackLabelDescriptionLookup

https://gerrit.wikimedia.org/r/813211

Change 813212 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Use FallbackLabelDescriptionLookupFactory in property entity types

https://gerrit.wikimedia.org/r/813212

Change 813211 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Introduce DispatchingFallbackLabelDescriptionLookup

https://gerrit.wikimedia.org/r/813211

Change 813212 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Use FallbackLabelDescriptionLookupFactory in property entity types

https://gerrit.wikimedia.org/r/813212