Page MenuHomePhabricator

Make the order of Lexeme's grammatical features consistent
Closed, ResolvedPublic8 Estimated Story Points

Description

Main components:

  • Lexeme

User story:
As an editor I want to see a consistent order in the grammatical features of a Form of a Lexeme in order to more easily compare different Forms.

Problem:
Currently the grammatical features of a Form are ordered by the Item ID and there not even numerical but string order (see setGrammaticalFeatures()). This doesn't make much sense for the reader.

Example:
https://www.wikidata.org/wiki/Lexeme:L82714

Screenshots/mockups:

image.png (755Γ—1 px, 56 KB)

BDD
GIVEN a Lexeme page with a Form
AND a list of Item IDs for grammatical features is configured on-wiki by the editors
THEN the grammatical features on the Lexeme page are sorted based on that list

Acceptance criteria:

  • grammatical features on Forms of a Lexeme are always ordered based on a configured list
  • the configuration of the order should happen via a page on-wiki similar to MediaWiki:Wikibase-SortedProperties
  • If a grammatical feature is not in the configured list then we add it at the end of the grammatical features. If there are several we sort those by their Q-ID numerically.
  • The order only affects the display on Lexeme pages, not the stored data

Notes:

  • This order varies by language but we accept that we can only have one order for all languages for now.

Event Timeline

Lydia_Pintscher renamed this task from Lexeme's Grammatical features are created in random order to Order of Lexeme's grammatical features is not consistent.Feb 16 2021, 5:03 PM
Lydia_Pintscher triaged this task as High priority.
Manuel renamed this task from Order of Lexeme's grammatical features is not consistent to Make the order of Lexeme's grammatical features consistent.Oct 6 2021, 8:41 AM

This query for most-used grammatical features might be useful as a starting point for populating the sort order (both on Wikidata and for local development).

Also, note that this reordering should happen at the display level – internally, I think we should continue to store the grammatical features in the same order (by string serialization). It doesn’t make sense to reorder them in the internal JSON each time the interface message is adjusted.

Manuel lowered the priority of this task from High to Medium.Nov 9 2021, 3:27 PM

Change 739131 had a related patch set uploaded (by Noa wmde; author: Noa wmde):

[mediawiki/extensions/WikibaseLexeme@master] Introduce WikiPageItemOrderProvider to Lexeme

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

Change 739131 abandoned by Noa wmde:

[mediawiki/extensions/WikibaseLexeme@master] Introduce WikiPageItemOrderProvider to Lexeme

Reason:

Moving ItemOrderProvider to Wikibase

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

Change 739759 had a related patch set uploaded (by Noa wmde; author: Noa wmde):

[mediawiki/extensions/Wikibase@master] Introduce WikiPageItemOrderProvider

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

Change 742461 had a related patch set uploaded (by Noa wmde; author: Noa wmde):

[mediawiki/extensions/WikibaseLexeme@master] WIP Register service 'WikibaseLexemeGrammaticalFeaturesOrderProvider'

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

Change 739759 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Introduce WikiPageItemOrderProvider

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

Change 742461 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] Register service 'WikibaseLexemeGrammaticalFeaturesOrderProvider'

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

Note: this isn’t feature flagged, so it should roll out with the train early next year.

\o/
What's the page name for configuring it? I'd like to try it on beta or test.