This wiki is being moved to a new server and cannot be edited. Please sit tight. Thank you.

Help:Schema/Type/PROPERTY CONSTRAINT SCHEMA

From semantic-mediawiki.org
< Help:Schema‎ | Type
SchemaSchema/TypeHelp:Schema/Type/PROPERTY CONSTRAINT SCHEMA

This is the help page on schema type PROPERTY_CONSTRAINT_SCHEMA.1.

Objective

The PROPERTY_CONSTRAINT_SCHEMA schema type defines constraint definitions that can be assigned to a property 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 to PROPERTY_CONSTRAINT_SCHEMA
  • manifest_version
  • constraints the section that contains constraints definitions
  • tags simple tags to categorize a schema

Example

{
    "type": "PROPERTY_CONSTRAINT_SCHEMA",
    "constraints": {
        "allowed_namespaces": [
            "NS_USER"
        ]
    },
    "tags": [
        "property constraint"
    ]
}

Constraint properties

  • allowed_namespaces (array) specifies allowed namespaces
  • unique_value_constraint (boolean) specifies that values should be unique across the wiki, that the value is likely to be different (distinct) from all other items

Extending constraint properties

For details, please see the extending.constraint.md document.

Validation

/data/schema/property-constraint-schema.v1.json


See also[edit]

References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:3746