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)