Wikifunctions:Project chat/Archive/2025/08
This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Correction for Z25177
The code converter Z25177 has an error: it lacks a }
at the end. Could someone with the needed rights add it? Dv103 (talk) 09:48, 8 August 2025 (UTC)
- @DMartin (WMF) maybe? 99of9 (talk) 11:25, 9 August 2025 (UTC)
- Thanks for noticing and mentioning! I took care of that. DMartin (WMF) (talk) 19:54, 11 August 2025 (UTC)
- This section was archived on a request by: Dv103 (talk) 08:30, 12 August 2025 (UTC)
- Thanks for noticing and mentioning! I took care of that. DMartin (WMF) (talk) 19:54, 11 August 2025 (UTC)
"You don't have permission to connect an Implementation to its Function so it can be run."
Hi I created a small function for variance and wanted to add some tests for it.
(!) list variance - Wikifunctions
I don't have the permissions to do this. Is there something I need to do (other than ask here)? GrimRob (talk) 09:55, 22 August 2025 (UTC)
- You should have the right to add testcases. You instead need to be a functioneer to connect implementations and testcases. Dv103 (talk) 10:00, 22 August 2025 (UTC)
- Thanks. I didn't realise I could run it indirectly via Tests, so have added a couple. GrimRob (talk) 10:07, 22 August 2025 (UTC)
- Now I've connected everything. Dv103 (talk) 10:09, 22 August 2025 (UTC)
- This section was archived on a request by: Dv103 (talk) 17:59, 26 August 2025 (UTC)
- Now I've connected everything. Dv103 (talk) 10:09, 22 August 2025 (UTC)
- Thanks. I didn't realise I could run it indirectly via Tests, so have added a couple. GrimRob (talk) 10:07, 22 August 2025 (UTC)
Equality function for Z89
@DMartin (WMF) Should HTML fragment equality (Z877) be connected as the equality function for HTML fragment (Z89)? Dv103 (talk) 09:50, 29 August 2025 (UTC)
- @Dv103: I've connected these; in future, you don't need to ping members of the team, just post in here. :-) Jdforrester (WMF) (talk) 15:52, 29 August 2025 (UTC)
- This section was archived on a request by: Dv103 (talk) 19:37, 30 August 2025 (UTC)
Types for vectors/matrices
I'm considering making a few functions for least squares methods, and am unsure what types to be using for the input and output. These methods take as input an nx1 vector and nxk matrix, and output a kx1 vector (coefficients) and nx1 vector (residuals). Vermont (talk) 14:51, 7 August 2025 (UTC)
- For representing vectors I've always used Z881(Z19677), while for matrixes I've used Z881(Z881(Z19677)) (see Wikifunctions:Catalogue/List_operations#Linear_Algebra). I'm instead not shure on how to return 2 values (list of length 2? Two different functions?).
- By the way, working with lists and in particular with lists of lists can be very painful. Dv103 (talk) 15:00, 7 August 2025 (UTC)
Heads-up regarding changes to Wikidata statement (Z6003)
The biggest remaining gaps in what we import from Wikidata are qualifiers, references, and no value / some value statements. We are currently working on adding these things, in a way that closely mirrors Wikidata's data structures. This involves the following additional keys in Wikidata statement (Z6003): Z6003K5/qualifiers, Z6003K6/references, and Z6003K7/claim type.
The rest of this post is about Z6003K7/claim type, which will have these 3 possible values: value (Z6021), no value (Z6022), some value (Z6023). When Z6003K7 is either no value (Z6022) or some value (Z6023), Z6003K3/value will have void (Z24) rather than an ordinary value. Therefore, a function that returns statement values could sometimes return void (Z24), which, depending on the function, might not be an appropriate return. I've been looking at functions that might be affected by this and, so far, I only see a few functions that might need to be changed.
Here's an example of a function that I think does not need to be changed: value of Wikidata statement (Z19308). Since it's just a simple accessor that pulls out the value of Z6003K3, I think it's appropriate for it to return void (Z24) sometimes. Similarly, value type of statement (Z23516) would legitimately return Unit (Z21) for those cases.
On the other hand, grammatical features of lexeme (Z22559) clearly should not return any void values; it's only meant to return a list of Wikidata item reference (Z6091), from person/number/gender statements. I doubt if there are any person/number/gender statements with type no value (Z6022) or some value (Z6023), but I'm not certain so I'm inclined to modify this function, and a few similar ones, so they couldn't possibly make the mistake of returning a void (Z24).
I'm still looking, but so far I've only found these functions that should possibly be modified in this way: grammatical features of lexeme (Z22559), filtered grammatical statement values (Z22561), grammatical features inherited from lexeme (Z22556), grammatical features of lexeme form (Z22487), all grammatical features of lexeme form (Z22638), values (unqualified) from Wikidata item statements (Z22978), first value of property from wikidata item (Z21449).
I will continue looking. If anyone is aware of other functions that might need attention, please mention them in a reply. --DMartin (WMF) (talk) 04:31, 8 August 2025 (UTC)
- Another consequence of these changes to Wikidata statement (Z6003): Tests which check a list of values extracted from statements, or the first value extracted from a group of statements, could start failing, simply because there will be more statements imported. (The new statements are not only those of types no value (Z6022) and some value (Z6023), but also all statements with qualifiers.) Example: monolingual text values of WD statements (Z23168). DMartin (WMF) (talk) 05:35, 9 August 2025 (UTC)
- Yes, we'll be on the lookout for that. But that's not a big change, because we already expect Tests based on live Wikidata results to be susceptible to the underlying data changing. --99of9 (talk) 11:28, 9 August 2025 (UTC)
API unusable outside UserJS (and desktop apps ofc)
When I try to fetch a ZObject with a script on another site, the response doesn't set the Access-Control-Allow-Origin
header, so Firefox (or any compliant browser) refuses to let the script read the body. Is this intentional? Do I need to provision an API key or something? I'm hesitant to sink time into a debugging tool if the end product would need you to fiddle with UserJS to use it. YoshiRulz (talk) 12:43, 9 August 2025 (UTC)
Proposed JavaScript conversion functions for Wikidata geo-coordinate
I've prepared the following JavaScript conversion functions for Wikidata geo-coordinate:
- Convert from Wikidata geo-coordinate, JavaScript (Z25954)
- Convert to Wikidata geo-coordinate, JavaScript (Z25955)
Feedback is welcome! One note: because the built-in Fetch functions code allows for missing precision and globe values in the geo-coordinate JSON from Wikidata (in which case it inserts Z24/void
in Z6011K3
or Z6011K4
, respectively), Convert from Wikidata geo-coordinate, JavaScript (Z25954) therefore checks for those possible void values. If there's a void value, it's converted into JavaScript null
. Accordingly, Convert to Wikidata geo-coordinate, JavaScript (Z25955) checks for those possible null
values. However, I don't know for certain whether we will ever have missing values for precision or globe. The Wikidata documentation sources are a bit vague on this point. In at least one place, the documentation seems to imply they could be missing, so we are allowing for that possibility. --DMartin (WMF) (talk) 18:36, 10 August 2025 (UTC)