Page MenuHomePhabricator

Add violation type to restrict which entity types a property can be used
Closed, ResolvedPublic5 Story Points

Description

Some properties are supposed to be used only on one or a few entity types. As an editor I want to be able to define which entity types a property can be used on so I can easily find cases where the property is used in a wrong context via the existing constraint system.

Violation message shown to the user on violating statements: "Entity type constraint: This property should only be used on "$entitytype"."
Constraint statement on the property: "property constraint" -> "entity type constraint" with qualifier "item of property constraint" -> "Wikibase item"/"Wikibase property"/…

Examples where this is likely to be used:

  • indicating that "property constraint" should only be used on properties
  • restricting "rhymes with" and similar properties to Lexemes

Details

Related Gerrit Patches:
mediawiki/extensions/WikibaseQualityConstraints : masterUse “Wikibase property” item instead of “Wikidata property”
mediawiki/extensions/WikibaseQualityConstraints : masterExtract EntityTypesParameter class
mediawiki/extensions/WikibaseQualityConstraints : masterUse separate settings for each entity type item ID
mediawiki/extensions/WikibaseQualityConstraints : masterAdd 'allowed entity types' constraint

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 8 2017, 2:03 PM
matej_suchanek rescinded a token.
Qse24h closed this task as a duplicate of T164723: New git repository: <repo name>.
Qse24h closed this task as a duplicate of T164723: New git repository: <repo name>.
Qse24h closed this task as a duplicate of T164723: New git repository: <repo name>.
Qse24h closed this task as a duplicate of T164723: New git repository: <repo name>.
Qse24h closed this task as a duplicate of T164723: New git repository: <repo name>.
Qse24h closed this task as a duplicate of T164723: New git repository: <repo name>.
Qse24h closed this task as a duplicate of T164723: New git repository: <repo name>.
Qse24h closed this task as a duplicate of T164723: New git repository: <repo name>.
Qse24h closed this task as a duplicate of T164723: New git repository: <repo name>.
Aklapper reopened this task as Open.May 9 2017, 10:21 AM
Lydia_Pintscher triaged this task as Low priority.Jun 11 2017, 6:25 PM
Lydia_Pintscher moved this task from incoming to ready to go on the Wikidata board.
abian added a subscriber: abian.Jun 12 2017, 3:54 PM

This constraint has no possible valid exceptions because, unlike the other constraints, this one does not depend on the data, but only on the namespace(s) where the property is used. Also, the namespace(s) for which a property is suitable is/are not expected to change.

I think that this constraint should be hard-configured as a part of every property at the time of its creation, just when the data type is defined, by selecting in which namespaces the property can be used (as a property/qualifier, not as a value).

  • (Main)
  • Property
  • ...

Implementing this constraint would obviously require a (single) development effort, but would also save a greater effort that, otherwise, would be regularly wasted in avoidable mistakes, violation detections and reversions.

Restricted Application added a subscriber: PokestarFan. · View Herald TranscriptJul 25 2017, 8:17 AM
Lydia_Pintscher renamed this task from Add entity type constraint? to Add violation type to restrict which entity types a property can be used.Apr 6 2018, 4:13 PM

I really don't want to be tiresome, but I don't see the advantages of letting users add statements in the wrong namespaces and enlarging the already enormous, Insufficiently reviewed lists of constraint violations. Such a restriction should never have exceptions. Shouldn't we directly prevent these edits?

Since we don't have enough knowledge about how the modeling for lexicographical data will look like I can't be sure enough that we can prevent these edits.

Ladsgroup moved this task from User Stories to In Progress on the Wikidata-Ministry-Of-Magic board.
Restricted Application added a project: User-Ladsgroup. · View Herald TranscriptApr 19 2018, 12:53 PM

Change 427687 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add 'allowed entity types' constraint

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

Change 429773 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Extract EntityTypeChecker class

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

Change 430606 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Use separate settings for each entity type item ID

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

Change 427687 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add 'allowed entity types' constraint

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

Change 429773 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Extract EntityTypesParameter class

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

Change 430606 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Use separate settings for each entity type item ID

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

Change 430621 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Use “Wikibase property” item instead of “Wikidata property”

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

Change 430621 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Use “Wikibase property” item instead of “Wikidata property”

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

I can haz example link? :)