Page MenuHomePhabricator

Wikidata Lexeme pages does not seperate between identifiers and other statements
Closed, ResolvedPublic3 Estimated Story PointsBUG REPORT

Description

Problem:
Item pages sort statements under either the "Statements" header or the "Identifier" header. Lexeme pages, however, shows all statements under "statements".
We want external identifier statements on Lexemes to be put into their own section as well.

Example:
Example of an identifier statement being sorted under "Statements": https://www.wikidata.org/wiki/Lexeme:L240073#P8478

Acceptance criteria:

  • External identifier statements on Lexemes are sorted into a section called "Identifiers".
  • The Identifiers section is sorted below the main Lexeme statements and above the Senses section.

Notes:

  • This only applies for external identifiers on the Lexeme-level. We leave identifiers on Forms and Senses untouched for now.
  • On Item pages this section is achieved using a config setting. The same should be done on Lexeme pages.

Event Timeline

I agree that we should do this yeah.

Do we have the same magic in place for Lexeme pages as for Item pages to create new sections or would we need to introduce this completely from scratch?

I think there’s two issues here, and hopefully neither of them is too hard to solve. The first is that statement sections are configured by entity type, and we haven’t configured any for lexemes:

InitialiseSettings.php
'wmgWikibaseRepoStatementSections' => [
	'default' => [],
	'wikidatawiki' => [
		'item' => [
			'statements' => null,
			'identifiers' => [
				'type' => 'dataType',
				'dataTypes' => [ 'external-id' ],
			],
		],
		'property' => [
			'statements' => null,
			'constraints' => [
				'type' => 'propertySet',
				'propertyIds' => [ 'P2302' ],
			],
		],
	],

If we add a config for lexemes there, I think it should work, because LexemeView already uses the StatementSectionsView class. The other issue is that SensesView and FormsView, on the other hand, don’t use this class, but instead use the underlying StatementGroupListView directly; if we want sections to work in senses and forms, we’d need to fix that, I think.

I think moving them to a separate sections for the Lexeme level is already a good step if that's just a matter of configuration.
Do we have a sense of how many identifiers we even have on Forms and Senses compared to the Lexeme level?

No idea… I can’t think of a way to efficiently query for it, either. (I can provide a lower bound of 168586 external identifiers on lexeme pages overall, from SELECT COUNT(*) FROM pagelinks WHERE pl_from_namespace = 146 AND pl_namespace = 120 AND pl_title IN (SELECT page_title FROM pagelinks JOIN page ON pl_from = page_id WHERE pl_from_namespace = 120 AND pl_namespace = 0 AND pl_title = 'Q19847637');, i.e. the number of links from the Lexeme namespace to Property pages that themselves link to Wikidata property for an identifier; that only covers ~1.5k of ~7.4k external identifier properties, though.)

Gotcha. Thanks!
Ok then let's start with the separation on the Lexeme-level. I'll adjust the task accordingly and put it in the backlog.

karapayneWMDE set the point value for this task to 3.Oct 18 2022, 9:49 AM

Hey there. Just wanted to confirm that no UX support is required to fulfill this task. My assumption is that Lexeme identifiers would be visualized in the same way that Item identifiers are:

Screenshot 2022-11-09 at 14.52.08.png (848×1 px, 88 KB)

Is that correct, or are there any peculiarities to consider that might impact how ID information is displayed?

Yes that's how I was thinking about it.

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

[operations/mediawiki-config@master] Separate identifiers from other statements for Lexemes

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

Change 855609 merged by jenkins-bot:

[operations/mediawiki-config@master] Separate identifiers from other statements for Lexemes

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

Mentioned in SAL (#wikimedia-operations) [2022-11-14T14:05:02Z] <taavi@deploy1002> Started scap: Backport for [[gerrit:855609|Separate identifiers from other statements for Lexemes (T318310)]]

Mentioned in SAL (#wikimedia-operations) [2022-11-14T14:05:23Z] <taavi@deploy1002> taavi and migr: Backport for [[gerrit:855609|Separate identifiers from other statements for Lexemes (T318310)]] synced to the testservers: mwdebug1001.eqiad.wmnet, mwdebug2001.codfw.wmnet, mwdebug2002.codfw.wmnet, mwdebug1002.eqiad.wmnet

Mentioned in SAL (#wikimedia-operations) [2022-11-14T14:11:29Z] <taavi@deploy1002> Finished scap: Backport for [[gerrit:855609|Separate identifiers from other statements for Lexemes (T318310)]] (duration: 06m 27s)

Has been deployed. Note that a page needs to be purged or have its parser cache otherwise invalidated in order to see the change.