Page MenuHomePhabricator

New constraint type to preclude property values belonging to specified classes
Closed, DeclinedPublic


A constraint type "none-of value-type constraint", that is an inverse of value-type constraint.

It is not currently possible to constrain the allowed values of a property so as to EXCLUDE all instances or subclasses of a given class. The existing "value-type constraint" specifies that values MUST be instances or subclasses of a given class, and the existing "none-of" constraint specifies INDIVIDUAL items that are NOT allowed as values, but neither of these allows the exclusion of specified classes of values.


  1. P31 has several large "none-of" constraints that attempt to exclude certain value classes (e.g., concertos) by listing all their members as "item of property constraint" (P2305). This approach leaves a maintenance task, is likely to miss new items, and in many cases it is simply impossible to list all the applicable values.
  2. All items claimed to be instances of "terminology" (Q8380731) or its subclasses should instead be claimed to be "part of" (P361) the same value, as the P31 statements create incorrect inferences (like "double dribble" (Q1242920) is a "language" (Q34770)). There are 262 direct or indirect subclasses of "terminology", far too many for a maintainable "none-of" constraint.

GIVEN a constraint on property P, with qualifiers "class" (P2308) = C and "relation" (P2309) = R
WHEN an item uses property P with value V
(R = "instance of" AND V is an instance of C or one of its subclasses)
(R = "subclass of" AND V is a subclass of C or one of its subclasses)
(R = "instance or subclass of" AND V is an instance or subclass of C or one of its subclasses)
THEN a constraint violation is triggered for the statement using property P


  • The constraint definition should accept (at least) the qualifiers "class" (P2308), "relation" (P2309), and "replacement property" (P6824).

Acceptance criteria:

  • Constraint violations are triggered as specified in BDD
  • The new constraint type is documented at Help:Property constraints portal (new subpage)

Original report:

(I modeled this task on T195178 and copied subscribers from there; my apologies if this isn't relevant to you.)