مساعدة:بوابة محددات الخواص
محددات الخواص هي قواعد على الخواص تحدد كيفية استخدامها. نموذج ويكي بيانات مرن جدا: حيث لا شيء يمنعك من إضافة Universe (Q1) كقيمة لخاصية head of government (P6). ومع ذلك، يمكن لمحددات الخواص أن يخبرك أن head of government (P6) هو عادة إنسان.
المحددات أو القيود هي تلميحات، وليس قيود صارمة, والمقصود منها مساعدة أو توجيه المحررين. ويمكن أن يكون لها استثناءات: على سبيل المثال، انتخبت بلدة Talkeetna (Q668224) القط Stubbs (Q7627362) عمدة لها.
Some constraint types, currently one-of constraint and allowed qualifiers constraint, are also used to provide better suggestions when editing statements.
Note: Technically a property constraint is a statement (on a property) of a particular constraint type, specified via property constraint (P2302). So strictly speaking constraint and constraint type refer to two different things, for the sake of brevity this page however sometimes refers to constraint types simply as constraints.
قيود شائعة
Datatype-independent constraints
Constraints to restrict where a property may be added
- property scope constraint
- يجب استخدام هذه الخاصية فقط لنطاقات معينة (القيمة الرئيسية لبيان، في مرجع، كمؤهل).
- allowed-entity-types constraint
- يجب استخدام هذه الخاصية فقط على أنواع معينة من الكيانات، مثال: Wikidata property example (P1855) (خصائص).
- subject type constraint
- يجب أن تحتوي العناصر التي تحتوي على هذه الخاصية على نوع معين، مثال: يجب أن تكون العناصر ذات date of birth (P569) instance of (P31) human (Q5) أو animal (Q729).
- conflicts-with constraint
- يجب ألا تحتوي العناصر التي تحتوي على هذه الخاصية على خصائص أو بيانات أخرى، أمثلة: sex or gender (P21) تتعارض مع author (P50)، والتي تتعارض بدورها مع instance of (P31)human (Q5).
- item-requires-statement constraint
- يجب أن تحتوي العناصر التي تستخدم هذه الخاصية أيضا على بيانات أخرى، على سبيل المثال، يجب أن تحتوي العناصر ذات killed by (P157) على place of death (P20) وdate of death (P570) وmanner of death (P1196)homicide (Q149086).
- contemporary constraint
- يجب أن تتعايش مع هذه الخاصية والقيم لهذه الخاصية في وقت ما، أمثلة: mother (P25) ،country of citizenship (P27).
- label in language constraint
- Items using this property should also have a label in a certain language. For example, items with Vietnamese middle name (P8500) should have a Vietnamese label.
- description in language constraint
- Items using this property should also have a description in a certain language.
- lexeme requires language constraint
- This property should be used on lexemes in a certain language. For example, Gran Enciclopèdia Catalana ID (former scheme) (P1296) should be used on Catalan (Q7026) lexemes.
- lexeme requires lexical category constraint
- …
- lexeme value requires lexical category constraint
- …
Constraints regarding the number of values
- single-value constraint
- يجب ألا تحتوي العناصر على أكثر من بيان واحد مع هذه الخاصية، غالبا ما يُستخدَم مع المعرفات، ولكن أيضا العديد من الخصائص الأخرى: على سبيل المثال، لا يملك الأشخاص عادةً سوى place of birth (P19) وplace of death (P20) واحد.
- single-best-value constraint
- يجب أن تحتوي العناصر على بيان "أفضل" واحد مع هذه الخاصية، غالبا ما يتم استخدام الخصائص التي يمكن أن تتغير بمرور الوقت: على سبيل المثال، تحتوي المدن والبلدان عادةً على head of government (P6) حالي واحد.
- multi-value constraint
- يجب أن تحتوي العناصر على أكثر من بيان واحد مع هذه الخاصية (أو لا شيء)، نادرا ما يتم استخدامه، ولكن الأمثلة تشمل cast member (P161) وhas tense (P3103) وhas grammatical mood (P3161).
- distinct-values constraint
- ويُعرَف أيضا باسم قيمة فريدة وقيمة مميزة، يجب ألا يشارك أي عنصرين قيمة لهذه الخاصية، يجب أن تكون قيمة كل عنصر فريدة عبر جميع البيانات لهذه الخاصية في جميع كل ويكي بيانات، تمتلك جميع خصائص المعرفات تقريبا هذا القيد; لأن المعرف (رقم دولي معياري للكتاب، ومعرف فريبيس، ...) يجب أن يحدد الكيان بشكل فريد، تشمل الأمثلة الأخرى flag (P163) وanthem (P85).
Constraints regarding qualifiers
- allowed qualifiers constraint
- يجب ألا تحتوي بيانات هذه الخاصية على أية مؤهلات بخلاف المذكورة، أمثلة: continent (P30) بمؤهلات start time (P580) وend time (P582) وFreebase ID (P646) بدون أية مؤهلات على الإطلاق.
- required qualifier constraint
- يجب أن تحتوي بيانات هذه الخاصية على كل المؤهلات المدرجة، مثال:stock exchange (P414) مع ticker symbol (P249) وstart time (P580).
Constraints regarding references
- citation needed constraint
- يجب أن تحتوي بيانات هذه الخاصية على مرجع واحد على الأقل، مثال: خصائص من المرجح الطعن عليها.
Datatype-specific constraints
Constraints for datatype item/entity
- value-type constraint
- يجب أن تحتوي قيم هذه الخاصية على نوع معين، مثال: mother (P25) يجب أن تكون instance of (P31) human (Q5) أو animal (Q729).
- one-of constraint
- يجب أن تكون قيم هذه الخاصية واحدة من مجموعة معينة من العناصر، مثال: يجب أن تكون driving side (P1622) إما left (Q13196750) أو right (Q14565199).
- none-of constraint
- لا ينبغي أن تكون قيم هذه الخاصية واحدة من مجموعة معينة من العناصر، مثال: يجب ألا تكون instance of (P31) woman (Q467).
- value-requires-statement constraint
- ويُعرَف أيضا باسم البيان المستهدف المطلوب، يجب أن تحتوي قيم هذه الخاصية أيضا على بيانات أخرى، على سبيل المثال، يجب أن تحتوي قيم screenwriter (P58) على sex or gender (P21) وoccupation (P106)screenwriter (Q28389).
- symmetric constraint
- يجب أن تكون البيانات التي تستخدم هذه الخاصية موجودة دائما في كلا الاتجاهين، أمثلة: sibling (P3373) ،twinned administrative body (P190).
- inverse constraint
- يجب أن تحتوي البيانات التي تستخدم هذه الخاصية دائما على بيان معكوس، أمثلة: father (P22)/mother (P25) مع child (P40).
- complex constraint value label
- Values for this property have to have a label in a specific language that matches a specific format.
Constraints for Quantity
- integer constraint
- يجب أن تكون قيم هذه الخاصية أعدادا صحيحة بدون علامات عشرية.
- allowed units constraint
- يجب أن تستخدم قيم هذا البيان وحدات معينة فقط (أو لا شيء)، أمثلة:term length of office (P2097) (الوحدة: year (Q577))، population (P1082) (لا توجد وحدات).
- no-bounds constraint
- يجب ألا تُستخدَم قيم هذه الخاصية الحدود العليا والسفلى، وينطبق هذا على معظم الخصائص غير الفيزيائية بنوع البيانات كمية، والذي لم يتم تعريف مفهوم عدم اليقين فيه.
- range constraint
- جب أن تكون قيم هذه الخاصية ضمن نطاق أو فاصل معين، أمثلة:flattening (P1102) دائما ما بين 0 و 1، ويجب ألا يكون UTC date of spacecraft launch (P619) قبل .
- difference-within-range constraint
- ويُعرَف أيضا باسم الفرق داخل النطاق، يجب أن يكون الفرق بين قيم هذه الخاصية لخاصية أخرى ضمن نطاق أو فاصل معين، على سبيل المثال، يجب أن يتراوح الفرق بين date of birth (P569) وdate of death (P570) بين 0 و150 عاما.
Constraints for Time
- range constraint
- Values for this property should be within a certain range or interval. Examples: flattening (P1102) is always between 0 and 1, and UTC date of spacecraft launch (P619) should not be before .
- difference-within-range constraint
- aka. difference within range. The difference between values for this property and for another property should be within a certain range or interval. For example, the difference between date of birth (P569) and date of death (P570) should be between 0 and 150 years.
Constraints for string-based datatypes
The constraint types listed in this section can be used for properties that have a string-based datatype.
- format constraint
- يجب أن تكون قيم هذه الخاصية بتنسيق معين، غالبا ما تُستخدَم للمعرفات (بطول ن أرقام، تبدأ بحرف معين، تتكون من أرقام، …).
Constraints for Commons links
- Commons link constraint
- يجب أن تكون قيم هذا البيان روابط صالحة إلى ويكيميديا كومنز، أمثلة: image (P18) (نطاق "الملف")، Commons category (P373) (نطاق "التصنيف").
أنواع المحددات
العديد من المحددات لديها قوالب محددة مسبقاً يتم سردها في Help:Property constraints/list of constraints
تعليمات الإستخدام
يتم عرض تقارير القيد لجميع المستخدمين المسجلين عند زيارتهم لصفحة الكيان.
يمكنك أيضاً التحقق من جميع المحددات لعنصر ويكي بيانات في Special:ConstraintReport، ويمكنك مشاهدة تقرير للمخالفات على كافة ويكي بيانات في صفحة: Wikidata:Database reports/Constraint violations.
محددات نوع العناصر
هناك عنصر لكل نوع من المحددات على سبيل المثال subject type constraint (Q21503250).
بيانات المحددات على الخواص
يتم تحديد قيود خاصية على أنها بيانات على الخاصية، باستخدام property constraint (P2302) وعنصر نوع القيد، على سبيل المثال: sibling (P3373)property constraint (P2302)symmetric constraint (Q21510862)، يتم تجاهل البيانات الموقوفة; لذا فإن تغيير ترتيب بيان القيد إلى "موقوف" طريقة ملائمة لتعطيل القيد مؤقتا دون إزالته تماما
معلمات القيود
العديد من المحددات شكلية مثل: واحدة من لديها قائمة بالقيم المسموح بها، والنوع يحتوي على النوع، إلخ. وتسمى هذه الإعدادات التي تهيئ المحددات أو القيود "معلمات" parameters.
يتم تحديد معلمات المحددات كتصفيات على البيان. على سبيل المثال:
relation (P2309) ⟨ instance of (Q21503252) ⟩
class (P2308) ⟨ human (Q5) ⟩
هناك العديد من الوسائط العامة التي يمكن إضافتها إلى أي بيان قيد:
- ; constraint status (P2316)
- باستخدام القيمة mandatory constraint (Q21502408)، يمكن استخدام هذا الوسيط لتعليم القيد على أنه إلزامي، انتهاكات القيود الإلزامية أشد من الانتهاكات غير الإلزامية.
- exception to constraint (P2303)
- يسرد استثناءات معروفة للقيد، على العناصر المدرجة تحت هذا الوسيط، لا يتم فحص القيد.
- group by (P2304)
- يحتوي على خاصية حسب القيم التي يجب أن يتم تجميع انتهاكات القيد بها: أي عندما تسرد تقارير قاعدة البيانات انتهاكات لقيد (لكافة العناصر)، يتم تجميع العناصر ذات الانتهاكات حسب قيمتها للخواص الواردة في الوسيط group by (P2304). (لا يستخدم ملحق القيود هذا الوسيط.)
- constraint scope (P4680)
- يحدد في أي جزء من البيان تنطبق القيود، باستخدام القيم الخاصة الثلاث constraint checked on main value (Q46466787) وconstraint checked on qualifiers (Q46466783) وconstraint checked on references (Q46466805)، استخدم أية مجموعة من هذه القيم لتحديد مكان التحقق من القيد، إذا لم يتم تحديد الوسيط، يعتمد النطاق الافتراضي على نوع القيد. (لاحظ أن تقارير قاعدة البيانات تسرد الانتهاكات على القيمة الرئيسية لبيان فقط.)
- exception to constraint (P2303): Lists known exceptions to the constraint. On the items listed under this parameter, the constraint is not checked.
- group by (P2304): Contains a property by the values of which constraint violations should be grouped. That is, when the database reports list violations for a constraint (for all items), the items with violations are grouped by the value they have for the property given in the group by (P2304) parameter. (The constraints extension does not use this parameter.)
- constraint scope (P4680): Specifies in which part of a statement the constraints applies, using the three special values constraint checked on main value (Q46466787), constraint checked on qualifiers (Q46466783) and constraint checked on references (Q46466805). Use any combination of these values to specify where a constraint should be checked. If the parameter is not specified, the default scope depends on the constraint type. (Note that the database reports only list violations on the main value of a statement.)
- constraint clarification (P6607): Provides a simple explanation for the purpose of the constraint (why it exists) and recommended actions to resolve the constraint.
When constraints aren’t checked
Each individual constraint can list exceptions in its constraint parameters (see above); on any statements of that item, that constraint will not be checked at all. (There is currently no mechanism for specifying other entity types as exceptions, or for listing exceptions in a different way.)
On properties like Wikidata property example (P1855), Wikidata property example for properties (P2271), etc., as defined in wgWBQualityConstraintsPropertiesWithViolatingQualifiers
, all constraint checks on qualifiers are skipped. For these properties, qualifiers have a different meaning than usual: they’re more similar to main statements than qualifiers of that statement, so it doesn’t really make sense to check constraints on those qualifiers.
WikibaseQualityConstraints only uses normal-rank and preferred-rank constraint statements and ignores deprecated-rank ones, so setting a constraint’s rank to deprecated can be used to “hide” it from WikibaseQualityConstraints. (KrBot uses all constraint statements regardless of rank.)
محددات مخصصة
مع بعض المعرفة في سباركل يمكن للمرء أن يجد القيود المعقدة جدا لبعض الخواص، علاوة على المحددات المذكورة أعلاه. مزيد من المعلومات متاحة في Template:Complex constraint. انظر أيضا قائمة خواص تستخدم محددات معقدة.
See also
- Wikidata:Curious Facts - a tool that displays random constraint violations