thiemowmde added a comment.

In addition to a few more specific comments I left on the Gerrit patches, here is what I think about the different approaches:

LexemeIdHtmlFormatter registers a formatter via the existing registry infrastructure Wikibase provides (namely "formatter-factory-callback"). This formatter can exclusively turn LexemeId objects into HTML strings. This formatter is automatically used in almost all cases we care about (LexemeId references in statements, special pages, even summary lines, I believe).

Note there was already a LexemeIdHtmlFormatter. The patch just replaces it with an other one that does not hard-code so much knowledge, but relies on a message instead.

I like this approach very much because it is so self-contained. I suggest to implement this no matter how we are going to implement derived labels (see T175030) later. The only detail we need to think about is a proper caching layer for this formatter (including prefetching), to avoid fetching possibly hundreds of Lexemes via an EntityLookup, which is what the code in the patch currently does.


The approach presented in is not different, but builds on top of the first. It still is just a "formatter-factory-callback" utilizing the existing ….datatypes.php infrastructure.

It introduces the concept of "primary" and "secondary labels" that come in pairs. The patch starts using this concept in a single place in the LexemeIdHtmlFormatter. At this point this is not much more but some formatter logic factored out into a separate class. The only difference users will see is that the messages translators are going to see are constructed in an other, more modular way.

As the patch is now, it does not even need the interfaces in Wikibase. This can be seen in the code introduced there is not used in Wikibase. I believe the "primary/secondary label" concept is meant to be used in more places. But at this point I can not tell where.

What the patches don't cover (possibly because of this tasks wording) are:

  • How to put derived Lexeme labels, descriptions, and "aliases" a.k.a. "secondary labels" (whatever that is on a Lexeme, maybe the Forms?) into wb_terms and search indexes?
  • Is an EntityIdFormatter (possibly a plain text one) enough to have proper Lexeme labels in RDF exports?



To: thiemowmde
Cc: thiemowmde, gerritbot, Aklapper, WMDE-leszek, Adrian1985, Cpaulf30, Lahi, Gq86, Baloch007, Darkminds3113, Lordiis, Cinemantique, GoranSMilovanovic, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, LawExplorer, Lewizho99, Maathavan, Wikidata-bugs, aude, Darkdadaah, Mbch331
Wikidata-bugs mailing list

Reply via email to