SubSurfWiki:Training/Semantic MediaWiki

Semantic MediaWiki is a family of extensions that enable us to to do interesting and exciting things in the wiki. In essence, they let us treat quantitative and structured information as data. In a sense, we can make the wiki 'understand' some of its content, and use that understanding to display it in a certain way, or make queries, as we would in a database.

Basic structure of a semantic property
Imagine we have Category:Rocks, containing pages like sandstone, limestone, and shale.

You make an instance of a semantic property with some special link syntax:. For example we might do this on the sandstone page:.

The default property type is a page, so now we have implied that there is a page called 0.15. So we need to change this property to another type. To do this, we go to the page Property:Porosity and add the code has type::quantity. Now references to porosity don't get a link.

Once we have some porosities, we can make interesting queries. On any page in the wiki, we can make a query like this:

If we defined other properties on the rock's page, such as color, density, and gamma ray, we could ask for some of those too:

We can also use Special:Ask to build queries.

Special:Properties lists all the properties in this wiki.

Quantities
One simple way to use Semantic MediaWiki is for conversion factors. For example, a built-in property, property:temperature, allows us to convert between temperature scales: temperature::50&deg;C. Another property, property:Oip, is for oil in place numbers.

Defining new conversion properties for other units is easy, as long as the conversion factor is linear. Look at the wikitext on the property pages, e.g. property::oil rate, to see how to add corresponds to tags to the page.

For non-linear conversion factors, we can adapt the code for the temperature conversion factor. Not difficult, bet requires editing a PHP file and placing it on the server. It can be done.

EXERCISE
Choose a quantity type from conversion factors and make a new property for it.