adrianheine added a comment.

I know I made this point several times, but I haven't seen it addressed or 
debunked yet, so I'll continue to do so:

I think we limit ourselves by not allowing us to write PHP code specific for 
Wikidata. I think we make Wikibase worse by doing so. I think, by doing so, we 
make Wikidata not as great as it could be. This also leads us to not follow the 
open/closed principle on a module level. Instead, we introduce a vast amount of 
configuration options which allow modification of Wikibase while at the same 
time limiting users to what we imagined and bothered to implement.

From this follows (for Wikibase):

- QuantityValue parsing above a base line ( `explode( ' ', … )` ) should be 
supplied by Wikidata
- QuantityValue validation above what Wikibase itself needs to work should be 
supplied by Wikidata
- QuantityValue formatting above a base line ( `wfMessage( 
'wikibase-value-with-unit', $dv->amount, $dv->unit )->escaped()` ) should be 
supplied by Wikidata
- QuantityValue editing above a base line ( `'<input name="valueAndUnit" />'` ) 
should be supplied by Wikidata (if required)

In terms of Wikidata, I suggest the following:

- Translatable statements on items (using two specific properties) specify the 
short and long unit name for displaying in quantity values
- A statement on items marks them as being a unit (It takes a lot of work to 
implement filtering on top of this, but validating is simple)

This would lead to the following implementations:

- WikidataItemQuantityValueUnitParser: fetch unit item (by long unit name 
propval, short unit name propval, then label), store item URI
- WikidataItemQuantityValueUnitValidator: fetch unit item (by URI), make sure 
it is an unit item
- WikidataItemQuantityValueUnitFormatter: fetch unit item (by URI), show most 
appropriate name (long / short / label)
- For editing, Wikibase baseline seems to be enough


TASK DETAIL
  https://phabricator.wikimedia.org/T86528

REPLY HANDLER ACTIONS
  Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign 
<username>.

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: adrianheine
Cc: Aklapper, daniel, JanZerebecki, adrianheine, Snaterlicious, thiemowmde, 
JeroenDeDauw, aude, Tobi_WMDE_SW, Stryn, Smalyshev, Wikidata-bugs



_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to