Jump to content

Wikifunctions:Status updates/2026-10-02

From Wikifunctions
◀ Wikifunctions Status updates Translate ▶

Abstract Wikipedia via mailing list Volunteer Response Team Abstract Wikipedia on IRC Wikifunctions on Telegram Wikifunctions on Mastodon Wikifunctions on Twitter Wikifunctions on Facebook Wikifunctions on YouTube Wikifunctions website Translate

Refreshing results: Cache usage reporting and "Run with latest data"

Starting this week Wikifunctions is offering two new capabilities addressing the issues of caching and freshness of function call results.  Before describing these capabilities, let’s set the stage with some general background information.

A cache is a temporary storage place for results that have been previously computed, or data that's been retrieved from some source. Caches are designed and located so they can be accessed very quickly. In Wikifunctions, there are two types of caching relevant here: caching of entire results from previous function calls, and caching of entities fetched from Wikidata.

Why caching?

Wikifunctions, like most Websites showing results that involve substantial processing to produce, relies heavily on caching to improve responsiveness and lessen the consumption of computing and networking resources.

  • For example, running some function Z1234 with inputs Z1234K1 and Z1234K2 might take several seconds, in the case of a complex function. However, if the same function has already been run recently, with the exact same inputs, and the result of that previous run has been cached, the cached result can typically be retrieved in milliseconds.
  • Similarly, if a function-call requires fetching several entities from Wikidata, those fetches might take a second or more, depending on the sizes of the entities, but if they have been recently cached, they can be retrieved in milliseconds.

A challenge created by caching

Unfortunately, the use of cached results and entities sometimes causes the presentation of stale results. A stale result is one which is not completely up-to-date with recent changes made to ZObjects or Wikidata entities used in the generation of the result. Stale results can be a significant hindrance to the development and maintenance of Wikifunctions functions.

  • For example, if you are developing a new function to generate text for Abstract Wikipedia articles, you may find that a Wikidata item or lexeme required by your function needs to be created or extended. If you make that change in Wikidata, and return to testing your new function, the use of caching might prevent you from seeing the benefit of your change right away.

The solution

Starting this week, Wikifunctions offers a 2-part solution:

  • reporting cache usage along with the result (in the Details dialog that accompanies each result), and
  • allowing for rerunning a possibly-stale function without any cache usage, so as to guarantee a completely fresh result.

Cache usage reporting

The use of cached data in producing a function-call result is now indicated in the Provenance section of the Details dialog, which is available under the result after running a function.

If cached data has been used, the Provenance section's English summary will be This response was retrieved from the cache. In this case, the Provenance section can be opened to reveal additional details:

A bullet like

  • Cached function call: 17 hours ago

indicates that the same function-call was run, and its result cached, 17 hours ago. In such cases, the entire result has been retrieved from a cache.

A bullet like

indicates that those Wikidata entities, involved in generating the result, were retrieved from a cache.

If no cached data has been used, the Provenance section's English summary will be This response was not retrieved from the cache.

We emphasize that the use of cached data does not, by itself, indicate that the result is stale with respect to the data sources; it only indicates the possibility that the result may be stale. In fact, most of the time cached data is up-to-date with respect to the data sources.

Result-freshening (Run with latest data)

When a function-call result, or Wikidata entities used in a result, have been retrieved from a cache, and there is reason to believe the result is not completely fresh, it may be useful to rerun the function without the use of any caches. For this purpose, Wikifunctions provides the Run with latest data button, in the Provenance section. This button appears there when cached content has been used in the result.

  • What it does: When this button is pressed, the Details dialog disappears and the function-call is immediately rerun without retrieving any content from caches. The function call result is regenerated from scratch, and any required Wikidata entities are re-fetched from Wikidata, so the result is guaranteed to be completely fresh. Caches are then updated with the re-fetched and regenerated content, so the latest content will be available for subsequent function calls.
  • Permissions group requirement: Because it's important to avoid overuse of this capability, the button is only made available to logged-in users, in the autoconfirmed group or above.
  • Rate limiting: For the same reason, it's also necessary to limit the frequency of use per user. Currently, users in the autoconfirmed group can use it 2 times per minute; those in functioneer, 5 times per minute; and those in function maintainer, 10 times per minute.

This button should be used sparingly, to help minimize its impact on network and computing resources. It is meant to be used when you know, or suspect, that a ZObject or Wikidata entity relevant to the result has changed recently, and you believe that change may produce a different result.

This content is also available in a Help page, linked from the Details dialog. Additional (more technical) information about caching for Wikifunctions and Abstract Wikipedia can be found at Abstract Wikipedia team/Architecture/Storage on the MediaWiki wiki.

Working with our first pilot communities

We are working towards a major milestone: the first Abstract Wikipedia articles appearing on language Wikipedias. We are currently working with three initial pilot communities that have expressed interest in using abstract articles on their Wikipedias: Malayalam, Dagbani, and Igbo.

Over the coming months, we will run more Wikidata and Wikifunctions workshops with each of them, so they are well placed to integrate a first abstract article if and when they decide to. Working this closely also helps us spot friction points early and improve the experience for the communities that follow.

The first technical step starts this week. We are deploying the functionality that lets wikis integrate articles from Abstract Wikipedia on Malayalam Wikipedia. Dagbani and Igbo will follow in the coming weeks. Communities turn integration on through Community Configuration, and nothing is added automatically: whether and which articles to integrate is always the local community's decision.

So which articles might they choose first? That is ultimately up to the communities. But to identify potential gaps, we looked into articles that exist on Abstract Wikipedia but not yet on the pilot wikis, and one gap stood out: cities. City articles share a common structure and include facts that quickly go out of date, like population or the current mayor. As last week's update showed with Paris, a single article can serve many Wikipedias, and drawing on Wikidata helps keep its facts current.

That makes cities a promising place to focus, though the pilot communities will decide for themselves which articles, if any, they integrate. If you are interested in working on city articles, this query lists the city articles already started on Abstract Wikipedia, how many pilot wikis are missing each one, and how widely each is covered in other Wikipedias. You can find more queries on cities and the pilot communities at this page.

Recent Changes in the software

This week, we want to thank User:Mormegil who has updated the old labels for the rights to edit Type converters that were renamed everywhere else two years ago (T367926).

Volunteers’ Corner on October 12th 2026

The next Volunteers’ Corner will be on Monday, 12 October 2026 at 17:30 UTC (not 5 October). We plan to have the following agenda: there will be time to ask questions and discuss all matters arising. If we have time, we will write a function together. Everyone is welcome to join us on Google Meet.

News in Types: Change in anonymous functions

The (explicitly marked as experimental) anonymous function type and the argument declaration for anonymous functions has been changed from taking a Type to represent the return type or the argument type respectively, to taking a Wikifunctions object reference. This is a potentially disruptive change for anyone using anonymous functions, particularly syntactic phrase functions which are built with these. We propagated this change through the system within a few hours, in order to minimize disruption. Apologies for any disruptions! We hope that this will reduce warning levels considerably when using syntactic phrase functions. Let us know if you catch anything unusual!

Fresh Functions weekly: 166 new Functions

This week we had 166 new functions. Here is an incomplete list of functions with implementations and passing tests to get a taste of what functions have been created. Thanks everybody for contributing!

A complete list of all functions sorted by when they were created is available.