Page MenuHomePhabricator

Create generic-type functions for Wikidata entity-based lightweight enums
Closed, ResolvedPublic

Description

Description

Create a built-in "generic-type function" that takes two arguments, a Wikidata entity reference type and a Typed list of Wikidata entity references, and returns a Type (a "lightweight enum type"). The entity references, in the 2nd argument, must be of the type given in the first argument, and become the elements of the lightweight enum type.

Update: there will also be a 3rd argument, a string which passes the ZID of the new lightweight enum type which is "created" by the Generic-type function. (This ZID is determined by WikiLambda.)

  • Define the generic-type function and its built-in implementation in function-schemata. Z6884 and Z6984 have been suggested for these.
  • Write the orchestrator code for the built-in implementation.
    • The code must check the input values and return an error if they don't have the right types.
  • Define the validator function for the lightweight enum types returned from the generic-type function, and its built-in implementation.
  • Write the orchestrator code for the built-in validator implementation.
  • Define the equality function for the lightweight enum types returned from the the generic-type function, and its built-in implementation.
  • Write the orchestrator code for the built-in equality implementation.

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 (a293535)repos/abstract-wiki/wikifunctions/wikilambda-cli!72jforrestersync-function-schematamain
Update function-schemata sub-module to HEAD (a293535)repos/abstract-wiki/wikifunctions/function-evaluator!345jforrestersync-function-schematamain
Update function-schemata sub-module to HEAD (a293535)repos/abstract-wiki/wikifunctions/function-orchestrator!367jforrestersync-function-schematamain
definitions: Rename Z6885/Z6985 to Z6894/Z6994 for future consistencyrepos/abstract-wiki/wikifunctions/function-schemata!223dmartinT391221-4main
Update function-schemata sub-module to HEAD (cf50aca)repos/abstract-wiki/wikifunctions/function-orchestrator!366apinesync-function-schematamain
definitions: [Z6184] Add an argument for the type of the object to be validatedrepos/abstract-wiki/wikifunctions/function-schemata!222dmartinT391221-3main
Update function-schemata sub-module to HEAD (eaa444c)repos/abstract-wiki/wikifunctions/wikilambda-cli!71jforrestersync-function-schematamain
Update function-schemata sub-module to HEAD (eaa444c)repos/abstract-wiki/wikifunctions/function-evaluator!342jforrestersync-function-schematamain
Update function-schemata sub-module to HEAD (eaa444c)repos/abstract-wiki/wikifunctions/function-orchestrator!364jforrestersync-function-schematamain
Definitions: Add equality & validator functions for Z6884repos/abstract-wiki/wikifunctions/function-schemata!218dmartinT391221-2main
Update function-schemata sub-module to HEAD (f6b01a6)repos/abstract-wiki/wikifunctions/wikilambda-cli!70jforrestersync-function-schematamain
Update function-schemata sub-module to HEAD (f6b01a6)repos/abstract-wiki/wikifunctions/function-evaluator!339jforrestersync-function-schematamain
Update function-schemata sub-module to HEAD (f6b01a6)repos/abstract-wiki/wikifunctions/function-orchestrator!357jforrestersync-function-schematamain
Add orchestrator code for built-ins Z6984 (lightweight enum types), Z6284 (validator) & Z6994 (equality)repos/abstract-wiki/wikifunctions/function-orchestrator!347dmartinT391221main
definitions: Add generic type Typed enum of Wikidata referencesrepos/abstract-wiki/wikifunctions/function-schemata!214dmartinT391221main
Show related patches Customize query in GitLab

Related Objects

Event Timeline

DMartin-WMF changed the task status from Open to In Progress.Apr 9 2025, 3:10 PM
DMartin-WMF claimed this task.
DSantamaria triaged this task as Medium priority.Apr 9 2025, 4:52 PM
DMartin-WMF renamed this task from Create a generic type for lightweight enums to Create a generic type for Wikidata entity-based lightweight enums.Apr 14 2025, 12:41 AM
DMartin-WMF updated the task description. (Show Details)

dmartin opened https://gitlab.wikimedia.org/repos/abstract-wiki/wikifunctions/function-orchestrator/-/merge_requests/347

Add orchestrator code for Z6984 / Built-in implementation of Typed enum of Wikidata references

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

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

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

Change #1142527 merged by jenkins-bot:

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

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

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

[operations/deployment-charts@master] wikifunctions: Update evaluators from 2025-04-16-213143 to 2025-05-07-003410

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

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

[operations/deployment-charts@master] wikifunctions: Update orchestrator from 2025-04-23-134615 to 2025-05-06-142345

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

Change #1143074 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Update evaluators from 2025-04-16-213143 to 2025-05-07-003410

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

Change #1143075 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Update orchestrator from 2025-04-23-134615 to 2025-05-06-142345

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

Note: Still in CR, the deployment above is only part of the sequence of patches.

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

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

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

Change #1144563 merged by jenkins-bot:

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

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

DMartin-WMF renamed this task from Create a generic type for Wikidata entity-based lightweight enums to Create generic-type functions for Wikidata entity-based lightweight enums.May 14 2025, 12:31 AM
DMartin-WMF updated the task description. (Show Details)

jforrester merged https://gitlab.wikimedia.org/repos/abstract-wiki/wikifunctions/function-orchestrator/-/merge_requests/347

Add orchestrator code for built-ins Z6984 (lightweight enum types), Z6284 (validator) & Z6994 (equality)

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

[operations/deployment-charts@master] wikifunctions: Update evaluators from 2025-05-07-003410 to 2025-05-12-235119

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

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

[operations/deployment-charts@master] wikifunctions: Update orchestrator from 2025-05-06-142345 to 2025-05-14-112404

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

Change #1145863 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Update evaluators from 2025-05-07-003410 to 2025-05-12-235119

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

Change #1145864 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Update orchestrator from 2025-05-06-142345 to 2025-05-14-112404

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

Thanks for the reminder, @DSantamaria. I wanted to check that the deployed functions are showing up correctly on Wikifunctions.org. I've just done that, so will close.