As an editor I want to query for normalized values for quantity values in order to find all values regardless of the unit they were entered with.
Problem:
On Wikidata we have a configuration that tells the Wikidata Query Service how to convert all kinds of units into a set of standard units. This is useful to be able to query for all Items with a length of X m regardless of it being entered in feet, kilometer or miles for example. On the Commons Query Service this configuration is not set up.
This can be seen when comparing the RDF output on a Wikidata Item (e.g. https://www.wikidata.org/wiki/Special:EntityData/Q513.ttl) for quantity statements (e.g. P2044) to the RDF output on MediaInfo entities (e.g. https://commons.wikimedia.org/wiki/Special:EntityData/M101311668.ttl). The latter is missing psn:P2044 triples.
BDD
GIVEN a query to the Commons Query Service
WHEN querying for quantity values
THEN normalized converted values are available where we have a conversion factor from the original value
Acceptance criteria:
- RDF output configuration for Wikimedia Commons includes the appropriate unit conversion configuration (WMDE's job)
- Commons Query Service has been configured to index normalized values to take unit conversion into account in the same way that the Wikidata Query Service does. (done by the WMF once WMDE has adjusted Wikimedia Commons Wikibase configuration)
Notes:
- The conversion table is here: https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/refs/heads/master/wmf-config/unitConversionConfig.json This is extracted every now and then from a script based on statements in Wikidata's Items. We probably want to use the same conversion table for both query services.
- The setup for Wikidata: https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/5f39c6b71bc2944423e3d4251286ce6d98961988/wmf-config/Wikibase.php#178
- Similar configuration can be set up for any Wikibase instance by adjusting unitStorage Repo Settings configuration option
- This likely requires a reload of the Commons Query Service. This is up to the search platform team to do later.
Original report:
On Wikidata when doing a query it's possible to do automatic unit conversion to SI units. So someone might have entered height in some funky unit like feet or nautical miles, but you can still query for it in meters. Conversion table at https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/refs/heads/master/wmf-config/unitConversionConfig.json
See for example on Wikidata https://w.wiki/3Fmq . Similar query on Commons returns empty fields, see https://tinyurl.com/yyfbsvgw (fixed) so looks like the automatic SI unit conversion is not yet working for Commons. Please enable/fix it.