Page MenuHomePhabricator

Transclusion of lexeme forms from Wikidata
Open, Needs TriagePublicFeature

Description

Hello. I would propose the transclusion of lexeme forms from Wikidata.

That would help a lot in the maintenance of templates and categories for Wikipedias using inflected languages.

For example, I would like to use a genitive and sometimes a dative form of a noun (language: Slovene) in various templates. I would prefer to insert them by calling them from Wikidata. Otherwise, they have to be stored locally.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
TadejM reopened this task as Open.EditedFeb 10 2023, 10:58 PM

Hello. I'm reopening this request as the issue remains unresolved.

There is no option to directly call lexeme forms (mw.wikibase.lexeme.entity.form returns a table rather than a single form) and the available solutions to use them are only partial and improvised.

Please see https://www.wikidata.org/w/index.php?title=Wikidata:Project_chat&oldid=1831221889#Transcluding_lexemes

If you’re not happy with the existing on-wiki modules, you can improve them or write better ones. The Wikibase Lexeme Lua module provides all the information you need for that (you can iterate over all the forms of a lexeme and select the one(s) you need based on arbitrary criteria, e.g. presence of certain grammatical features); I don’t think the functionality you have in mind should be provided by WikibaseLexeme directly.

In particular, any function that’s supposed to return a single form, by any criteria other than the form ID, would have to be ambiguous: a lexeme can have any number of forms that are absolutely identical apart from their ID, so a request like “give me the nominative singular form of L1013827” is not well-defined.

Thank you for the reply.

I have started editing modules and will try to improve what is available but this requires knowledge of Lua and, unlike creating links which can be done by anyone, 1) it's a high barrier for many; 2) it makes an easy task complicated.

As to the function, I agree with that: It should be possible to invoke the form by its ID. This is also the reason why one would prefer to link directly rather than iterate: there may be circumstances when one wants to link directly to a specific form of several that are identical apart from their ID and the set of grammatical features.

You can load a form by its form ID using mw.wikibase.getEntity():

image.png (382×398 px, 30 KB)

Is there anything else left here or can we close this?

The request should remain open as the feature is still needed.

Ok can you please be clearer then what you'd still like to see based on what Lucas showed? To me at least it's not clear what's missing for you and why.

Of course. The request is to have simple wiki syntax to display the content of a form of the given lexeme stored in Wikidata in Wikipedia and other wiki projects (in the same sense as templates are transcluded) based on providing its ID. For example, one would write {{lf:Form ID}} (lf - lexeme form) or something similar and would get returned the content of the form with the provided ID.