Personal tools

Semantic MediaWiki

From OrganicDesign Wiki

Jump to: navigation, search

Semantic MediaWiki (SMW) is an extension of MediaWiki which uses semantic technology, thus turning it into a semantic wiki. While articles in MediaWiki are just plain texts, SMW allows users to add structured data, comparable to the data one would usually store in a database. SMW uses the fact that such data is already contained in many articles: users just need to "mark" the according places using semantic annotations so that the system can extract the relevant data without "understanding" the rest of the text. With this information, SMW can help to search, organise, browse, evaluate, and share the wiki's content.


Contents

1 Using SMW for Organisation

From our perspective the key feature that SMW offers us is the ability to modify our structured templates (such as Template:Contact, Template:Book or Template:Transaction) so that they include semantic annotations which make the templates parameters into formal properties which can be include in ask queries. This aspect is important for us because it allows us to use templates as a kind of in-wiki object instance similar to what we were trying to achieve with XmlWiki. DPL is not able to do queries on template parameters, and SMW is more suited to the job and also moves our organisational system into the web3 arena.

To make maximum use of this in-wiki-object idea we need to be able to have a generic selection methodology coupled with actions and reports, so the the selected articles can be manipulated or analysed. The Selections extension is being developed to handle this aspect. This would probably ties in with Schedule as well.

Another aspect of organisation is workflow, which could be made into a more formal system by making the templates used as workflow phases to exhibit annotations too so that current work can be integrated with selections and schedule.

2 Special pages

In addition to extending the wikitext with semantic annotations, Semantic MediaWiki also adds the following special pages to the wiki:

3 Properties

Properties can be viewed as "categories for values in articles". Rather than categorizing an entire article now specific parts (values) in an article can be grouped together into Property: categories. The syntax for them is simple,

[[property name::value]].

Attributes and relations have now been combined into the single concept of properties. See our local news item from 20 October 2007. When you create a property associated with a link using the "::" syntax, for example [[Semantic::Semantic MediaWik]] , it creates the link and automatically creates an article Property:Semantic in the Property: namespace. Notice that the link is red, this article can only be seen in view mode (not edit mode), so if it is a new property you need to remove action=edit from the url, e.g. Property:Semantic

The relationships are formed as triples (subject, predicate, object).

If you have a page called Berlin and you create a link inside it;

  [[Capital of::Germany]]
  • Capital of is the predicate or relationship.
  • Berlin is the subject
  • Germany is the object

4 Multiple instances of the same semantic property in an article

The problem centers around adding semantic properties to tables contained within articles. Semantic mediaWiki is not really designed to have many of the same property defined with an article. This creates a one to many relationship between the article and the property which is not scalable. If a semantic property defines a tables column property type e.g. [[Name:: ... ]] for large tables with many semantic properties in the same article it is possible to get a SMW error when putting the table wikitext into an article

Fatal error: Maximum execution time of 30 seconds exceeded in /Library/WebServer/Documents/mediawiki-1.12.0/includes/StringUtils.php on line 296

This is a non standard approach to using Semantic MediaWiki because generally there should not be a one to many relationship of the same property assigned to a single article. Typically a table with multiple instances of the same property will fail if over about 300 rows with around 6 semantically defined columns.

Rob tested that it works fine in a one-to-many way, which is good for allowing one article to be related by the same relationship to many other articles (such as a person being associated with many other people). The problem is when this is done en-mass.

4.1 Fact box

Another problem is that the SMW factbox does not concatenate the number of multiple entries for a property , and takes time to retreive from the server.

4.2 Categorize structured articles

The solution is to take each row of a table and create a unique article for it with semantic properties for each cell, and some sort of categorization. This maintains the semantic properties in a one to one property to article relationship (or one to not very many) then the dynamic ask queries can retrieve

5 See also

The GNU Project Debian Linux Ubuntu Linux Wikipedia online encycopedia MediaWiki