Page MenuHomePhabricator

Make Wikibase entities load and initialize lazily
Closed, ResolvedPublic

Description

  • Calling ItemPage.get shouldn't be necessary. When the programmer asks for eg. ItemPage.claims, it should first take a look if the entity has been loaded, and if not, load it. This is what happens when page.text is used.
  • When the entity is loaded using ItemPage.get, all data is loaded and initialized, too. This creates potentially many unused objects in the memory (claims with values and sitelinks with site objects T226157). Let's only initialize those data attributes which the programmer cares about. Eventually, this could be more granular (eg. per property initialization).
    • However, ItemPage.get is supposed to return a dictionary with all the data initialized. For backwards compatibility, it should become a "view" which will encapsulate all the above.

Related Objects

StatusSubtypeAssignedTask
ResolvedAmire80
DeclinedNone
ResolvedAddshore
ResolvedLokal_Profil
OpenNone
OpenNone
OpenFeatureNone
DeclinedKeegan
DeclinedKeegan
InvalidNone
ResolvedLokal_Profil
OpenFeatureNone
Openmatej_suchanek
ResolvedXqt
ResolvedXqt
ResolvedXqt
OpenNone
Openmatej_suchanek
Resolvedmatej_suchanek

Event Timeline

Change 626640 had a related patch set uploaded (by Matěj Suchánek; owner: Matěj Suchánek):
[pywikibot/core@master] [IMPR] Load entities when necessary

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

Change 626640 merged by jenkins-bot:
[pywikibot/core@master] [IMPR] Load entities when necessary

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

Xqt assigned this task to matej_suchanek.
Xqt added a subscriber: Xqt.

Not completely solved. See WikibaseEntity.get().

Change 660809 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [IMPR] Create a SiteLink with getitem method

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

Xqt triaged this task as High priority.

Change 660809 merged by jenkins-bot:
[pywikibot/core@master] [IMPR] Create a SiteLink with getitem method

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