As a tool developer, I want to include HTML from various API modules in my tool in order to provide output consistent with Wikidata, without having to post-process it.
Problem:
Wikibase returns entity links with relative URLs (e. g. /wiki/Q1, /wiki/Property:P1) from several API modules: at least wbformatvalue and compare. Those links don’t point to the correct location when used on other domains.
Example:
- https://www.wikidata.org/w/api.php?action=wbformatvalue&format=json&generate=text%2Fhtml&datavalue=%7B%22type%22%3A%22wikibase-entityid%22%2C%22value%22%3A%20%7B%22id%22%3A%22Q1%22%7D%7D&datatype=wikibase-item
- https://www.wikidata.org/w/api.php?action=compare&format=json&fromrev=7479865&torelative=prev&prop=diff
- [wbformatentities workaround](https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/repo/includes/Api/FormatEntities.php#L116-L146) (similar to wbformatvalue)
- [tool-speedpatrolling workaround](https://phabricator.wikimedia.org/R2469:bf4defdf3f3f1455abd8b65d6dbc384e0d4a6366) (uses action=compare)
- affected tool: WikiLabels (uses action=compare)
Acceptance criteria:
- The Wikibase API can return full URLs.
Open questions:
- The Wikibase editing UI also uses at least wbformatvalue, and there the relative URLs work. Do we want to keep it this way by default?