Help:Semantics

From GMATClub

Jump to: navigation, search


{{#x:sidebar| Help: technical wiki documentation


index - edit this box }}


Semantics usually refers to meaning. Not so in this wiki. Here it refers to meaningless stuff related to the Semantic Media Wiki (SMW) extension we heavily use.

Semantic Facts

In a nutshell, SMW allows to write up facts. Each fact is a triple (Subject, Verb, Object), like, (User:bb, graduated from, Pepperdine).

  • The Subject is always a Wiki page. In fact, all the facts for a given Subject should be coded into the page "Subject."
  • The Verb is always a property, and has a corresponding page in the Properties: namespace. To see the growing list of properties in use, visit Special:Properties.
  • The Object is typically a wiki page, but can be text, number, date, place, or something else, depending on the verb. The type is specified on the Property:Verb page.

Writing Facts

How to add facts? They are similar to links, but annotated. The above example can be coded as the following, which should appear on the User:bb page:

[[Graduated from::Pepperdine (Graziadio)|]]

Notice four things here. First, the subject is User:bb because that's the page where the code appears. Second, the verb is Graduated from and it has a corresponding page Property:Graduated_from that explains how to use it. Third, we write [[Pepperdine (Graziadio)]] and not Pepperdine because there's a page by that name in the wiki. Always take care to link to pages that exist, if possible. Finally, the | sign appears to prevent the code from printing anything. You can put any text after the sign, just as in normal links, or omit the sign, in which case the Object will be printed. For example, the fact can be built into a sentence like this:

[[User:bb]] has graduated from [[Graduated from::Pepperdine (Graziadio)]].

Or, if we prefer just Pepperdine, like this:

[[User:bb]] has graduated from [[Graduated from::Pepperdine (Graziadio)|Pepperdine]].

Queries

The facts would be pretty useless if they did not allow to write queries. Queries always appear within <ask> tags, and return lists of things. Inside the tag, there are conditions that the items of the resulting list should match.

To learn the query syntax, check out the Ontoworld.org, the SMW home, specifically:

Here are a few working examples from this wiki. Let's search for users who are applying to UC Berkeley (Haas):

 <ask>[[User:+]] [[Applying to::UC Berkeley (Haas)]]</ask>

The first condition means search in the User: namespace, and the second is self explanatory. Here is what it produces:

 <ask>User:+ Applying to::UC Berkeley (Haas)</ask>.

Now let's get a list of high scorers (770+):

 
    <ask format="table" sort="GMAT" order="desc" link="all">
      [[User:+|User]]
      [[GMAT:=>770]] 
      [[GMAT::*| Score ]]
      [[Nationality::*]]
      [[Applying to::*|Schools]]
    </ask>
  

Here's the output:

 <ask format="table" sort="GMAT" order="desc" link="all">
   User
   [[GMAT:=>770]] 
    Score 
   Nationality::*
   Schools
 </ask>

Note that the first two lines in the code are conditions, and the final three are selectors.

You can always experiment with queries at the Special:Ask page.

Personal tools
Powered by MediaWiki