v3.1.0+
| Status: | effective |
| Progress: | 100% |
| Version: | 3.1.0+ |
This is the help page on schema type CLASS_CONSTRAINT_SCHEMA.12.
Objective
The CLASS_CONSTRAINT_SCHEMA schema type defines constraint definitions that can be assigned to a class (aka. category) using the Constraint schema property.
Naming convention
To easily identify pages that contain a constraint schema it is suggested to use smw/schema:Constraint:... as naming convention.
Properties
typedefines the type and is fixed toCLASS_CONSTRAINT_SCHEMAconstraintsthe section that contains constraints definitionstagssimple tags to categorize a schema
Example
{
"type": "CLASS_CONSTRAINT_SCHEMA",
"constraints": {
...
},
"tags": [
"class constraint",
"..."
]
}
Constraint properties
mandatory_properties(array) specifies mandatory propertiesshape_constraint(array) specifies shapes of properties and dependent characteristicspropertyspecifies the related propertyproperty_typespecifies expected type of the propertymax_cardinalityspecifies the maximum number of values a property can contain for the given contextmin_textlengthspecifies the minimum length of the characters expected for values assigned to the property
custom_constraint(object) specifies non-schema specific custom constraints implementations
Extending constraints
- General introduction on how to extend a constraint in Semantic MediaWiki
- How to register a custom constraint using the
custom_constraintproperty
Validation
/data/schema/class-constraint-schema.v1.json
See also[edit]
References
- ^ Semantic MediaWiki: GitHub pull request gh:smw:4033
- ^ Semantic MediaWiki: GitHub issue gh:smw:4032