Difference between revisions of "Semantic Wiki"

From BattleMaster Wiki
Jump to navigation Jump to search
Line 141: Line 141:
 
| string
 
| string
 
| see above under positions for why this is a string value
 
| see above under positions for why this is a string value
 +
|-
 +
| [[Property:prestige|prestige]]
 +
| the prestige bonus this item grants
 +
| number
 +
|
 +
|-
 +
| [[Property:abilities|abilities]]
 +
| other skill boni or abilities that the item posesses
 +
| string
 +
|
 
|}
 
|}
  

Revision as of 11:17, 11 March 2009

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 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.

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.


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

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.

Below are the terms that are set and fixed. Please do not modify this list - put new suggestions on the talk page.

In addition to these terms, we use Categories to indicate what kind of thing the subject is. So every region should be in and every realm in and every person in - well, a category we still have to create. (also note, it would be cleaner to rename these to singular, we'll do that sometime in the future)


Property Meaning Type Example Uses / Notes
Generic Properties
located on game-world the subject can be found on page [[located on::Atamara]] tells us this realm, region, religion or whatever can be found on the island/continent Atamara
part of general parent/child relations between items and places page Mostly used to note on region pages which realm and duchy they belong to, for example: [[part of::Sirion]]. This should be used in all the region infobox templates.
member of general parent/child relations of characters and persons page Denotes which realms, but also which family a character belongs to, e.g. [[member of::Hawk Family]] or [[member of::Outer Tilog]]
Properties for Regions
population population count of the region - population of realms is calculated automatically from its regions number
is regiontype region type as given by the game string
has feature describes relevant details of a place string Use on the region page. Values can be things like "mountains", "river", "coast", "forest", "desert", "road", "bridge", etc. You can use this feature multiple times if appropriate. Do not concatenate - use [[has feature::mountains]] [[has feature::river]] and not [[has feature::mountains,river]]
capital of specific property to indicate that a region is capital of a realm page Use on the region page. The realm should use semantics to automatically find its capital.
has lord
has knight
Denotes the position(s) of the regions and the people filling them string see below under ruler, etc. for more notes
Properties for Persons
father of
son of
brother of
etc.
general parent/child relations of characters and persons page detail family relationships, expand as needed but please use this syntax
death date day of death of this person date
Properties for Realms, Guilds, Religions (i.e. abstract entities)
founding date the day the subject was created or founded date
founded by Denotes guilds or religions that the character has founded string As the positions below, a string type.
has ruler
has judge
has general
has banker
Denotes the position(s) and the people filling them string This could also be implemented the other way around, e.g. "ruler of" on the character page. However, many characters do not have a wiki page at all, or not their own page (i.e. all characters are described on the family page). In templates using this property, it is suggested to include an optional link to the character page.
has state religion Denotes that a realm has a state/official religion, and which one page
government type is Denotes the government type of a realm string We're using a string because while there is a page on government systems, the individual systems do not have their own pages
Properties for Unique Items
is itemtype item type as given by the game string
discovery date the day the item was found or created date
discovered by the character who found or discovered the item string see above under positions for why this is a string value
prestige the prestige bonus this item grants number
abilities other skill boni or abilities that the item posesses string

Further terms will be added as we discuss and agree on them.


General Notes on Types

page 
These are types where the property is a page itself, e.g. a realm or region (which have their own pages), etc.
numbers 
These types must contain a valid number, even if that is a guess or approximation. Terms like "ca. 1 mio" are invalid, use "1000000" instead, and if you want a different display, the pipe trick. Example: [[population::5200|ca. 5000]]
date 
See Semantic MediaWiki Manual for details and syntax.


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.