Help:Property constraints portal/Value class
value-type constraint (Q21510865) specifies that values of a given property should have a given type. This is also known as the range of a property.
For example, values for mother (P25) should be instance of (P31) human (Q5) or animal (Q729), and values for space launch vehicle (P375) should be subclass of (P279) launch vehicle (Q697175).
Subclass relations according to subclass of (P279) are taken into account: if a constraint demands that an item should be an instance of building (Q41176), it is not a violation if the item is an instance of skyscraper (Q11303), because there is a subclass of (P279) path from skyscraper (Q11303) to building (Q41176).
Possible actions
There are several possible ways to address a violation of this constraint:
- It’s possible that the item should not have the statement at all, and that the statement should be removed.
- It’s possible that the value is missing the right instance of (P31) or subclass of (P279) statement.
- It’s possible that the value has the right instance of (P31) or subclass of (P279) statement, but the linked item is missing a subclass of (P279) statement. For example, if an item had space launch vehicle (P375)Ariane 1 (Q18375), and the statement Ariane 1 (Q18375)subclass of (P279)Ariane (Q131535) existed, but the statement Ariane (Q131535)subclass of (P279)launch vehicle (Q697175) was missing, then this could result in a violation even though the error is actually neither on the item with the violation, nor on the linked value Ariane 1 (Q18375), but on Ariane (Q131535).
- It’s possible that the item is a rare, but legitimate exception to the constraint, and nothing should be done.
Parameters
This constraint has two parameters (both mandatory):
- relation (P2309)
- Either instance of (Q21503252) or subclass of (Q21514624). Describes whether the value should be an instance or a subclass of the class. This parameter must only be given once.
- class (P2308)
- Lists the classes that the value should have. Each class must be an item ID (no value Help or unknown value Help is not permitted).