This post was originally intended as a reply to this thread, where people post example uses of the Semantic Search function on the wiki, but then I added too much depth and it basically became a fairly comprehensive guide on using the semantic search. It probably belongs in the Wiki Guides category?
In this thread from Aaron HexBreaker, Aaron wanted to know if there are any fish or shark creatures he could extract animus from to make house guests. The point was made that no extract fish/shark spell exists; however some fish or shark may be undead in Celestia (and some potential enemies were suggested).So I made this semantic search to help him out.Originally Posted by Aaron HexBreaker
Here's how I did it:
It's in fact very easy to find this sort of information with queries! First, we need to know the following:
- how the wiki stores/classifies creature type, and valid classifications (i.e. Fish, Shark, Undead, etc.)
- where the extractable-status of a creature is stored (as a property or category)
To investigate both of these, I first went to a creature page that I knew had animus that could be extracted, in this case Rotting Fodder. To get the information we're after, we want the Browse Properties button in the lower left:
This leads to a page with a table containing a whole host of info about the page, and clues as to how the wiki stores this info internally. After skimming the table, I identified the relevant info sections:
- If you're not quite sure which of these properties matter for you, you can always investigate further by clicking them (as all the names on the properties page are links), or browsing the properties of other pages you might think of.
Now we know how the wiki stores this information: qualities such as undead, fish, shark, etc. appear stored under the property "Class", and creatures that are extractable seem to fall under the category of "Monstrological Creatures".
However, we still don't know what valid values "Class" can have; can Class be "Draconian"? How about "Tree"? Well, we can click on the property "Class" on the properties page, but that just spits out some pages that use Property:Class (all creatures and snacks, apparently), as well as the values each page stores under that category. No way could we be expected to look through all creatures to find what classes work. The way to go is the search bar! The wiki has categories for valid values for many properties, and most can easily be found via search. If we search "class category", the top result is Category:Creature Classes, the exact page we want. Visiting that page gives us a list of all the different classes creatures can have.
Note: this category (like most categories) is reachable from the sidebar menu:
We now have all the information we need for our query.
On to creating it!
First, navigate to the Semantic Search page (internally called Special:Ask):
The "Querying help" button at the bottom of this page links to the Semantic MediaWiki online reference manual, but the documentation isn't the best. I've cherry-picked particular pieces of information for smoothness of reading, and cited the Semantic MediaWiki help page where I found that piece of information.
When querying categories, we use
[[Category:<category_name>]]
When querying properties, we use
[[<property>::<property_value>]]
Source: Selecting pages
So to find extractable fish, we should use the queryCode:[[Category:Monstrological Creatures]][[Class::Fish]]
When querying, if we want to include multiple possible values for a property (a logical "or"), we use
[[<property>::<property_value1>||<property_value2>]]
Source: Unions of results
So to find extractable fish, sharks, and water-lurkers, we should use the queryCode:[[Category:Monstrological Creatures]][[Class::Shark||Fish||Water-Lurker]]
Finally, it would be nice to be able to see what classes the results we get have.
To display all the values assigned to a certain property, we write simply a question mark followed by the property name
?<property>
Source: Displaying Information
We want to display the "Class" property, soCode:?Class
And after adding the finishing touches, we find...
...three results:
Marcio
Thunderfin
Yogash
I hope this helps you in querying the wiki yourself! If you want to find some information through the wiki not covered here, just ask and I might make another tutorial on it. (Or, if it's relatively minor, I'll at least tell you how.)
Bookmarks