Status: | effective |
Progress: | 100% |
Version: | 3.2.0+ |
Table of Contents | |
---|---|
PROPERTY_GROUP_SCHEMA
is a schema type1 which allows you to define property groups. Once the schema is set up, each property listed in the group is automatically annotated with the special property "Is property group"Marks a category for holding properties belonging to a property group.
This schema-based method of managing property groups is a simple alternative to the category-based approach. The latter requires that you create a category, add the special property "Is property group"Marks a category for holding properties belonging to a property group to that category and finally, add the category to each relevant property. Note that where a property is accidentally assigned through both methods, the category-based approach takes precedence over any group definition found in PROPERTY_GROUP_SCHEMA
.
Objective[edit]
The PROPERTY_GROUP_SCHEMA
schema type defines property groups that help structure the browsing interface of a page.
Structure[edit]
The structure of this schema is defined by the following properties:
type
– defindes the schema typemanifest_version
– sets the version of the schema typedescription
– describes the entire group schemagroups
– identifies the section that contains group definitions..._group
– identifies an individual group (the name has to end with "_group")canonical_name
– sets the canonical lable for the groupmessage_key
– sets a system message key that can be used for translation and replaces the canonical label for the group if specifiedproperty_keys
– sets the property keys assigned to the group
tags
– sets simple tags to categorize a schema
Example[edit]
{
"type": "PROPERTY_GROUP_SCHEMA",
"description": "This property group schema serves as an example on how to structure it.",
"groups": {
"x_group": {
"canonical_name": "My properties X",
"message_key": "smw-property-group-label-...",
"property_keys": [
"MY_PROPERTY_XA",
"MY_PROPERTY_XB"
]
},
"y_group": {
"canonical_name": "My properties Y",
"message_key": "smw-property-group-label-...",
"property_keys": [
"MY_PROPERTY_Y"
]
}
},
"tags": [
"group",
"property groups",
"example",
"example group"
]
}
- Further live examples
- sandbox.semantic-mediawiki.org: Overview of pages using
PROPERTY_GROUP_SCHEMA
- sandbox.semantic-mediawiki.org: Migrate from SWM 3.1.x to SMW 3.2.x schema structure
Validation[edit]
The structure of this schema is validated by the following definition file for the schema structure: "property-group-schema.v1.json"
Notes[edit]
___REVID
for special property "Revision ID".2
When grouping user-defined properties, i.e. properties created on wiki, the name of the property needs to be used. However spaces within the property name need to be replaced with underscores to get the property key, e.g. property "Has status code" needs to be added as "Has_status_code".
Version history[edit]
- This feature was introduced with Semantic MediaWiki 3.1.0Released on 23 September 2019 and compatible with MW 1.31.0 - 1.33.x..1
- The schema structure was changed with Semantic MediaWiki 3.2.0Released on 7 September 2020 and compatible with MW 1.31.0 - 1.35.x..34
See also[edit]
- Help page on property grouping
- Help page on special property "Is property group"Marks a category for holding properties belonging to a property group
- Help page on special page "Browse"Shows all properties and their values annotated to a page
References
- a b Semantic MediaWiki: GitHub pull request gh:smw:3749
- ^ Semantic MediaWiki: GitHub issue gh:smw:4597
- a b Semantic MediaWiki: GitHub pull request gh:smw:4045
- a b Semantic MediaWiki: GitHub pull request gh:smw:4592