Help:Property constraints portal/Subject class/cs
This is the documentation page for a particular constraint type. See Help:Property constraints portal for a general overview of property constraints. |
subject type constraint (Q21503250) specifies that items with a given property should have a given type. This is also known as the domain of a property.
For example, items with date of birth (P569) should be instance of (P31) human (Q5) or animal (Q729), and items with sRGB color hex triplet (P465) should be subclass of (P279) color (Q1075).
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, item-requires-statement constraint (Q21503247) can be used.)
If no constraint scope (P4680) is specified, this constraint is only checked on the main value of a statement.
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 item is missing the right instance of (P31) or subclass of (P279) statement.
- It’s possible that the item 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 with population (P1082) was instance of (P31) big city (Q1549591), but big city (Q1549591) was missing subclass of (P279) city (Q515), then this could result in a violation on the item even though the error is actually on big city (Q1549591).
- It’s possible that the item is a rare, but legitimate exception to the constraint, and nothing should be done.
Parametry
Toto omezení má dva parametry (oba jsou povinné):
- relation (P2309)
- Musí být instance of (Q21503252), subclass of (Q21514624), or instance or subclass of (Q30208840). Popisuje zda by daná položka neměla být instancí nebo podtřídou, nebo zda jsou možné obě možnosti. Tento parametr musí být zadán pouze jedinkrát.
- class (P2308)
- Vyjmenovává třídy, které by daní položka měla mít Každá třída musí být položkou (no value Help or unknown value Help nejsou povoleny).
Příklady
Příklad 1
Položka s vlastností place of birth (P19) by měla být instancí human, fictional character nebo animal.
property constraint |
| ||||||||||||||||||
add value |
Příklad 2
Položka s vlastností drug or therapy used for treatment (P2176) by měla být podtřídou disease.
property constraint |
| ||||||||||||||
add value |
Šablona
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 Template:Constraint, invoked from Template:Property documentation. Translations are defined at Module:i18n/constraints.
List of violations of this constraint: Database reports/Constraint violations/P512#Type Q5, Q95074, SPARQL
Seznamy
Lists of properties which are set type constraint.
- Category:Properties with constraints on type
- SPARQL query - click the execute button at the linked page to see the query result.