Difference between revisions of "Help:SMW"
BrettViren (talk | contribs) |
BrettViren (talk | contribs) |
||
Line 23: | Line 23: | ||
A property is like a generalized form of a category. A property has a page which contains a special property written like <nowiki>[[Has type::THE TYPE NAME]]</nowiki>. When creating properties through the class mechanism above this is all taken care of for you but if you wish to add new properties you need to know this detail. | A property is like a generalized form of a category. A property has a page which contains a special property written like <nowiki>[[Has type::THE TYPE NAME]]</nowiki>. When creating properties through the class mechanism above this is all taken care of for you but if you wish to add new properties you need to know this detail. | ||
+ | |||
+ | A property can be "made" out of thin air just by writing it in any page like <nowiki>[[The property name::THE PROPERTY VALUE]]</nowiki>. By default, properties are of type "page". This can be set or changed by editing the page that is created for "The property name" and either hand-editing the "Has type" value or if it has not yet been created using "Create with form" and choosing the type from the drop-down list. | ||
+ | |||
+ | Property names are case sensitive. It is recommended to keep to a consistent case convention. Along with the convention of taking on verb-like names, here are some examples: | ||
+ | |||
+ | * Has name | ||
+ | * Has url | ||
+ | * Is owned by | ||
+ | * Is capital of |
Revision as of 20:48, 23 October 2014
Contents
Use of Semantic MediaWiki extensions in this wiki
General
SMW adds the idea of named properties to MediaWiki. These are generally organized into a "class" similar in concept to a class in the Object-Oriented programming paradigm. A class consists of:
- A set of associated parameters making up the "object" instance of a class
- A form to create and edit instances
- A category to collect all instances of a particular class
- Some views into of a subset of a classes parameters and possibly across a collection of objects
Creating a class
In this wiki, creating a class is done by an admin. Go to Special:SpecialPages and find the link for creating a class. The convention is to name *fields* with noun-like names like "something" and *properties* with verb-like names "Has something" or "Is something.
The field names are what are used when calling the template that defines the object instance of the class. The property names are what are used later to query these objects.
Pick the same name for the template, form and category and do not check the box about including multiple times on the page. Pick a default output format as seems best suited.
When naming and populating the fields and properties, keep in mind how instances of this class may relate to others that exist or are expected in the future. Following consistent naming conventions helps. In particular, reuse existing property names if they match conceptually.
Properties
A property is like a generalized form of a category. A property has a page which contains a special property written like [[Has type::THE TYPE NAME]]. When creating properties through the class mechanism above this is all taken care of for you but if you wish to add new properties you need to know this detail.
A property can be "made" out of thin air just by writing it in any page like [[The property name::THE PROPERTY VALUE]]. By default, properties are of type "page". This can be set or changed by editing the page that is created for "The property name" and either hand-editing the "Has type" value or if it has not yet been created using "Create with form" and choosing the type from the drop-down list.
Property names are case sensitive. It is recommended to keep to a consistent case convention. Along with the convention of taking on verb-like names, here are some examples:
- Has name
- Has url
- Is owned by
- Is capital of