Help:プロパティ制約/値のクラス

This page is a translated version of the page Help:Property constraints portal/Value class and the translation is 100% complete.

value-type constraint (Q21510865)は、所与のプロパティの値が所与の型を持つように指定します。これは、プロパティの「値域」(range)とも呼ばれます。

例えば、 mother (P25)の値はinstance of (P31) human (Q5) または animal (Q729)であるべきで、space launch vehicle (P375)の値はsubclass of (P279) launch vehicle (Q697175)であるべきです。

subclass of (P279)によるサブクラス関係が考慮されます。項目がbuilding (Q41176)のインスタンスであるべきという制約が課されているときに、項目がskyscraper (Q11303)のインスタンスであるならばそれは制約違反ではありません。なぜならば、subclass of (P279)としてskyscraper (Q11303)からbuilding (Q41176)へ通じているからです。(もし間接的な関係が許容されるべきでないならば、value-requires-statement constraint (Q21510864)を使うことができます。)長めのパスはときどきタイムアウトになり、あらゆるツールで機能しないことがあります。

constraint scope (P4680) が指定されていない場合、全ての場所においてこの制約をチェックします。

可能なアクション

この制約の違反に対処する方法はいくつかあります。

パラメータ

この制約には2つのパラメータがあります(両方とも必須)。

relation (P2309)
instance of (Q21503252)subclass of (Q21514624)またはinstance or subclass of (Q30208840)でなければなりません。その項目があるクラス(複数可)のインスタンス(分類を持つ)であるべきなのか、サブクラス(上位クラスを持つ)であるべきなのか、あるいはそのどちらでもよいのかを記述します。このパラメータは一度だけ与えられなければなりません。
class (P2308)
値に対して許容されるクラスを列挙します。各々のクラスは項目IDでなければなりません。(no value Helpまたはunknown value Helpは許容されません。)複数のクラスが指定されている場合、それらのうちいずれかひとつを持ちさえすれば制約は満たされます。


例1

adjacent station (P197)の値はstation (Q719456)のインスタンスであるべきです。

property constraint
  value-type constraint
class station
relation instance of
0 references
add reference


add value

例2

space launch vehicle (P375)の値はlaunch vehicleのサブクラスであるべきです。

テンプレート

プロパティに制約が設定されると、以下のテンプレートが自動でプロパティの議論ページに表示されます。このテンプレートは {{Property documentation}} から呼び出された {{Constraint}} を用いて Module:Constraints が作成します。翻訳の定義はModule:i18n/constraints をご参照ください。

Value type “entry point (Q228332), proposed railway station (Q28109487): This property should use items as value that contain property “instance of (P31)”. On these, the value for instance of (P31) should be an item that uses subclass of (P279) with value entry point (Q228332), proposed railway station (Q28109487) (or a subclass thereof). (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P197#Value type Q228332, Q28109487, SPARQL

一覧

値のクラス制約が設定されるプロパティの一覧。