Page MenuHomePhabricator

[REPO][SW] Wikibase API should support adding change tags
Open, Needs TriagePublic

Description

This basically involves adding support for tags parameter. It would be useful for gadgets and user scripts (see request).

See also T97720: Add a tags parameter to API modules creating a logentry.

  • wbcreateclaim
  • wbcreateredirect
  • wbeditentity
  • wblinktitles
  • wbmergeitems
  • wbremoveclaims
  • wbremovequalifiers
  • wbremovereferences
  • wbsetaliases
  • wbsetclaim
  • wbsetclaimvalue
  • wbsetdescription
  • wbsetlabel
  • wbsetqualifier
  • wbsetreference
  • wbsetsitelink

Event Timeline

I am glad that someone else shares the idea that it should be possible to set tags manually.

Here is a list of API actions which need to be able to set tags:

  • action=wbcreateclaim
  • action=wbcreateredirect
  • action=wbeditentity
  • action=wblinktitles
  • action=wbmergeitems
  • action=wbremoveclaims
  • action=wbremovequalifiers
  • action=wbremovereferences
  • action=wbsetaliases
  • action=wbsetclaim
  • action=wbsetclaimvalue
  • action=wbsetdescription
  • action=wbsetlabel
  • action=wbsetqualifier
  • action=wbsetreference
  • action=wbsetsitelink

Makes sense to me.
Do other modules outside Wikibase already allow it?

There currently seem to be at least two workarounds for this missing feature:

@darthmon_wmde I’ve already started working on this (as part of Wikidata Bridge task T227003), so I’m not sure it makes much sense to unassign me…

To clarify: for Wikidata Bridge we likely only need support in wbeditentity, but the most reasonable implementation (as far as I can tell) ends up adding support to almost all other modules as well. The exception are modules that create a redirect rather than a regular entity edit – I’ll leave those aside for now. (Also, I’m not implementing this for modules outside of Wikibase, i. e. WikibaseLexeme.)

Change 528221 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseLexeme@master] Add $tags parameter to {Form,Sense}Store::saveEntity()

https://gerrit.wikimedia.org/r/528221

Change 528222 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Add $tags parameter to EntityStore, EditEntity

https://gerrit.wikimedia.org/r/528222

Change 528223 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Add tags parameter to editing API modules

https://gerrit.wikimedia.org/r/528223

Actually, let’s split this task up after all. Disregard the gerritbot comments, I’ll move those patches to one of the subtasks.

We have added a few recently as part of the work to tag all edits made through the UI. Is there anything missing still? If yes can we clarify what exactly is missing?

@Lydia_Pintscher I'm not sure if this is the point of this ticket but: I am trying to add a tag when performing wbcreateclaim and get the following error:
​​

code: "badtags"
disallowedtags:
  - "Wikidata for Firefox 🦊" 
info: 'The tag "Wikidata for Firefox 🦊" is not allowed to be manually applied.'
​​

Is this not how tags should be used? what should I do?

The tag must be valid. Your tag is not supported. The list of supported tags is on https://www.wikidata.org/wiki/Special:Tags.
If you need the tag for an application, request it on https://www.wikidata.org/wiki/Wikidata:Administrators%27_noticeboard.

Note that support in one of the remaining APIs, wblinktitles, is needed for a Content Translation feature (T335256).

@Ifrahkhanyaree_WMDE: If I understand correctly, maintenance of the Action API is within the scope of Wikibase Reuse Team; do you plan to implement this?

We just spoke about this in our call but just so we have it in written - we're not planning to work on it anytime soon and we're hoping to clarify the next steps regarding Action API/REST API within the next few weeks

Lucas_Werkmeister_WMDE renamed this task from Wikibase API should support adding change tags to [REPO][SW] Wikibase API should support adding change tags.Apr 12 2024, 12:33 PM