Page MenuHomePhabricator

add support for "MediaInfo" as value for "allowed entity types"-constraint
Closed, ResolvedPublic3 Estimated 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)

Event Timeline

WMDE-leszek set the point value for this task to 3.May 28 2019, 1:04 PM

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).