Page MenuHomePhabricator

Backend to provide all types (Z4s) defined on the wiki
Closed, ResolvedPublic

Description

It would be good to have a backend way that lists all Z4/Types in the wiki.

Ideally, together with the labels in a given language.

Potentially make Z4 a parameter of this API, so that we can call for other types too?

Event Timeline

Jdforrester-WMF renamed this task from API to provide all types to API to provide all types (Z4s) defined on the wiki.Oct 22 2020, 6:18 PM
DVrandecic renamed this task from API to provide all types (Z4s) defined on the wiki to Backend to provide all types (Z4s) defined on the wiki.Oct 22 2020, 6:26 PM
DVrandecic updated the task description. (Show Details)

So having worked on an autocomplete interaction for the reference type, it seems to me that API (list=wikilambda_searchlabels within the mediawiki query API) could be usefully extended to restrict search results by type; with no query string that could return all ZObjects (up to a limit) of a given type. It already returns id, label combinations for a given language. With type = Z4 that would satisfy this ticket...

Although actually trying to do this, it appears the types listed in the table are not the ZObject id's, but string values - so instead of Z4 you have to query for "ZType". Hmm. That doesn't seem like the right choice long term but I guess we can work with it for now.

Change 647249 had a related patch set uploaded (by Jforrester; owner: ArthurPSmith):
[mediawiki/extensions/WikiLambda@master] Modify query API to include type as an option

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

Change 647249 merged by jenkins-bot:
[mediawiki/extensions/WikiLambda@master] Modify query API to include type as an option

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

Jdforrester-WMF assigned this task to ArthurPSmith.
Jdforrester-WMF subscribed.

This is great, thank you. (Note that wikis will need to purge or null-edit all pages for this to take effect.)