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
type
defines the type and is fixed toCLASS_CONSTRAINT_SCHEMA
constraints
the section that contains constraints definitionstags
simple 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 characteristicsproperty
specifies the related propertyproperty_type
specifies expected type of the propertymax_cardinality
specifies the maximum number of values a property can contain for the given contextmin_textlength
specifies 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_constraint
property
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