Page MenuHomePhabricator

add support for "MediaInfo" as value for "allowed entity types"-constraint
Closed, ResolvedPublic3 Story Points

Description

Problem:
It is possible to restrict a Property to be used only on certain entity types. Currently we only support Item, Property, Lexeme, Sense and Form for this. We should add MediaInfo as well.
See also allowed entity types documentation.

Example:
Sample use on "Commons quality assessment (P6731) meaning the property should only be used on MediaInfo entities.

BDD
GIVEN a property with a constraint for allowed entity types
AND the scope is restricted to MediaInfo
WHEN this property is used on an Item, Property, Lexeme, Sense, or Form
THEN a constraint violation is shown

Acceptance Criteria

  • MediaInfo can be used as one of entity types that a Property can be restricted to.
  • Documentation on how to add a new entity types to the list is added to QualityConstraints repo (in README or separate doc)

Note:
Constraint checks are not run on MediaInfo entities at this point but with this we can at least discourage Commons-only properties from being used on Wikidata.

Implementation Notes

  • This is to be done in QualityConstraints extension
  • extension.json need to be touched (see WBQualityConstraintsWikibaseLexemeId configuration as an example).
  • ConstraintPrameterParser.php need to be touched (see parseEntityTypeItem() in that class)

Details

Related Gerrit Patches:
mediawiki/extensions/WikibaseQualityConstraints : masterFix 'MediaInfo' item name to Wikibase MediaInfo to avoid confusion

Event Timeline

Esc3300 created this task.May 26 2019, 6:41 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 26 2019, 6:41 AM
Restricted Application added a project: Wikidata. · View Herald TranscriptMay 26 2019, 6:42 AM
Lydia_Pintscher moved this task from Incoming to Ready to estimate on the Wikidata-Campsite board.
Lucas_Werkmeister_WMDE updated the task description. (Show Details)
WMDE-leszek set the point value for this task to 3.May 28 2019, 1:04 PM
alaa_wmde updated the task description. (Show Details)Jun 25 2019, 11:18 AM
noarave claimed this task.Jul 2 2019, 8:20 AM
Restricted Application added a project: User-Noarave. · View Herald TranscriptJul 2 2019, 8:20 AM

Change 520856 had a related patch set uploaded (by Noa wmde; owner: Noa wmde):
[mediawiki/extensions/WikibaseQualityConstraints@master] Fix 'MediaInfo' item name to Wikibase MediaInfo to avoid confusion

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

Change 520856 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Fix 'MediaInfo' item name to Wikibase MediaInfo to avoid confusion

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

This is done, isn’t it? Seems to be working on Wikidata, at least, as far as I can tell (see screenshot in T227865).

Lydia_Pintscher closed this task as Resolved.Jul 15 2019, 11:03 AM
Lydia_Pintscher added a subscriber: Lydia_Pintscher.

\o/