Help:Porth cyfyngiadau eiddo/Math gwerth
This is the documentation page for a particular constraint type. See Help:Property constraints portal for a general overview of property constraints. |
Mae value-type constraint (Q21510865) yn nodi y dylai gwerthoedd eiddo penodol fod â math penodol. Gelwir hyn hefyd yn ystod yr eiddo.
Er enghraifft, dylai gwerthoedd ar gyfer mother (P25) fod yn instance of (P31) human (Q5) neu animal (Q729), a dylai gwerth space launch vehicle (P375) fod yn 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). (If an indirect relation should not be permitted, value-requires-statement constraint (Q21510864) can be used.) Longish paths sometimes time-out and don't work in all tools.
Os na nodir constraint scope (P4680), caiff y cyfyngiad hwn ei wirio ym mhob man.
Camau gweithredu posibl
Mae sawl ffordd bosibl o fynd i'r afael â thoriad y cyfyngiad hwn:
- Mae'n bosibl na ddylai'r eitem gael y datganiad o gwbl, ac y dylid dileu'r datganiad.
- Mae'n bosibl bod y gwerth ar goll y datganiad cywir instance of (P31) neu ddatganiad subclass of (P279).
- 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).
- Mae'n bosibl bod yr eitem yn eithriad prin, ond dilys i'r cyfyngiad, ac ni ddylid gwneud dim.
Paramedrau
This constraint has two parameters (both mandatory):
- relation (P2309)
- Must be instance of (Q21503252), subclass of (Q21514624), or instance or subclass of (Q30208840). Describes whether the item should be an instance of the class(es), or a subclass of it/them, or whether both are allowed. This parameter must only be given once.
- class (P2308)
- Lists the classes that are allowed for the value. Each class must be an item ID (no value Help or unknown value Help is not permitted). If more than one class is specified, the constraint is satisfied as long as the value has at least one of these types.
Enghreifftiau
Enghraifft 1
Values for adjacent station (P197) should be instance of station (Q719456).
property constraint |
| ||||||||||||||
add value |
Enghraifft 2
Values for space launch vehicle (P375) should be subclass of launch vehicle.
property constraint |
| ||||||||||||||
add value |
Templed
When the constraint is set to the property, the following template is automatically displayed in the property talk page. The template is created by Module:Constraints using {{Constraint}}
, invoked from {{Property documentation}}
. Translations are defined at Module:i18n/constraints.
List of violations of this constraint: Database reports/Constraint violations/P197#Value type Q228332, Q28109487, SPARQL
Rhestrau
Lists of properties which are set value type constraint.
- Category:Properties with value only constraints
- SPARQL query - click the execute button at the linked page to see the query result.