Säsongsmat

From semantic-mediawiki.org
Jump to: navigation, search
Säsongsmat
Wiki of the Month September 2011
Image for Säsongsmat
Statistics (2012/03/15)
Pages: 4245
Users: 50 (5 active)
Properties: 215
Categories: 140
Templates: 222
Forms: 9

Säsongsmat is a wiki-based project which began earlier this year, but is still very much a work in progress. An iPhone app is in development and is expected to be released soon. Säsongsmat's focus is sharing food recipes as well as offering ecological, economical and nutritional information about the each ingredient in the recipe (i.e. when they are available without having been transported around the globe or produced in heated green houses). This wiki is in Swedish only, and is intended for a Scandinavian audience, but it could easily be translated and expanded geographically if people elsewhere are interested.

Contents

Contents

The wiki consists of articles about ingredients (e.g. Jordgubbar), recipes (e.g. Flädersaft) and various lists (e.g. All recipes, Names in different languages, etc)

Seasons are given for different geographic zones, with a special zone, 0, being set when any other zone is set.

Usage

The contents is intended to be useful for other sites, apps, etc, such as a WordPress plugin to add seasonal information to recipes, an iPhone soon to be released, etc. Some extra functions are added to the API to make it easier to extract information.

Semantic data

Artikel.png
Most data displayed in infoboxes, lists etc, use SMW, to make it easlily accessible by other sites through the API. This includes data drawn from other sites, such as the nutritionaly information, data from UN FAO (the data below the automatically generated svg maps in many articles), etc. This makes it easy to find, say, sources of vitamin E during february, or whatever you can come up with.

Date/time duration workaround

As there is no SMW support for durations of time, the seasons are given as a set of days during the year when something is in season. The dates use a randomly chosen year (1912) for this (had to be a leap year for obvious reasons). API requests for seasonal information however converts dates to corresponding date in 1912, so asking for, say, ”fish in season this week” works as intended.

Recipe seasons

The only thing that is not easily achieved using SMW is the seasons for recipes, as they are based on the ingredients of the recipes. To find seasons for recipes you have to use custom API requests, or parser functions if you're within the wiki. A recipe is in season when all ingredients that have a season are in season.

Social Networking

Lista.png
Säsongsmat is designed to update Facebook and Twitter automatically every day. Items that are new in season are automatically published on Twitter and Facebook every morning (<5 items / week). All articles have individual like-buttons, and only the like button on the main page is connected to the actual fan page (the other buttons will make you like, say, "pumpkin" rather than "Säsongsmat".

Custom extensions

Most of the custom extensions that were created for this wiki are interconnected with the skin. Some of them also deal with the seasons that are stored as a number of dates during a specific year, the geographic zone system, etc. A few of these extensions may be of general interest, but most are site specific.

All of the source code will be available under FreeBSD or similar permissive licenses. Links are posted here (Swedish) and here (English).

Ssm-Feeds Creates an RSS/atom feed similar to the one for new articles, but showing the latest items (recipe or ingredient) in season. Connected to Facebook and Twitter.
CustomTOCLength Allows for adjusting the number of headings for which to show the table of contents (MediaWiki has no option for this).
FAO-parser Accesses FAO (United Nations foods and agricultural organisation) data to print tables or create SVG maps over imports, exports and production, via parser functions. (See for instance the maps in http://xn--ssongsmat-v2a.nu/ssm/P%C3%A4ron) Also contains API functions. (All data should be inserted as semantic data through the extension External Data instead, this is yet to do).
Image Page Print Link Adds a link to the table of contents in the top of every image descriptions page offering to print the image in one click (link visible if the browser supports Javascript printing).
Is Type Tries to guess what semantic property should be used for an input, looking at the units. This is used in recipes, to determine if an amount is a weight, a length, etv. Thus ”2 kg” can automatically be marked as a weight, etc. Ugly function, but working for us.
Streckkoder Prints data from a bar code database as semantic internal objects in the articles. Should start using the extension External Data instead.
SLV-parser Prints data from a nutrition database as semantic properties in the articles. Should start using the extension External Data instead.
Ssm First Paragraph Marks the first paragraph of an article with HTML5 micro data tags as ”introduction” (useful to make recipes show up in Googles recipe search, etc.).
SSM Mikrodata Tags to add HTML5 micro data to the output page. Extensively used in recipes.
Ssm Mikrodata-hooks Hooks to add HTML5 micro data tags to images and files, where it can't be done through tags.
SSM-artikel no longer used
SSM-datum Extra date-handling parser functions, such as adding a number of days to a date (for complex semantic queries, like checking what is soon not going to be in season anymore), etc.
SSM-säsong Parser functions for fetching information about seasons (as getting a long list of dates is not very useful). This will give you human readable strings such as ”from March 20th to September 1st”, ISO formated starting and ending dates, etc.
Säsongsrad Prints the seasons indicator shown in (almost) all lists.
Säsongsvisare Same as above, but adds it to the top of every article.
User Info Parser functions returning some user info such as if the user is logged in or not (to be able to show different messages to different users in some forms).
Visa credd Prints a list of contributors in the article.
Zonparser Parser functions to display zone information (in what geographical zone is the user), used in queries to get the right seasons in all lists.
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox