Difference between revisions of "Semantic Wiki"

From BattleMaster Wiki
Jump to navigation Jump to search
 
(36 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Introduction =
+
{{rightTOC}}
 
The BattleMaster Wiki uses [http://semantic-mediawiki.org/ Semantic MediaWiki] to turn itself into a full-blown [http://en.wikipedia.org/wiki/Semantic_Web Semantic Web].
 
The BattleMaster Wiki uses [http://semantic-mediawiki.org/ Semantic MediaWiki] to turn itself into a full-blown [http://en.wikipedia.org/wiki/Semantic_Web Semantic Web].
  
 
What does that mean when we strip out the buzzwords?
 
What does that mean when we strip out the buzzwords?
  
It means that - with proper markup - the wiki "understands" its own content, and can generate answers to fairly complicated questions such as "which realms (on any island) have the highest population-to-nobles ratios?" - not because any human has actually done the math, but because the wiki contains information about the realms, their populations and the number of nobles in them, and can do the math itself.
+
It means that - with proper markup - the wiki "understands" its own content, and can generate answers to fairly complicated questions such as "which realms (on any island) have the highest population-to-nobles ratios?" - not because any human has actually done the maths, but because the wiki contains information about the realms, their populations and the number of nobles in them, and can do the maths itself.
 
 
Yes, we can use external data sources and with time the game will be extended to offer them. That means that Semantic Web also means you do not have to hand-craft (and update constantly) the boxes that contain basic realm data such as name, regions, population, etc.
 
  
 +
The semantic wiki can also pull data directly from the game, using the [[External Services and Tools]]. This allows the semantic data to be updated automatically to reflect the current state of the game, and in almost all cases of game data, you don't have to manually enter (and update constantly) this data.
  
 
= Scope =
 
= Scope =
Line 13: Line 12:
  
  
= Ontology =
+
= Support =
This is where we define what is and what isn't, i.e. the semantic relations that we want to use. This is necessary or useful because it avoids duplications that would really mess things up. For example, if we call the game worlds "islands" in some cases and "continents" in others, that will make a lot of queries faulty, as their results will only show those instances that were annotated one way or the other.
+
* [[/Templates]] discusses templates you can use to make use of Semantic Web functions with minimal additional hassle.
 +
* [[/Concepts]] explains what concepts are and how to use them. It also lists the concept pages we have created.
 +
* [[/Lists]] can be dynamically generated from semantic data, and replace all the manually updated ones (such as [[Template:Realms of Atamara]].
 +
 
 +
 
 +
= Editing =
 +
To enable semantics, you need to add so-called ''properties'' to the links in your pages. A property is simply an additional word or two that tells the computer what the link ''means''. For example, when Keplerville links to Keplerstan, the computer has no way of knowing what that link means. However, when you tell it explicitly <nowiki>[[capital of::Keplerstan]]</nowiki>, the computer knows that Keplerville is the capital of Keplerstan.
 +
 
 +
'''Do not create new properties without approval.'''
 +
Properties listed in the table below can be added to pages or templates as appropriate. If you need a property that is not yet defined, make a suggestion on the talk page. '''Any and all properties added to the wiki without approval will be deleted and all changes to your pages that use them will be reversed.'''
 +
 
 +
This is a very strict policy, quite contrary to how a wiki otherwise works, but if we don't do it this way, the semantic system will not work. Or do ''you'' want to write all your queries like "if GOLD or GOLD_INCOME or GOLD_PRODUCED or GOLD_OF_REGION or PRODUCES_GOLD > 100" - you get the idea? Just because everyone defined their own properties?
 +
 
 +
 
 +
== Ontology ==
 +
The terms and properties we use are defined on the [[Ontology]] page.
 +
 
  
Below are the terms that are set and fixed. Please do not modify this list - put new suggestions on the talk page.
+
= Searching and Inline Results =
 +
To use semantics on your pages, use the parser commands #ask or #show. Here are a few examples:
 +
* The population of Keplerstan is: (<nowiki>{{#show: Keplerstan | ?population}}</nowiki> = {{#show: Keplerstan | ?population}})
 +
* alternative syntax for the above: <nowiki>{{#ask: [[{{PAGENAME}}]] | ?population = }}</nowiki>
  
; [[Property:located on]] : denotes the game-world the item can be found on, e.g. <nowiki>[[located on::Atamara]]</nowiki> tells us this realm, region, religion or whatever can be found on the island/continent Atamara
+
* The capital of Keplerstan is: (<nowiki>{{#ask: [[capital of::Keplerstan]] | default=unknown }}</nowiki> = {{#ask: [[capital of::Keplerstan]] | default=unknown }})
; [[Property:population]] : denotes the population of an item, usually a region or a realm. This is a number type, so it must contain a valid number, even if that is a guess or approximation. Terms like "ca. 1 mio" are invalid, use "1000000" instead. Example: <nowiki>[[population::5200]]</nowiki>
 
  
Further terms will be added as we discuss and agree on them.
+
Use the magic word <nowiki>{{PAGENAME}}</nowiki> to get facts about the current page. See the source code on the [[Keplerstan]] page for an example.
  
 +
To generate tables or lists, you can use queries like this:
 +
<nowiki>{{#ask: [[Category:Regions]] [[located on::Dwilight]]
 +
| mainlabel = Region
 +
| ?population = Population
 +
| ?is regiontype = Type
 +
| ?part of = Realm
 +
}}</nowiki>
  
= TODO / Questions =
+
See [http://semantic-mediawiki.org/wiki/Help:Inline_queries Semantic Wiki Manual] for details on how to write queries.
* Do we want to add [http://www.mediawiki.org/wiki/Extension:Halo_Extension Halo] ?
 

Latest revision as of 11:00, 8 March 2010

The BattleMaster Wiki uses Semantic MediaWiki to turn itself into a full-blown Semantic Web.

What does that mean when we strip out the buzzwords?

It means that - with proper markup - the wiki "understands" its own content, and can generate answers to fairly complicated questions such as "which realms (on any island) have the highest population-to-nobles ratios?" - not because any human has actually done the maths, but because the wiki contains information about the realms, their populations and the number of nobles in them, and can do the maths itself.

The semantic wiki can also pull data directly from the game, using the External Services and Tools. This allows the semantic data to be updated automatically to reflect the current state of the game, and in almost all cases of game data, you don't have to manually enter (and update constantly) this data.

Scope

We are not aiming for the big thing, or integration with a world-wide semantic web. BattleMaster is it's own small world, with more well-defined terms and boundaries than the real world (where, for example, it isn't always clear what exactly a "realm" even is). As such, it is well-suited to using the Semantic Web technology.


Support

  • /Templates discusses templates you can use to make use of Semantic Web functions with minimal additional hassle.
  • /Concepts explains what concepts are and how to use them. It also lists the concept pages we have created.
  • /Lists can be dynamically generated from semantic data, and replace all the manually updated ones (such as Template:Realms of Atamara.


Editing

To enable semantics, you need to add so-called properties to the links in your pages. A property is simply an additional word or two that tells the computer what the link means. For example, when Keplerville links to Keplerstan, the computer has no way of knowing what that link means. However, when you tell it explicitly [[capital of::Keplerstan]], the computer knows that Keplerville is the capital of Keplerstan.

Do not create new properties without approval. Properties listed in the table below can be added to pages or templates as appropriate. If you need a property that is not yet defined, make a suggestion on the talk page. Any and all properties added to the wiki without approval will be deleted and all changes to your pages that use them will be reversed.

This is a very strict policy, quite contrary to how a wiki otherwise works, but if we don't do it this way, the semantic system will not work. Or do you want to write all your queries like "if GOLD or GOLD_INCOME or GOLD_PRODUCED or GOLD_OF_REGION or PRODUCES_GOLD > 100" - you get the idea? Just because everyone defined their own properties?


Ontology

The terms and properties we use are defined on the Ontology page.


Searching and Inline Results

To use semantics on your pages, use the parser commands #ask or #show. Here are a few examples:

  • The population of Keplerstan is: ({{#show: Keplerstan | ?population}} = )
  • alternative syntax for the above: {{#ask: [[{{PAGENAME}}]] | ?population = }}
  • The capital of Keplerstan is: ({{#ask: [[capital of::Keplerstan]] | default=unknown }} = unknown)

Use the magic word {{PAGENAME}} to get facts about the current page. See the source code on the Keplerstan page for an example.

To generate tables or lists, you can use queries like this:

{{#ask: [[Category:Regions]] [[located on::Dwilight]]
 | mainlabel = Region
 | ?population = Population
 | ?is regiontype = Type
 | ?part of = Realm
 }}

See Semantic Wiki Manual for details on how to write queries.