Page MenuHomePhabricator

[ES-M3] EntitySchemas shown by label in statements
Closed, ResolvedPublic8 Estimated Story Points

Description

As an editor, I want to easily identify what EntitySchema is being referred to in a statement.

Problem
Currently when statements are made using the new EntitySchema datatype the EntitySchema is only displayed by the ID, making it difficult for user to understand what the EntitySchema is for.

To make EntitySchemas more legible for users, we would like to display them by their label and replicate the format that is used for Items i.e. "Label"

Screenshot
How EntitySchemas are currently displayed in statements:

image.png (365×1 px, 42 KB)

How Items are displayed:

image.png (360×1 px, 27 KB)

BDD
GIVEN an EntitySchema
WHEN it is referred to in a statement
THEN it is shown as "Label"

Acceptance criteria:

  • the EntitySchema is shown with its label when referred to in statements
  • the language of the label follows the UI language

Notes

  • Language fallback will be done for this in T330491

Event Timeline

Random tech notes from me:

  • The current formatting (link with ID as text) happens in EntitySchemaFormatter. We probably want to extend that class to add the label formatting (or potentially split the HTML and plain text cases into separate classes, but that might not be needed).
  • We can probably implement the label lookup the same way we implement the lookup in WikibaseLexeme: just load the whole EntitySchema data and get the label from there. We don’t need to use a more efficient term store until performance becomes too bad (which hasn’t even happened for lexemes yet – we’re still using this inefficient strategy there, as far as I’m aware).
    • But it should at least be in a separate service, not directly in the formatter.
    • [edit] This part also applies to T339921 / T339924 / T339925, I’d say – they should use that same service.
Michael moved this task from Parents/Waiting to Doing on the Wikidata Dev Team (Sprint-∞) board.
Michael subscribed.

I already have a PoC change doing basically exactly that. Might as well extend it to a proper change.

Change 906643 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/EntitySchema@master] Show Labels for EntitySchema values with simple fallback

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

Change 937465 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/EntitySchema@master] Add LabelLookup service

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

Change 937465 merged by jenkins-bot:

[mediawiki/extensions/EntitySchema@master] Add LabelLookup service

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

Change 906643 merged by jenkins-bot:

[mediawiki/extensions/EntitySchema@master] Show Labels for EntitySchema values in Statements

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

Amazing!

Looks great, thanks so much :)