Page MenuHomePhabricator

[EPIC] Display statements made with federated properties on item page
Closed, ResolvedPublic8 Estimated Story Points


As a Wikibase Reader, I want to view statements made about local items using federated properties so that I can read how the item is being described in the statement.

The property label should be displayed for both the federated property used to make the statement, and federated properties used in references added to the statement. In the first version of the MVP, we intend for the property label hyperlink to point to the Wikidata property page.

BDD (Scenario: display property in the statement)
Given a statement about an item has been added using a federated property
When I load the item page
Then the property label is displayed in the statement, including language fallbacks

BDD (Scenario: view details of a property)
Given The local item page displays a statement that was made using a federated property
When I click on the hyperlinked label of the federated property
Then the Wikidata property page opens in my browser according to my default browser behavior

State before work done

image.png (163×910 px, 22 KB)

Related Objects

Event Timeline

Samantha_Alipio_WMDE renamed this task from Display statements made with federated properties on item page to [EPIC] Display statements made with federated properties on item page.Mar 2 2020, 8:34 AM

Start of task breakdown:

  • Document prefetching-term-lookup-callback in
  • Move Item and Property prefetching-term-lookup-callback service wiring from SingleEntitySourceServices into WikibaseRepo.entitytypes.php for items and properties
  • Implement a PrefetchingTermLookup for federated properties
    • ONLY labels to begin with (throw exceptions for aliases and descriptions)
  • Wire PrefetchingTermLookup into prefetching-term-lookup-callback for federated properties

Still to breakdown:

We still need to either alter the current EntityIdLabelFormatter for properties (currently at LabelsProviderEntityIdHtmlLinkFormatter)
OR we need to implement our own EntityIdLabelFormatter that does less stuff and override in the federated property wiring using entity-id-html-link-formatter-callback ( in WikibaseRepo.FederatedProperties.entitytypes.php)

We will schedule a further breakdown to look at the last points
I will write the tickets for the first 4 for the morning!

Another thing that came out of the task creak down was a desire to know what we want to do in the situation with deleted properties.

@Addshore from mattermost

@Samantha Alipio we have some questions about
mainly about what to do when properties are deleted on wikidata right now, what would be the desired outcome (a BDD would be good)
within default wikibase this behaviour is explicitly defined which is display "deleted property" in the same way we see now on the test system.
IT would however be a bit easier to not do that for now (we can always do it later), and instead just show the PropertyID
but ultimately your decision

Regarding the the second BDD and if it is working or not as expected currently...

After a bit of investigation the following seems to be true:

so it leads back to WikibaseValueFormatterBuilders::newEntityIdFormatter

which does newLabelsProviderEntityIdHtmlLinkFormatter

which then in WikbiaseRepo does, new FormatterLabelDescriptionLookupFactory( $this->getTermLookup() ),

figures out where the link plays into that

So, it is the LabelsProviderEntityIdHtmlLinkFormatter that is created in WikibaseValueFormatterBuilders::newLabelsProviderEntityIdHtmlLinkFormatter

So, it should be fixed when we do the story that is in the current sprint

specifically it will be fixed when is done and merged

^^ @Samantha Alipio ^^ not sure how you want to deal with this fun fact