[10:58:54] I'm thinking about type proposals. I've previously been thinking that enums should have a way of linking to their Wikidata items. But I realised that one way of doing that would be to write a mapping function for each type. So I tried one for Gregorian months: Z22240. Is this what others are imagining doing for every type whose items have a single corresponding [10:58:54] Wikidata item? [11:03:36] Yes. It didn’t seem to work for me in Python but that was probably just bad debugging 🙄 (re @u99of9: I'm thinking about type proposals. I've previously been thinking that enums should have a way of linking to their Wikidata items...) [11:05:19] @vrandecic would you mind adding an equality function Z19316 to type Z6091? It would have helped when setting up the tests. [11:06:06] did you try this before, or as an extra implementation? (re @Al: Yes. It didn’t seem to work for me in Python but that was probably just bad debugging 🙄) [11:08:36] Some weeks ago. Probably some other type of Wikidata reference, I’m not sure. (re @u99of9: did you try this before, or as an extra implementation?) [11:10:32] I'm happy to look over it if you can find it. I don't speak very fluent JSON though... (re @Al: Some weeks ago. Probably some other type of Wikidata reference, I’m not sure.) [11:13:58] Thanks… I wouldn’t have saved it if it didn’t work 😏 Did we have a string to QID/LID function? 🤔 (re @u99of9: I'm happy to look over it if you can find it. I don't speak very fluent JSON though...) [11:14:15] (I basically copied and simplified it from the code in Z20848) (re @u99of9: I'm happy to look over it if you can find it. I don't speak very fluent JSON though...) [11:14:43] if we don't, we should! (re @Al: Thanks… I wouldn’t have saved it if it didn’t work 😏 Did we have a string to QID/LID function? 🤔) [11:15:50] We have the inverse (for QIDs) Z20041 (re @Al: Thanks… I wouldn’t have saved it if it didn’t work 😏 Did we have a string to QID/LID function? 🤔) [11:18:18] I did Z22167 quite recently because there was no passing implementations 🤷‍♂️ (re @u99of9: if we don't, we should!) [11:23:25] Can we delete the hardcoded one: Z22161? I've added a JS version. [11:25:51] I think we have to go into code to go from the string, because References 🤔 or is that just a ZID problem now? I need to refresh my understanding! (re @u99of9: You made the inverse (for QIDs) Z20041) [11:27:45] I'm happy to do it in code, but I imagine a composition could work by splitting off the number then calling Z21458. I don't understand your question about references vs ZID. [11:32:39] Ah, yes… that would explain why someone set the function up… The ZID thing is just that we don’t have support for Wikifunctions references, only Wikidata references. (re @u99of9: I'm happy to do it in code, but I imagine a composition could work by splitting off the number then calling Z21458. I don't und...) [11:33:08] Here is QID: Z22246 (re @Al: Thanks… I wouldn’t have saved it if it didn’t work 😏 Did we have a string to QID/LID function? 🤔) [11:35:13] Sorry, can’t check now, but I think I broke it. I was going to see if I could work out what the bug is. I think it’s the UI. (re @u99of9: Can we delete the hardcoded one: Z22161? I've added a JS version.) [11:36:14] Yes, I just noticed that it wasn't meant to be a hardcode. I've fixed it: Z22161 (re @Al: Sorry, can’t check now, but I think I broke it. I was going to see if I could work out what the bug is. I think it’s the UI.) [11:46:38] and can you add equality function Z19287 to type Z6095 (re @u99of9: @vrandecic would you mind adding an equality function Z19316 to type Z6091? It would have helped when setting up the tests.) [11:54:52] and here is LID: Z22249 (re @Al: Thanks… I wouldn’t have saved it if it didn’t work 😏 Did we have a string to QID/LID function? 🤔) [12:08:00] Nice work! I suppose it makes sense to return LIDs that aren’t valid (like ‘99of9’)… 🤷‍♂️ (re @u99of9: and here is LID: Z22249) [12:10:18] I think validity can be tested elsewhere if necessary. (re @Al: Nice work! I suppose it makes sense to return LIDs that aren’t valid (like ‘99of9’)… 🤷‍♂️) [12:11:26] Yes, Wikidata doesn’t seem to mind… but we know whom to blame! (re @u99of9: I think validity can be tested elsewhere if necessary.) [12:14:44] Quick pulse check. I want to propose a chemical element type. Should it be an enum or a natural number (representing the atomic number)? In code I'd definitely want a number, but as a user I'd want to pick or search from a (looooong!!?) dropdown. [12:16:48] As a user I suppose I would also be willing to type in a string which would be parsed, so that I could either type an atomic number, an atomic symbol, or the full name. [12:24:51] Surely you’d want a periodic-table picker! I’m going with enum, just because it’s what I’d expect. I guess IUPAC codes like Es would be [[Z1360]] labels 🤔 (re @u99of9: Quick pulse check. I want to propose a chemical element type. Should it be an enum or a natural number (representing the atomic ...) [12:31:41] done! (re @u99of9: @vrandecic would you mind adding an equality function Z19316 to type Z6091? It would have helped when setting up the tests.) [12:31:53] Seriously, multiple dropdowns (generally) for row, column and grid/table/matrix (where required) would be pretty convenient. (re @Al: Surely you’d want a periodic-table picker! I’m going with enum, just because it’s what I’d expect. I guess IUPAC codes like Es w...) [12:34:52] done as well (re @u99of9: and can you add equality function Z19287 to type Z6095) [12:37:24] For me it's more important that I can select by typing "Fe". So if it's an enum, the search would need to be decent. (re @Al: Seriously, multiple dropdowns (generally) for row, column and grid/table/matrix (where required) would be pretty convenient.) [12:47:17] I imagine that would be the case for most users, but the read function can be hardcoded if it’s a QID… I look forward to seeing the proposal! 😎 (re @u99of9: For me it's more important that I can select by typing "Fe". So if it's an enum, the search would need to be decent.) [12:50:13] You mean we could have a read function on an enum instead of a dropdown? And it would return a ZID? [12:51:45] I didn't think that possible. And doesn't it defeat the point of having an enum in the first place? [12:52:32] ... Anyway, pumpkin time for me! [21:39:08] 🤔 returning a ZID may be the problem, because References… 😏 (re @u99of9: You mean we could have a read function on an enum instead of a dropdown? And it would return a ZID?) [22:07:32] It’s only one of the points… We didn’t have dropdowns until after [[Z16098]]. It is odd, though, that specifying a type does not then restrict the References available via the selector to objects of that type (unlike functions, which are restricted when the function call type is selected). (re @u99of9: I didn't think that possible. And doesn't it defeat the point of [22:07:32] having [22:07:33] an enum in the first place?)