Schema type PROPERTY GROUP SCHEMA

From semantic-mediawiki.org
< Help:Schema‎ | Type
SchemaSchema typesSchema type PROPERTY GROUP SCHEMA
Table of Contents

This is the help page on schema type PROPERTY_GROUP_SCHEMA.1 It allows to deploy property groupes without a user having to manually create categories and annotated them with special property "Is property group"Marks a category for holding properties belonging to a property group. 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 change with Semantic MediaWiki 3.2.0Released on 7 September 2020 and compatible with MW 1.31.0 - 1.35.x..23

However adding special property "Is property group"Marks a category for holding properties belonging to a property group to a category takes precedence over any group definition found in PROPERTY_GROUP_SCHEMA. Thus a property listed as part of a PROPERTY_GROUP_SCHEMA where a listed property itself is assigned to category the property will be a member of the category assigned group.

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 type
  • manifest_version – sets the version of the schema type
  • description – describes the entire group schema
  • groups – 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 group
      • message_key – sets a system message key that can be used for translation and replaces the canonical label for the group if specified
      • property_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

Validation[edit]

The structure of this schema is validated by the following definition file for the schema structure: Octocat.png"property-group-schema.v1.json"

Notes[edit]

When grouping predefined properties provided by extension "Semantic Extra Special Properties"Adds some extra special properties to all pages the internal property keys ("id") need to be used. See the Octocat.png"definitions.json" file for the properties and their respective internal keys ("id"), e.g. ___REVID for special property "Revision ID".4


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".

The underlying schema changed between it's initial release with Semantic MediaWiki 3.1.0Released on 23 September 2019 and compatible with MW 1.31.0 - 1.33.x. and Semantic MediaWiki 3.2.0Released on 7 September 2020 and compatible with MW 1.31.0 - 1.35.x..23 Thus you need to migrate existing schemas to the new structure. See the link to an example for the migration provided below.

See also[edit]


References

  1. a b  Semantic MediaWiki: GitHub pull request gh:smw:3749
  2. a b  Semantic MediaWiki: GitHub pull request gh:smw:4045
  3. a b  Semantic MediaWiki: GitHub pull request gh:smw:4592
  4. ^  Semantic MediaWiki: GitHub issue gh:smw:4597