Wikifunctions:Project chat

Latest comment: 4 hours ago by DVrandecic (WMF) in topic Nonexistent validator

Welcome to the Project chat, a place to discuss any and all aspects of Wikifunctions: the project itself, policy and proposals, individual data items, technical issues, etc.

Other places to find help:

SpBot archives all sections tagged with {{Section resolved|1=~~~~}} after 1 day and sections whose most recent comment is older than 30 days.

Editing issue

I made this edit, which was undone a few seconds later, seemingly by myself. When I tried to redo the edit, i got this error message. --Autom (talk) 16:12, 9 May 2024 (UTC)Reply

@Autom: Hi there, this is odd; it might be related to a production issue we had last week. Have you had it happen further? Jdforrester (WMF) (talk) 13:50, 16 May 2024 (UTC)Reply
I still get the "User does not have permission to edit" error. --Autom (talk) 11:18, 18 May 2024 (UTC)Reply
@Autom: Is this still happening? For which kind of edits? -- DVrandecic (WMF) (talk) 19:43, 30 May 2024 (UTC)Reply

Call for calendar month proposals!

Hi all!

We recently released the Gregorian calendar months. We want to follow with other calendar systems rather quickly. It would be great if folks could create Type proposals for that. I don't want to start making calendar months for calendars I am not familiar with. Here is the Type proposal for Gregorian calendar month, feel free to use this as a template for the other ones.

If you need any help or have questions, please reach out and feel free to ask. Thank you! -- DVrandecic (WMF) (talk) 00:02, 24 May 2024 (UTC)Reply

In that context, can I also encourage consideration of this type proposal Wikifunctions:Type proposals/configuration of functions for given types which would help to harness similar functions for closely related types. (e.g. calling a "next month" function on any type of month.) --99of9 (talk) 03:43, 24 May 2024 (UTC)Reply
Good idea. Although it refers to “given types”, I think it could be easily extended to include “given identities” (which could also extend to “given languages”). I think we would still need to improve the orchestration approach to make it selective, as outlined in my comments on the proposal. Perhaps we should raise a Feature Request for this on Phabricator? GrounderUK (talk) 07:59, 24 May 2024 (UTC)Reply
@99of9: agree with @GrounderUK that it's a good idea! I will take a closer look after next week. --DVrandecic (WMF) (talk) 16:55, 13 June 2024 (UTC)Reply


Hi y'all,

The last newsletter Wikifunctions:Status updates/2024-05-30 talks about numbers, plural and building "simple" sentences like “There are four apples.”

But in many languages, such sentences are not that simple.

For example in Breton, numbers are quite weird. “There are four apples.” is “Pevar aval zo” (or “a zo” or “ ’zo” in the end, but that's beside the point here). It seems simple but :

  • numbers with units 2,3 4 depends on the gender of the noun (« pevar aval » “four apples” masculine but « peder logodenn » “four mice” feminine)
  • there is no agreement, the noun stays at the singular form (or collective form for words without a singular)
  • when written in letters, the noun goes between the number and the rest of the number: 33 apples is « pevar aval ha tregont » (litteraly: “3 apple and 30”)
  • as always in Breton, words mutates (after the units 2, 3, 4 and 9 ; 2 is soft “2 dogs” is « daou gi » Breton soft mutation (Z11619) and 3, 4 9 is spirant “3 dogs” is « tri c'hi » m. or « teir c'hi » f. Breton aspirant mutation (Z11632))
  • and of course, there is exceptions and variations... (like « peder avel » “four winds” masculin but behave like a feminine)

And obviously, all of these happens at the same time. I'm not sure how we can deal with inside a function.

Cheers, VIGNERON (talk) 21:32, 30 May 2024 (UTC)Reply

Wikifunctions labels in functions

I’ve created a few functions for getting labels out of Persistent objects. It turns out that this is quite tricky, so in the next couple of days I plan to create a Feature Request on Phabricator to make it better.

Tracked in Phabricator:
Task T366459

Please feel free to make suggestions or ask questions.

object labels (Z16556) returns the Z2K3 Multilingual text (Z12) that contains the labels (a Typed list). There is a usability issue here because we have to supply a reference but the interface invites us to enter an object. (Also, no test will pass. That is this bug.)

object label (Z16568) tries to find an item in the list that matches a particular language and returns the associated string (the label). There is no concept of a fallback language here. This function relies on object labels (Z16556) so, again, we have to supply a reference.

string for a language (Z16560) is called by object label (Z16568) to scan through the list looking for a matching language (key) and returning the associated string (value).

month label (Z16580) is not currently working but it has returned a label for each month, specified as an object rather than a reference (but only while it is being edited.) There is definitely a bug here, because when the composition is saved, its references are converted into literal strings.

This is inconvenient because (a) it doesn’t work (b) there are twelve references to re-enter before it can work in edit mode and (c) it is likely to time out anyway. A partial implementation is month label (three months) (Z16583). Feel free to play around with that.

Where do we go from here? GrounderUK (talk) 22:35, 31 May 2024 (UTC)Reply

Testing two new types

As discussed in today's Volunteers' Corner (recording forthcoming) we will soon be adding two types to Wikifunctions for testing purposes. Both new types will be marked in their labels for now with "do not use". Please do not use them yet. The two types are an enumeration type for signs (positive, neutral, negative, see proposal) and our first complex type, integer numbers, composed of the new sign type and the natural number type (see proposal). We'll keep you updated here about how the tests are proceeding in the following days. If you have questions or comments, please feel free! -- DVrandecic (WMF) (talk) 18:40, 3 June 2024 (UTC)Reply

Type validators not working

There are several types whose validators are not returning an error when they should be.

ScienceD90 (talk) 13:53, 7 June 2024 (UTC)Reply

This is because
Hope this helps --DannyS712 (talk) 07:58, 9 June 2024 (UTC)Reply
@ScienceD90: yes, that's correct and not great. We need to fix this. This isn't our highest priority right now, but it is up there! Sorry for any inconvenience this is causing. In fact, we would be interested in what kind of inconvenience it is causing! --DVrandecic (WMF) (talk) 22:16, 12 June 2024 (UTC)Reply
It doesn't really cause any inconvenience, however it is weird seeing badly designed functions, like Simple calculator (Z13934) being able to return natural number "True" when you put in "True" ScienceD90 (talk) 00:42, 13 June 2024 (UTC)Reply
Ugh, yeah, that's a bad implementation. We shouldn't just pass user input to eval. I disconnected it. Thanks for flagging it. DVrandecic (WMF) (talk) 01:46, 13 June 2024 (UTC)Reply
In response to this function, I have made a page explaining why eval is bad: Wikifunctions:Eval ScienceD90 (talk) 18:03, 13 June 2024 (UTC)Reply
@ScienceD90: Thank you! --DVrandecic (WMF) (talk) 21:15, 17 June 2024 (UTC)Reply

Revisiting community "maintainer" rights

@Jdforrester (WMF) at Wikifunctions:Project chat/Archive/2024/03#Criteria for granting "maintainer" rights/editing running functions we were told that the Wikilambda team was not yet ready for community members to be function maintainers. Given the number of recent types created and the fact that things look like they are going smoothly, does that assessment still stand? --DannyS712 (talk) 06:37, 12 June 2024 (UTC)Reply

@DannyS712: It does. Particularly the user interface for creating types isn't nowhere near ready yet. We are aiming to improve our own speed with creating new types, so that there is less of a backlog for this. Is there anything else that you think is holding back the community besides the right for type creation? --DVrandecic (WMF) (talk) 22:21, 12 June 2024 (UTC)Reply
@DVrandecic (WMF) as I noted in the prior discussion my primary motivation was the wikilambda-edit-running-function right so that as new types are created any existing function that should be the new type can easily be updated. --DannyS712 (talk) 23:30, 12 June 2024 (UTC)Reply
@DannyS712 in order to avoid the "first disconnect, then edit, then connect again" dance? --DVrandecic (WMF) (talk) 23:56, 12 June 2024 (UTC)Reply
@DVrandecic (WMF) exactly, though I haven't done that dance in a while, as new types are created its more likely to come up --DannyS712 (talk) 01:53, 13 June 2024 (UTC)Reply
@DannyS712: Thank you for the explanation! Understood. -- DVrandecic (WMF) (talk) 16:48, 13 June 2024 (UTC)Reply
Now that we have Integer (Z16683) ready for use its come up again - most of the stuff we switched to use natural numbers should probably be switched to use integers --DannyS712 (talk) 04:56, 21 June 2024 (UTC)Reply
For many of them I'd prefer to have one version natural numbers and another for integers. Otherwise every natural number operation will need to cast in and out of int all the time. 99of9 (talk) 05:03, 21 June 2024 (UTC)Reply
@DVrandecic (WMF) wikilambda-edit-predefined would help us to better document the inbuilt functions by attaching tests (and removing broken inbuilt tests?). --99of9 (talk) 00:57, 13 June 2024 (UTC)Reply
@99of9: Thank you, good point! For now, I'd be happy to act upon a list, so that it's at least done. --DVrandecic (WMF) (talk) 16:49, 13 June 2024 (UTC)Reply

@DVrandecic (WMF) Here's a list from Wikifunctions_talk:Catalogue tagged with "not done" for any that need updates. Feel free to delete the tag when done. Some will need thought if any unconnected test fails any implementation:

--99of9 (talk) 03:42, 14 June 2024 (UTC)Reply

This is more difficult than I expected! --DVrandecic (WMF) (talk) 21:16, 17 June 2024 (UTC)Reply
Which difficulties are you encountering most? I find inbuilt functions particularly hard to make tests for because the code is not visible, and the definition is often just a name and some input/output types. But that's also why I want to make more tests available! It looks like you chose Value by key (Z803) to start with, which has some phabricator tasks/bugs, so is perhaps tougher than most. 99of9 (talk) 02:06, 18 June 2024 (UTC)Reply

Presentations about Wikifunctions and Abstract Wikipedia

Hello all! One of our objectives for these months is to create a basic presentation about Wikifunctions and Abstract Wikipedia. Our current draft will be shared in the next weeks, once finalised, and it will likely be improved by your feedback, but right now we want to ask you some questions:

  1. Have you already had a presentation about Wikifunctions/Abstract Wikipedia? If so, how did it go?
  2. If not, are you planning to do one in the future? And what kind of help would you need for it, if any?

Feel free to reach out here, or on my talk page, or via email if you wish! And thanks in advance for your help! Sannita (WMF) (talk) 15:41, 13 June 2024 (UTC)Reply

  • I gave one to the joint theoretical group meeting of our School of Chemistry. A bunch of programming-savvy educators. Titled "A language-independent programming language". Motivated by the linguistic diversity of our students. Leading through my history of attempts to contribute to poly-lingual education: from Wikipedia to Syllabus Translation to Entity Explosion to Wikifunctions. It wasn't intended to get them to edit, just to introduce them to the idea and provoke discussion really. --99of9 (talk) 04:12, 14 June 2024 (UTC)Reply

Overloading types (or not)

Copied from Telegram

User:99of9 I just read this page m:Abstract_Wikipedia/Early function examples and looked up kleenean (en:Three-valued logic), which has a vague correspondence with our new "sign" type (both have three enumerated values). Should we start writing functions representing Kleene and Priest logic using the sign type (and give additional aliases to positive/negative/neutral), or should we wait and make a separate type with values more explicitly enumerated (true, false, unknown/unknowable/undecidable/irrelevant/both)?

User:DVrandecic (WMF) I would prefer to make a Kleenean type, one not overload Sign with that, unless other people disagree. Just to be able to keep the nomenclature as close as possible to the standard nomenclature.
User:99of9 I'm comfortable with that. The only advantages of overloading I can think of would be if we were deliberately minimising the number of types, or if a sign output from one function could reasonably be understood as a kleenean input to another.
User:GrounderUK Hmmm… 🤔 I agree that Kleenean and Sign are probably best kept separate, but I suspect they might be better considered as “systems” over an abstract trivalent type. The standard nomenclatures are then a series of ultra-thin functional wrappers. It may be that such an approach generally allows the similarities and differences to be more clearly seen. (I feel a Project Chat topic coming on.)
User:99of9 Another question I had is whether True and False would still map to the same ZIDs as the existing ones (I assume not, because they are already typed Boolean). And then I guess we won't be able to map two different True's to the same Wikidata item. So maybe it was good that we kept identity away from Wikidata?
User:GrounderUK I think Boolean and Kleenean True are the same concept, although its negation is interpreted differently in the different systems. But you are right that, in practice, Kleenean true could not be true (Z41). Both “true” identities could point to the same Wikidata item (by function or by additional key) just as many lexical item senses may have the same item for this sense (P5137) Item.
User:99of9 I guess I should have written it the other way around: Wikidata can't point from the same Q-item to two different ZIDs.
User:99of9 I guess we could just make a "Kleenean True" QID, which would include "said to be the same as" the regular "True" QID. Then they could link to their respective ZIDs.
User:GrounderUK Someone did, kinda 😏 True → Positive (Z17057)

GrounderUK (talk) 19:20, 17 June 2024 (UTC)Reply

Please see Wikifunctions:Type proposals/Kleenean. GrounderUK (talk) 20:23, 17 June 2024 (UTC)Reply

Nonexistent validator

The validator of HTML fragment (Z89) points to Z189 which does not exist ScienceD90 (talk) 12:46, 20 June 2024 (UTC)Reply

@ScienceD90: Thank you for raising the issue. Filed T368318 on Phabricator. --DVrandecic (WMF) (talk) 20:48, 24 June 2024 (UTC)Reply

Delete this implementation

Hi, I'm a noob in this project. I have created Indian English cardinals,python (Z17100) as an implementation of English cardinal (Z13587). However, the implementation shows some errors for not being consistent with the "million-billion-trillion" system. I thought that English cardinal (Z13587) is applicable for all types of cardinal, but I'm dismayed to find that only short scale is supported here. I'm linking the Z items by analogy of Wikidata's Q and P items. Sbb1413 (talk) 17:53, 20 June 2024 (UTC)Reply

A function has to give the same result for the same input. When you need a different result, you need a different function. I suggest we create the required function for Indian English before deleting this implementation. We could also create a separate function for the traditional English million-based system but I don’t know whether this system is in current use by any English-speaking community. GrounderUK (talk) 19:58, 20 June 2024 (UTC)Reply

Wikifunctions & Abstract Wikipedia Newsletter #160 is out: New Type: Integers

There is a new update for Abstract Wikipedia and Wikifunctions. Please, come and read it!

In this issue, we are happy to announce that we introduced another new type, integers, that will increase our coverage of mathematical functions. Moreover, we take a look at the (many!) software developments we introduced in the last week.

Want to catch up with the previous updates? Check our archive!

Enjoy the reading! -- User:Sannita (WMF) (talk) 11:07, 21 June 2024 (UTC)Reply

Rename "Gregorian calendar month" to "Roman calendar month"

Since they can be used for both the Julian and the Gregorian calendar, I think it would make sense to give them a slightly more generic name. It's about this Type: Gregorian calendar month (Z16098). Thoughts? --Denny (talk) 20:50, 22 June 2024 (UTC)Reply

In English, we could just call it “month” or “calendar month”. I wouldn’t call it “Roman” because “Roman calendar” might equally refer to one of its pre-Julian forms. (Whether the intercalary month should be considered a thirteenth month is an open question, but the intercalary month was a short month and February was always the shortest month. A function to return the number of days in a pre-Julian month would be problematical for February (23 or 24) and for the additional month before March (27 or 28) because scholars disagree.) GrounderUK (talk) 08:36, 23 June 2024 (UTC)Reply