Help:Schema definition

(Redirected from Help:Schema definition)
Schema definition
Provide information about user-defined properties and categories
Table of Contents

Semantic MediaWiki 2.4.0Released on 9 July 2016 and compatible with MW 1.19.0 - 1.27.x. introduces the schema definition feature1 to provide information about user-defined properties and categories in a JSON format so that entity descriptions can be manged more easily and be accessible through a centralized method (with the intention to change specifications more easily by either a user or any from of program that can interact with the JSON format).

Features and limitations[edit]

  • Properties and categories defined by a schema are blocked by the SchemaManager from manual editing (incl. moving and deletion) to ensure that changes are in sync with the schema definition
  • Changes to an entity are automatically published using the SchemaUpdateJob
  • MW's JsonContentHandler API can be used the update/change the schema definition in a structured way
  • Type validation (e.g. use of a correct type annotation etc.) is not explicitly carried out by the SchemaManager, display of individual errors are handled by the corresponding property page (for an overview of possible mismatches a query like: [[Property:+]][[Has processing error text::+]] can be used)
  • Properties and categories not part of a schema will remain "free" in how they can be defined


Identifiers used within the format are mapped to:

  • 'type' as 'Has type',
  • 'importedFrom' as 'Imported from'
  • 'subpropertyOf' as 'Subproperty of'
  • 'correspondsTo' as 'Corresponds to'
  • 'constraintOf' as 'Allows value' or 'allowsValue' as 'Allows value'
  • 'fields' as 'Has fields'
  • 'units' as 'Display units'


    "description": "Schema list for Semantic MediaWiki",
    "version": "0.1",
    "properties": [
            "property": "Has description",
            "type": "Text",
            "importedFrom": "dc:description",
            "subpropertyOf": "Has text",
            "categories": [
                "Schema category2"
            "property": "Has additional description",
            "redirectTo": "Has description"
            "property": "Has wattage",
            "type": "Quantity",
            "units": "kW",
            "correspondsTo": [
                "1 W, Watt, Watts",
                "0.001 kW",
                "0.0013410220 hp, bhp, horsepower"
            "categories": [
                "Category one",
                "Category two"
    "categories": [
            "category": "City",
            "importedFrom": "dcterms:Location",
            "subcategoryOf": [


  1. ^  Semantic MediaWiki: GitHub issue gh:smw:1330