Page MenuHomePhabricator

Consider adding 'lexeme' key to Z6006/Wikidata lexeme sense
Closed, ResolvedPublic

Description

Description

When we created Z6004/Wikidata lexeme form, we decided to have a key Z6004K2/lexeme, which refers to the containing lexeme (Even though that element is not present in the JSON that Wikidata delivers to us, it's trivial to insert it in the ZObject). Unfortunately, we neglected to include a similar key in Z6006/Wikidata lexeme sense, so we have an inconsistent treatment of these 2 types. The inconsistency is somewhat jarring because the types are very similar In most respects. Also, since an instance of Z6006 can exist independently of its containing lexeme, indicating the identity of the lexeme, as we do in Z6004, would be an appropriate convenience.

  • Decide whether to shift the existing keys so that the new key could be K2.
    • Decision: we will shift; the new key will be K4.
  • Update the definition of Z6006 in function-schemata.
  • Update the ZObject-construction code in the orchestrator.
    • Adds to the output of Z6826/Fetch Wikidata lexeme sense and Z6825/Fetch Wikidata lexeme
  • Front-end: Update Wikidata lexeme sense component to handle K4
  • If we choose to shift the existing keys, correct all existing functions that refer to the existing keys.
    • At present there are about 6 such functions showing up in Wikifunctions search results.

After deployment, functions can start using K4 without changing any pre-existing code.

Desired behavior/Acceptance criteria (returned value, expected error, performance expectations, etc.)

  • ...

Completion checklist

Details

Related Changes in Gerrit:
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Update function-schemata sub-module to HEAD (81ece97)repos/abstract-wiki/wikifunctions/function-orchestrator!313jforrestersync-function-schematamain
Update function-schemata sub-module to HEAD (81ece97)repos/abstract-wiki/wikifunctions/function-evaluator!327jforrestersync-function-schematamain
Update function-schemata sub-module to HEAD (81ece97)repos/abstract-wiki/wikifunctions/wikilambda-cli!65jforrestersync-function-schematamain
Update Z6826 implementation to instantiate the new Z6006K4 keyrepos/abstract-wiki/wikifunctions/function-orchestrator!311dmartinT388086main
definitions: [Z6006] Add key Z6006K4/lexemerepos/abstract-wiki/wikifunctions/function-schemata!201dmartinT388086main
Customize query in GitLab

Event Timeline

I think we should bite the bullet now and shift the keys so that the new key is K2. This will mess a few things up now, but it's manageable, and would be much worse later.

Hi @99of9, we appreciate your comment and perspective on this, and also understand the appeal of putting the new key in the K2 position. I did a step-by-step breakdown of 3 possible approaches (add the new key as K4; add it as K2 and shift the other keys; redefine the lexeme sense type as Z6007 with the new key as K2, and deprecate Z6006), and discussed it with the team. Unfortunately, the 2nd and 3rd of these approaches involve managing breaking changes and carefully coordinating deployment in 3 different areas (predefined content, orchestrator code, and front-end code), and it would be difficult to avoid a period of a couple days when functions using Z6006 wouldn't be working. The team feels the extra overhead, risk and inconvenience of those approaches, for developers and users, isn't warranted, and came down in favor of the first approach. The only downside of the first approach is the key-numbering contrast with Z6004, and that's seen as minor.

Okay, thanks for your rationale.

Change #1128013 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (81ece97)

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

Change #1128013 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (81ece97)

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

Change #1129367 had a related patch set uploaded (by Jforrester; author: Jforrester):

[operations/deployment-charts@master] wikifunctions: Update evaluators from 2025-03-11-234147 to 2025-03-19-125950

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

Change #1129368 had a related patch set uploaded (by Jforrester; author: Jforrester):

[operations/deployment-charts@master] wikifunctions: Update orchestrator from 2025-03-11-234105 to 2025-03-19-203723

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

Change #1129367 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Update evaluators from 2025-03-11-234147 to 2025-03-19-125950

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

Change #1129368 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Update orchestrator from 2025-03-11-234105 to 2025-03-19-203723

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