Page MenuHomePhabricator

Lua function to get Lemma of a Lexeme
Open, NormalPublic

Description

As a template editor I want to be able to access the Lemma(s) of a Lexeme in order to show a meaningful representation instead of just an ID to the user.
In order to be able to reference a Lexeme in wiki text and show its Lemma we should have a Lua function that takes a Lexeme ID and returns the Lemma of that Lexeme.

Example:
for example mw.wikibase.getLemmas( lexemeId ) would return a table (indexed by language codes) holding tables consisting of the language + the lemma (like in the JSON representation). Like de => { language => 'de', value => 'Haus' }.

See also https://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua

BDD
GIVEN
AND
WHEN
AND
THEN
AND

Acceptance criteria:

Open questions:

  • How do we want to track these data usages? We will initially start with tracking them as other usages, and potentially create a more specific usage type later on (or track them as label usages once WikibaseClient is ready for that).
  • Can we do the same for Forms/Senses? Yes: mw.wikibase.getGlosses( senseId )/mw.wikibase.getReprensetations( formId )
  • What do we return if there are multiple Lemmas? Should they just be concatenated or should they hint which spelling variant they have? We will return everything (equivalent to JSON format)
  • Do you want to be able to select a specific spelling variant's Lemma with another function? For now, no.
  • Currently Lua is disabled for access to Lexeme data. How did we do this? Can we re-enable it just bit-by-bit? Yes, this is independent from getting whole entities.

Event Timeline

Restricted Application added a project: Wikidata. · View Herald TranscriptMay 29 2018, 5:08 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Vvjjkkii renamed this task from Lua function to get Lemma of a Lexeme to s1baaaaaaa.Jul 1 2018, 1:07 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from s1baaaaaaa to Lua function to get Lemma of a Lexeme.Jul 2 2018, 3:22 PM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.

@hoo @Tpt: Could you help me with defining what the function call/name should look like?

Tarrow updated the task description. (Show Details)Jul 13 2018, 4:33 PM
Tarrow updated the task description. (Show Details)Jul 13 2018, 4:35 PM
Tarrow updated the task description. (Show Details)Jul 13 2018, 4:37 PM
Tarrow updated the task description. (Show Details)
Lydia_Pintscher updated the task description. (Show Details)
hoo updated the task description. (Show Details)Aug 7 2018, 1:16 PM