Semantic MediaWiki concepts



Please see the discussion page.

Note: this page is about ideas central to semantics and SMW, not about the SMW prestored queries, also called Concepts.

SMW has implemented a relatively modest number of semantic concepts from those available from the scientific field of semantic technologies, with which knowledge may be recorded. However, even with a small number of different building blocks, the most wonderful things can be built (as anyone familiar with Lego can attest). We will give a short description of the concepts, with some examples of how they could be used to record knowledge.


In semantics, a "class" is a way to type resources, i.e. to mark them as elements of a certain aggregation. We would expect a class to contain members that share a number of characteristics; i.e. every person we know is a member of the class "human being", and (most) cats are member of the class "pets". On the other hand we wouldn't at first glance think of "tomato ketchup", "grandparents" and "conservative" to be items of a single class (although they all belong to the classes "English words" and "words that contain the letter 'e'").

Furthermore we can type a single resource in different ways, so a single resource can be a member of many classes. For instance, my father fits in the classes "human being", "man", "father", "Dutch national", "football player", and regularly can be classified as "tourist".

If you consider a page in your wiki to represent "something", then you can classify that "something", meaning you can research to what classes your page (i.e. the "something") might belong. Next you can record your classification on the wiki page that represents the "something". The page is then a member of each of the classes you've recorded.

Application note: the SMW way of classifying a page is to put that page in a category. In other words: MediaWiki categories are SMW classes


A "property" is a way to describe a particular characteristic of a resource. A defining trait of a property is that it has a "data type". For instance, the properties "height", "length" and "width" have a data type of "length", which can be expressed in units ranging from millimetres and mils to kilometres and parsecs. Properties "weight" and "net content" have a data type of "mass", with corresponding units of measurements like the kilogram and the pound.

Properties are described in triples: "resource" "has property" "value", for instance "the Eiffel tower" "has height" "324 meter". The first part of the triple is called the subject, the second part the predicate, and the third part the object.

Physical properties that can be expressed in any of the seven base SI units or derivatives thereof are easily identified as a characteristic of a resource. However, one could also devise properties that are to a degree more abstract, like

  • "name", data type "string",
  • "birth date", data type "date",
  • "latitude", data type "geographic coordinate" expressed in "degrees"
  • "home phone", data type "telephone number" expressed as a series of numbers and a limited set of characters like + and /
  • "religious denomination" expressed as a text string, like "roman catholic" or "sunni"

If you consider a page in your wiki to represent "something", then you can describe characteristics of this "something" using properties, which you record on the wiki page that represents the "something".

Application note: the SMW way of assigning a property is to use an expression like [[Has genus::Dasypus]] on a page about the nine banded armadillo


A "relation" is an identifiable link between two resources. Just as a property, it can be expressed as a triple: "resource A" - "has relation R with" - "resource B". Thus, just as with properties, the subject is the resource; however, the object is another resource, instead of a property value.

For instance: one could say that city "Amsterdam" has a relation "is capital city of" with resource "the Netherlands", thus indicating the meaning "Amsterdam is the capital of the Netherlands". Note, however, that if A has a particular relation R with B, then the opposite does not necessarily hold. Just look at the previous example: while Amsterdam certainly is the capital of the Netherlands, the relation cannot be interpreted in reverse direction "as is": the Netherlands is not the capital of Amsterdam. (and the relation "has capital city", which DOES hold, is a different relation!)

The relation has a unique identifier, and it makes good sense to use a recognizable name for that. As a counterexample: if we were to assign relations an identifying number, and were to say "Amsterdam" "has relation 42 with" "The Netherlands", then it would be much harder for humans to correctly interpret the meaning. Furthermore, the chance of other users of the wiki correctly using this relation on other pages are very slim indeed. More information on this is found elsewhere in this user manual.

Application note: the SMW way of assigning a relation is almost equal to assigning properties; the expression looks the same, e.g. like [[Has capital::Amsterdam]] on a page about the Netherlands. However, the type of the property "Has capital" is "page".