Page MenuHomePhabricator

Define built-in function Fetch Wikidata entities
Closed, ResolvedPublic

Description

Description

Since the orchestrator code to support a new built-in function Fetch Wikidata entities now exists (it was written for T383644 and T383631), it would make sense to define the function for use on-wiki. Since it would allow fetching of multiple entities, of mixed types (lexemes, items, etc.), it would likely be a useful addition to the type-specific fetch functions that we have now (Fetch Wikidata lexeme, Fetch Wikidata item, etc.).

Whenever a user provides a composition implementation for a function that needs to fetch multiple Wikidata entities, they can get a performance benefit by fetching them using this function, instead of individual calls to our existing Wikidata fetch functions. One example use case would be when a call to Z6830/Find lexemes for a Wikidata item returns multiple lexeme references and they need to retrieve the referenced lexemes for comparison, to determine which one works best for a given NLG setting.

The existing fetch functions are Z6821/2/4/5/6; perhaps Z6820 would be a good ZID for this one.

  • Define the function
  • Define the built-in implementation
  • Add (a few) lines of code to builtins.js
  • Add tests

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
Add orchestrator code for Z6920/Built-in implementation of Z6820repos/abstract-wiki/wikifunctions/function-orchestrator!336dmartinT386598main
Update function-schemata sub-module to HEAD (bcd26d2)repos/abstract-wiki/wikifunctions/wikilambda-cli!67jforrestersync-function-schematamain
Update function-schemata sub-module to HEAD (bcd26d2)repos/abstract-wiki/wikifunctions/function-evaluator!331jforrestersync-function-schematamain
Update function-schemata sub-module to HEAD (bcd26d2)repos/abstract-wiki/wikifunctions/function-orchestrator!334jforrestersync-function-schematamain
definitions: [Z6820] Change output type from List(Z1) to Map(Z6,Z1)repos/abstract-wiki/wikifunctions/function-schemata!209dmartinT386598-2main
Definitions: Add built-in function Z6820 and its implementation Z6920repos/abstract-wiki/wikifunctions/function-schemata!206dmartinT386598main
Customize query in GitLab

Event Timeline

Is this part of Quarterly work? If so, it shouldn't be tagged as a Fix-It task, but should be marked as blocking an Epic (and an upper-level explanation of what we are and aren't trying to support).

DVrandecic lowered the priority of this task from High to Medium.Feb 19 2025, 6:36 PM

Hi @Jdforrester-WMF - No, this is not part of Quarterly work.

DMartin-WMF changed the task status from Open to In Progress.Mar 28 2025, 2:45 PM

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

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

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

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

[operations/deployment-charts@master] wikifunctions: Update evaluators from 2025-03-19-125950 to 2025-04-02-130409

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

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

[operations/deployment-charts@master] wikifunctions: Update orchestrator from 2025-03-25-145119 to 2025-04-02-124609

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

Change #1133413 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Update evaluators from 2025-03-19-125950 to 2025-04-02-130409

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

Change #1133414 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Update orchestrator from 2025-03-25-145119 to 2025-04-02-124609

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

Change #1133384 merged by jenkins-bot:

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

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

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

[operations/deployment-charts@master] wikifunctions: Update orchestrator from 2025-04-08-183631 to 2025-04-16-192052

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

Change #1137076 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Update orchestrator from 2025-04-08-183631 to 2025-04-16-192052

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

I will confirm functionality on orchestrator, and then sign off, after the loadPreDefinedObject script has been run for this function.
EDIT: on production, not "on orchestrator"

I will confirm functionality on orchestrator, and then sign off, after the loadPreDefinedObject script has been run for this function.

Oops, sorry, now done!

Actually, it looks like it still needs to be run for Z6920. (And if I neglected to note that on the Chores page, which is quite possible, then it's my turn to apologize :-).

If I should just go ahead and run it, please confirm. Don't think I've done this before, but the RunBook is clear, As I recall.

Actually, it looks like it still needs to be run for Z6920. (And if I neglected to note that on the Chores page, which is quite possible, then it's my turn to apologize :-).

I think that was my error (both in failing to add it to the Chores list, and failing to think of when running the Chores), but fixed now.

Okay, looks good on production. Task already closed.