This is an announcement for a breaking change to the pageterms submodule of
the query API module, which only affects Wikibase repository wikis. If you
do not use that API module, or only use it on client wikis (e. g.
Wikipedias) and not on repository wikis (Wikidata, Wikimedia Commons), you
can ignore this message.
For years, the pageterms
<https://www.wikidata.org/wiki/Special:ApiHelp/query%2Bpageterms> API
module has served a double role: on client wikis, it returned the “terms”
(Label, Description, Aliases) of the Wikidata Item linked to the given
page(s), whereas on repo wikis, it would return the terms of the Item (or
other Entity) on that page itself. For example, querying for the Label of
Wikipedia:Village pump on English Wikipedia
<https://en.wikipedia.org/w/api.php?action=query&prop=pageterms&titles=Wikipedia%3AVillage%20pump&wbptterms=label>
would return “Project:Village pump” (the Label of Q16503
<https://www.wikidata.org/wiki/Q16503>), but querying for the Label of
Wikidata:Project chat on Wikidata
<https://www.wikidata.org/w/api.php?action=query&prop=pageterms&titles=Wikidata:Project%20chat&wbptterms=label>
would not return anything, even though that page is linked to the same Item
– you would have to query for the Label of Q16503
<https://www.wikidata.org/w/api.php?action=query&prop=pageterms&titles=Q16503&wbptterms=label>
instead. This behavior is inconsistent and also mixes repo and client
concerns in a way that makes the Wikibase code harder to maintain.
To resolve this, we introduced a new entityterms
<https://www.wikidata.org/wiki/Special:ApiHelp/query%2Bentityterms> API
module (a submodule of the query module, just like the pageterms module)
which has the same behavior as the pageterms module currently has for Item
(or other Entity) pages, and which is only available on repo wikis. If you
want to get the terms of Q16503, you can now use
action=query&prop=entityterms&titles=Q16503
<https://www.wikidata.org/w/api.php?action=query&prop=entityterms&titles=Q16503>
instead of action=query&prop=pageterms&titles=Q16503
<https://www.wikidata.org/w/api.php?action=query&prop=pageterms&titles=Q16503>.
(You can also use wbgetentities
<https://www.wikidata.org/wiki/Special:ApiHelp/wbgetentities>, which gives
you much more control over the returned data; pageterms/entityterms may be
faster and can also be combined with other submodules of the query module.)
On or shortly after 5 August 2020, we will remove the special repo behavior
of the pageterms module, and it will then behave just like it always has on
client wikis, and return the terms of the Item linked to a page, not the
terms of the Item (or other Entity) on a page. (Because the new API module
is already available on Wikidata, and you can start using it immediately,
we are not making this pageterms behavior change available on Test Wikidata
significantly before that date.)
If you have any issue or question, feel free to leave a comment at T257658
<https://phabricator.wikimedia.org/T257658>. For more information, see also
T115117 <https://phabricator.wikimedia.org/T115117>, T255882
<https://phabricator.wikimedia.org/T255882> and T256255
<https://phabricator.wikimedia.org/T256255>.
Cheers,
Lucas
--
Lucas Werkmeister (he/er)
Full Stack Developer
Wikimedia Deutschland e. V. | Tempelhofer Ufer 23-24 | 10963 Berlin
Phone: +49 (0)30 219 158 26-0
https://wikimedia.de
Imagine a world in which every single human being can freely share in the
sum of all knowledge. Help us to achieve our vision!
https://spenden.wikimedia.de
Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e. V.
Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter
der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt für
Körperschaften I Berlin, Steuernummer 27/029/42207.