[Wikidata-bugs] [Maniphest] [Updated] T185332: Investigation: How to make it possible to format a Lexeme used in a statement (days: 4)

2018-02-02 Thread thiemowmde
thiemowmde added a comment.
I'm bringing this up because this ticket is linked to the "derived labels" ticket T175030, but I do not think this ticket here will help in any way with that. Having a better LexemeIdFormatter will probably not help much when it comes to the search integration. And RDF is even unrelated to HTML, so having a better HTML formatter can't help there either.

This is not an issue we need to care about now. What the first patch proposes is totally fine. I think at this point we should only care about T184997 and get it done (ideally with proper prefetching in place, which is currently missing).TASK DETAILhttps://phabricator.wikimedia.org/T185332EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: thiemowmdeCc: 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
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Updated] T185332: Investigation: How to make it possible to format a Lexeme used in a statement (days: 4)

2018-02-02 Thread thiemowmde
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

https://gerrit.wikimedia.org/r/406306 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.

EntityPresenter

The approach presented in https://gerrit.wikimedia.org/r/406608 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 https://gerrit.wikimedia.org/r/406612: 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?
TASK DETAILhttps://phabricator.wikimedia.org/T185332EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: thiemowmdeCc: 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
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs