Page MenuHomePhabricator

Avoid calling wbgetentities to get a property's data type
Closed, ResolvedPublic

Description

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 30 2020, 1:36 PM

It looks like we can avoid the extra wbgetentities call in most cases. As far as I can see there are three different cases, only two of which are interesting for us in the federated properties context.

  1. When using the property search field and adding a new statement for a property for which there is no existing statement on the entity we're editing. In this case we can take the data type from the wbsearchentities response.
  2. When adding a new value for an existing statement group on the entity. In this case no wbsearchentities request happens, but we can take the data type from the entity data available on the page.
  3. When using the property suggester (no searching) and adding a new statement for a property for which there is no existing statement on the entity we're editing. In that case no wbsearchentities happens either, but we can just keep making the wbgetentities call in that case. Federated properties is not meant to work with PropertySuggester for now and it will work once we get to wbgetentities.

Proof of concept patch: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/584922

Jakob_WMDE renamed this task from Investigate whether the wbgetentities call can be avoided to get a property's data type to Avoid calling wbgetentities to get a property's data type.Mar 31 2020, 4:04 PM

Change 584922 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/Wikibase@master] Avoid api request for looking up a property's data type

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

This won't work for lexeme sub entities for now because of T249206 but will work fine once wbgetentities is implemented for federated properties.

Change 585493 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/Wikibase@master] PropertyDataTypeStore: Check all existing statement data

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

Change 585753 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/Wikibase@master] Store looked up data types to avoid repeated lookups

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

Change 584922 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] FP: Avoid api request for looking up a property's data type

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

Change 585493 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] FP: PropertyDataTypeStore: Check all existing statement data

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

Change 585753 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] FP: Store looked up data types to avoid repeated lookups

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

Samantha_Alipio_WMDE closed this task as Resolved.Apr 28 2020, 9:16 AM